pyhdtkit 0.1.0__py3-none-any.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.
pyhdtkit/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from pyhdtkit.convert import hdt2ttl, hdtcat, ttl2hdt
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ __all__ = ["__version__", "ttl2hdt", "hdt2ttl", "hdtcat"]
pyhdtkit/convert.py ADDED
@@ -0,0 +1,66 @@
1
+ """Public conversion API for pyhdtkit.
2
+
3
+ These functions are the stable Python-facing surface. They currently raise
4
+ ``NotImplementedError`` — this is just the base scaffold. The pure-Python HDT
5
+ read/write and Turtle parse/serialize logic lands in a follow-up phase.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from pathlib import Path
11
+
12
+
13
+ def ttl2hdt(
14
+ input_path: str | Path,
15
+ output_path: str | Path,
16
+ *,
17
+ base_uri: str | None = None,
18
+ ) -> None:
19
+ """Convert a Turtle (``.ttl``) file to HDT (``.hdt``).
20
+
21
+ Args:
22
+ input_path: Path to the source ``.ttl`` file.
23
+ output_path: Path to write the resulting ``.hdt`` file.
24
+ base_uri: Optional base URI for resolving relative IRIs while parsing.
25
+
26
+ Raises:
27
+ ValueError: The ``.ttl`` file could not be parsed or the ``.hdt`` file could
28
+ not be written (e.g. malformed Turtle, or an unwritable output path).
29
+ """
30
+ raise NotImplementedError("ttl2hdt is not implemented yet")
31
+
32
+
33
+ def hdt2ttl(
34
+ input_path: str | Path,
35
+ output_path: str | Path,
36
+ ) -> None:
37
+ """Convert an HDT (``.hdt``) file to Turtle (``.ttl``).
38
+
39
+ Args:
40
+ input_path: Path to the source ``.hdt`` file.
41
+ output_path: Path to write the resulting ``.ttl`` file.
42
+
43
+ Raises:
44
+ ValueError: The ``.hdt`` file could not be read or the ``.ttl`` file could
45
+ not be written (e.g. a malformed HDT file, or an unwritable output path).
46
+ """
47
+ raise NotImplementedError("hdt2ttl is not implemented yet")
48
+
49
+
50
+ def hdtcat(
51
+ input_paths: list[str | Path],
52
+ output_path: str | Path,
53
+ ) -> None:
54
+ """Combine two or more ``.hdt`` files into a single ``.hdt``, de-duplicating triples.
55
+
56
+ Args:
57
+ input_paths: Paths of the ``.hdt`` files to merge (2 or more).
58
+ output_path: Path to write the merged ``.hdt`` file.
59
+
60
+ Raises:
61
+ ValueError: Fewer than 2 input paths were given, or an input ``.hdt`` could
62
+ not be read, or the ``.hdt`` file could not be written.
63
+ """
64
+ if len(input_paths) < 2:
65
+ raise ValueError("hdtcat requires at least 2 input .hdt files")
66
+ raise NotImplementedError("hdtcat is not implemented yet")
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.5
2
+ Name: pyhdtkit
3
+ Version: 0.1.0
4
+ Summary: Convert between RDF Turtle (.ttl) and HDT (.hdt) in pure Python — ttl2hdt, hdt2ttl, hdtcat.
5
+ Project-URL: Homepage, https://github.com/Shyam-Sundar-Reddy/pyhdtkit
6
+ Project-URL: Repository, https://github.com/Shyam-Sundar-Reddy/pyhdtkit
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.12
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=8; extra == 'dev'
12
+ Description-Content-Type: text/markdown
13
+
14
+ # pyhdtkit
15
+
16
+ A pure-Python package to convert between RDF Turtle (`.ttl`) and HDT (`.hdt`):
17
+
18
+ - `.ttl` → `.hdt`
19
+ - `.hdt` → `.ttl`
20
+ - combine two or more `.hdt` files into one
21
+
22
+ No CLI — `import pyhdtkit` is the interface. No Rust, no native extension.
23
+
24
+ ## Install (dev)
25
+
26
+ ```bash
27
+ pip install -e ".[dev]"
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ from pyhdtkit import ttl2hdt, hdt2ttl, hdtcat
34
+
35
+ ttl2hdt("graph.ttl", "graph.hdt")
36
+ hdt2ttl("graph.hdt", "graph.ttl")
37
+ hdtcat(["a.hdt", "b.hdt"], "combined.hdt")
38
+ ```
39
+
40
+ ## Status
41
+
42
+ Base scaffold. The public API shape above is stable, but conversion is not
43
+ implemented yet — each function currently raises `NotImplementedError`.
@@ -0,0 +1,6 @@
1
+ pyhdtkit/__init__.py,sha256=jD7ET34iUletNA1RmWWVJZoa4KusDAQsmpF2eKKN_vo,136
2
+ pyhdtkit/convert.py,sha256=Yg7rL_t7dCfTul29zm3ej4nru6jKEAQLsZqkBReweNQ,2160
3
+ pyhdtkit-0.1.0.dist-info/METADATA,sha256=pbVywcTiki7AD2KkMJzSrk9qctYgsbbRv9knuQ5zXmg,1111
4
+ pyhdtkit-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
5
+ pyhdtkit-0.1.0.dist-info/licenses/LICENSE,sha256=F_16S-wvboW4UBPOriGjEVr4_KBle8BkaFgyf-EieEA,1075
6
+ pyhdtkit-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shyam Sundar Reddy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.