gedcomkit 0.1.8__cp39-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gedcomkit/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from .gedcomkit import *
2
+
3
+ __doc__ = gedcomkit.__doc__
4
+ if hasattr(gedcomkit, "__all__"):
5
+ __all__ = gedcomkit.__all__
gedcomkit/__init__.pyi ADDED
@@ -0,0 +1,90 @@
1
+ """Type stubs for gedcomkit, an archival-grade GEDCOM library.
2
+
3
+ Views, findings and reports are plain dicts built from the core's JSON
4
+ serialization; their keys are camelCase, as the Rust types name them.
5
+ """
6
+
7
+ from os import PathLike
8
+ from typing import Any, TypedDict
9
+
10
+ from typing_extensions import NotRequired
11
+
12
+ __version__: str
13
+
14
+ class RecordSpec(TypedDict):
15
+ """A structure to add: only ``tag`` is required, and any other key is refused."""
16
+
17
+ tag: str
18
+ xref: NotRequired[str | None]
19
+ value: NotRequired[str | None]
20
+ children: NotRequired[list[RecordSpec]]
21
+
22
+ class WrappedLine(TypedDict):
23
+ record: str
24
+ path: list[int]
25
+ tag: str
26
+
27
+ class Gedcom:
28
+ @staticmethod
29
+ def parse(data: bytes) -> Gedcom:
30
+ """Read a document from a file's bytes; raises ValueError past the bounds."""
31
+ @staticmethod
32
+ def new_v551(source_system: str) -> Gedcom:
33
+ """An empty GEDCOM 5.5.1 document naming its producing system, declaring UTF-8."""
34
+ @staticmethod
35
+ def new_v7() -> Gedcom:
36
+ """An empty GEDCOM 7.0 document."""
37
+ @property
38
+ def encoding(self) -> str: ...
39
+ @property
40
+ def version(self) -> str | None: ...
41
+ @property
42
+ def content_records(self) -> int: ...
43
+ def records(self) -> list[dict[str, Any]]: ...
44
+ def record(self, xref: str) -> dict[str, Any]: ...
45
+ def individuals(self) -> list[dict[str, Any]]: ...
46
+ def families(self) -> list[dict[str, Any]]: ...
47
+ def validate(self) -> list[dict[str, Any]]: ...
48
+ def unresolved_pointers(self) -> list[dict[str, Any]]: ...
49
+ def parents_of(self, xref: str) -> list[str]: ...
50
+ def children_of(self, xref: str) -> list[str]: ...
51
+ def partners_of(self, xref: str) -> list[str]: ...
52
+ def append_records(self, records: list[RecordSpec]) -> None:
53
+ """Add records before the trailer, all or none; raises ValueError."""
54
+ def append_structures(
55
+ self, record: str, path: list[int], structures: list[RecordSpec]
56
+ ) -> None:
57
+ """Add substructures under ``path`` in ``record`` (an xref, or "HEAD")."""
58
+ def wrap_long_lines(self, max_line_bytes: int = 255) -> list[WrappedLine]:
59
+ """Split lines over the limit across CONC lines and name each one rewritten."""
60
+ def set_logical_value(self, xref: str, path: list[int], value: str) -> None: ...
61
+ def to_text(self) -> str: ...
62
+ def to_bytes(self) -> bytes: ...
63
+ def to_version7(
64
+ self, owned: list[tuple[str, str]] | None = None
65
+ ) -> tuple[Gedcom, list[dict[str, Any]]]:
66
+ """Convert to GEDCOM 7.0. ``owned`` declares the caller's own
67
+ extension tags as ``(tag, uri)`` pairs; any other extension is
68
+ declared as undocumented rather than dropped."""
69
+ def to_version551(self) -> tuple[Gedcom, list[dict[str, Any]]]: ...
70
+ def __len__(self) -> int: ...
71
+
72
+ class ArchiveWriter:
73
+ @staticmethod
74
+ def new() -> ArchiveWriter: ...
75
+ def add(self, name: str, data: bytes) -> None: ...
76
+ def finish(self) -> bytes: ...
77
+
78
+ class ArchiveFileWriter:
79
+ """A GEDZIP archive written straight to a file, one entry at a time."""
80
+
81
+ def __init__(self, path: str | PathLike[str]) -> None: ...
82
+ def add(self, name: str, data: bytes) -> None: ...
83
+ def add_file(self, name: str, source: str | PathLike[str]) -> None: ...
84
+ def finish(self) -> int:
85
+ """Close the archive and return its size in bytes."""
86
+
87
+ def archive_total_size(data: bytes) -> int: ...
88
+ def parse_date(text: str) -> dict[str, Any]:
89
+ """A date reading; its ``gedcom551`` and ``gedcom7`` keys are the 5.5.1
90
+ and 7.0 spellings, each ``None`` when that grammar cannot hold it."""
Binary file
gedcomkit/py.typed ADDED
File without changes
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.4
2
+ Name: gedcomkit
3
+ Version: 0.1.8
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Programming Language :: Python :: Implementation :: CPython
7
+ Classifier: Topic :: Sociology :: Genealogy
8
+ License-File: LICENSE
9
+ Summary: An archival-grade GEDCOM library: byte-preserving round-trip, encoding detection and reporting, GEDCOM 5.5 through 7.x, GEDZIP. Rust core, Python bindings.
10
+ Keywords: gedcom,genealogy,parser,family-tree,gedzip
11
+ License-Expression: AGPL-3.0-or-later
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
+
15
+ # gedcomkit (Python)
16
+
17
+ Python bindings for **gedcomkit**, an archival-grade GEDCOM library written
18
+ in Rust: byte-preserving round-trip, encoding detection and reporting,
19
+ GEDCOM 5.5 through 7.x. A node no caller touched is written back byte for
20
+ byte; nothing is dropped for being unrecognized; hostile input is bounded.
21
+
22
+ ```python
23
+ import gedcomkit
24
+
25
+ doc = gedcomkit.Gedcom.parse(open("family.ged", "rb").read())
26
+ print(doc.encoding) # "Read as ANSEL, declared ANSEL"
27
+ print(len(doc), doc.version)
28
+
29
+ for person in doc.individuals():
30
+ print(person["names"], person["events"])
31
+
32
+ for finding in doc.validate():
33
+ print(finding["severity"], finding["message"])
34
+
35
+ # The family graph reads both directions of the link, so a one-sided
36
+ # file (FAMC only, no CHIL) still answers.
37
+ print(doc.parents_of("@I3@"))
38
+
39
+ # Edit one structure by the path its view carries; every untouched
40
+ # line still writes back byte for byte.
41
+ doc.set_logical_value("@I1@", [0], "Ada /Lovelace/")
42
+ open("family.ged", "wb").write(doc.to_bytes())
43
+ ```
44
+
45
+ Build from this directory with [maturin](https://maturin.rs):
46
+
47
+ ```
48
+ maturin develop # into the active virtualenv
49
+ maturin build --release # a wheel
50
+ ```
51
+
52
+ The Rust core lives at the root of the same repository; this crate
53
+ is a thin PyO3 layer over its public API.
54
+
55
+ License: AGPL-3.0-or-later, the same as the core (see LICENSE).
56
+
@@ -0,0 +1,9 @@
1
+ gedcomkit/__init__.py,sha256=Op9l5i81kqBAtE1sTZ8_nBRdvw8ibTDpmnpRh1Yu1o8,119
2
+ gedcomkit/__init__.pyi,sha256=jUtos8GpM_dXGB-zEAlZC3O80Xssbo80XmuCMZss4Q0,3598
3
+ gedcomkit/gedcomkit.pyd,sha256=XI-XBOEhPTUt84tgmNBLAnvTM_yfS7PrgQgfCCzZFug,931328
4
+ gedcomkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ gedcomkit-0.1.8.dist-info/METADATA,sha256=dq_zSV5j5rjLXdLVJM5s8pAG_cU4LIT6fZk2TWb9q-E,1979
6
+ gedcomkit-0.1.8.dist-info/WHEEL,sha256=_rgZdQc9sLFEqt2IemX7qyxsGt5fFRnBDATxGzerdmg,95
7
+ gedcomkit-0.1.8.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
8
+ gedcomkit-0.1.8.dist-info/sboms/gedcomkit-py.cyclonedx.json,sha256=lALnpFvCY0st8X0kCC3gV3JVlZNkuz079X8hn2SgakI,33905
9
+ gedcomkit-0.1.8.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.14.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-abi3-win_amd64