Skip to content

Add schema generation - #14

Merged
DavidMStraub merged 3 commits into
mainfrom
generate_schema
Aug 16, 2026
Merged

Add schema generation#14
DavidMStraub merged 3 commits into
mainfrom
generate_schema

Conversation

@DavidMStraub

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces first-class schema generation so datasets containing extension tags stored as URIs can be serialized by automatically adding the necessary HEAD.SCHMA.TAG declarations, and updates related formatting documentation.

Changes:

  • Add gedcom7.generate_schema(records) to declare missing URI-tag abbreviations in HEAD.SCHMA.
  • Add a comprehensive serializer test suite covering schema generation behavior (idempotence, collision avoidance, placement, corpus parity).
  • Refresh docstrings in gedcom7.format to clarify payload vs omitted-structure behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/test_serializer.py Adds new test coverage for schema generation and round-tripping of URI-tag abbreviations.
gedcom7/serializer.py Implements schema generation and extension-tag invention logic used to support dumps with URI tags.
gedcom7/format.py Clarifies documentation for format_value/set_value behavior around empty payloads vs omitted structures.
gedcom7/init.py Exposes generate_schema as a package-level API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gedcom7/serializer.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

gedcom7/format.py:36

  • The docstring examples use identifiers (Date, DATE, NO_DATE, ADOP) that aren’t defined in this module and also don’t reflect the actual type_id values accepted by format_value (it expects the GEDCOM terms URI keys used in const.payloads). This makes the examples misleading for users of the API.
        format_value(Date(year=2000), DATE)   -> "2000"
        format_value(DatePeriod(), NO_DATE)   -> ""     write an empty payload
        format_value(False, ADOP)             -> None   write no structure

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@DavidMStraub
DavidMStraub merged commit 1471cbd into main Aug 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants