Skip to content

Add write support - #10

Merged
DavidMStraub merged 3 commits into
mainfrom
write_support
Aug 12, 2026
Merged

Add write support#10
DavidMStraub merged 3 commits into
mainfrom
write_support

Conversation

@DavidMStraub

Copy link
Copy Markdown
Owner

No description provided.

@DavidMStraub
DavidMStraub requested a lite review from Copilot and removed request for Copilot August 12, 2026 14:26

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

Adds GEDCOM 7 serialization (“write support”) to complement the existing parser, including a public API (dump/dumps) and comprehensive round-trip/validation tests.

Changes:

  • Introduces gedcom7.serializer with dumps()/dump() and serialization validations (tags, xrefs/pointers, CONT splitting, banned characters, BOM, line terminators).
  • Updates core types/exceptions and package exports to support reliable equality (parent excluded from comparisons) and a new GedcomSerializeError.
  • Adds serializer-focused tests and updates README to document parsing + writing usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_serializer.py New test suite covering round-trips, encoding details, and serialization error cases
README.md Updates project description and adds serializer usage + dev command summary
gedcom7/types.py Excludes parent from dataclass comparison/repr to prevent recursive equality/representation
gedcom7/serializer.py New serializer implementation providing dumps/dump with spec-aligned formatting and validations
gedcom7/exceptions.py Adds GedcomSerializeError exception type
gedcom7/init.py Exports serializer API (dump, dumps) and GedcomSerializeError

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

Comment thread README.md Outdated
Comment thread gedcom7/serializer.py Outdated

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 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (3)

gedcom7/serializer.py:24

  • The BOM constant is defined as an invisible literal character, which is easy to miss/corrupt in editors and diffs. Using an explicit "\ufeff" escape makes this clearer and less error-prone.
_BOM = ""

test/test_serializer.py:81

  • This test asserts on an invisible BOM literal character. Using the explicit "\ufeff" escape makes the intent clearer and avoids issues if the file encoding/renderer hides or mangles the character.
    """The specification says a data stream should begin with U+FEFF."""
    out = gedcom7.dumps(gedcom7.loads(HEAD + TRLR))
    assert out.startswith("")
    assert gedcom7.dumps(gedcom7.loads(HEAD + TRLR), byte_order_mark=False) == (
        HEAD + TRLR

README.md:40

  • The Development command omits the formatting check that CI enforces (workflow runs ruff format --check .), so following the README can still fail CI due to formatting.
pytest && mypy && ruff check .

@DavidMStraub
DavidMStraub merged commit 1f8db60 into main Aug 12, 2026
6 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