pyhdtkit 0.1.0__tar.gz

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.
@@ -0,0 +1,33 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.12", "3.13"]
18
+ steps:
19
+ - uses: actions/checkout@v5
20
+
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - uses: astral-sh/setup-uv@v5
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Install package with dev extras
30
+ run: uv sync --extra dev
31
+
32
+ - name: Run tests
33
+ run: uv run pytest -q
@@ -0,0 +1,57 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v5
16
+
17
+ - uses: astral-sh/setup-uv@v5
18
+ with:
19
+ enable-cache: true
20
+
21
+ - name: Install package with dev extras
22
+ run: uv sync --extra dev
23
+
24
+ - name: Run tests
25
+ run: uv run pytest -q
26
+
27
+ build:
28
+ needs: test
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v5
32
+
33
+ - uses: astral-sh/setup-uv@v5
34
+ with:
35
+ enable-cache: true
36
+
37
+ - name: Build sdist and wheel
38
+ run: uv build
39
+
40
+ - uses: actions/upload-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+
45
+ publish:
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/download-artifact@v4
50
+ with:
51
+ name: dist
52
+ path: dist/
53
+
54
+ - name: Publish to PyPI
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+ with:
57
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,45 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ *.pyd
5
+ build/
6
+ dist/
7
+ wheels/
8
+ *.egg-info/
9
+ *.egg
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Environment files
18
+ .env
19
+ .env.*
20
+
21
+ # Testing / coverage
22
+ .pytest_cache/
23
+ .coverage
24
+ .coverage.*
25
+ htmlcov/
26
+ .tox/
27
+ .nox/
28
+
29
+ # Type checking / linting
30
+ .mypy_cache/
31
+ .ruff_cache/
32
+ .pytype/
33
+
34
+ # Packaging
35
+ *.tar.gz
36
+ *.whl
37
+
38
+ # Editors / OS
39
+ .vscode/
40
+ .idea/
41
+ .DS_Store
42
+ Thumbs.db
43
+
44
+ # Local notes / agent context
45
+ agentskill.md
@@ -0,0 +1 @@
1
+ 3.12
pyhdtkit-0.1.0/LICENSE ADDED
@@ -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.
@@ -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,30 @@
1
+ # pyhdtkit
2
+
3
+ A pure-Python package to convert between RDF Turtle (`.ttl`) and HDT (`.hdt`):
4
+
5
+ - `.ttl` → `.hdt`
6
+ - `.hdt` → `.ttl`
7
+ - combine two or more `.hdt` files into one
8
+
9
+ No CLI — `import pyhdtkit` is the interface. No Rust, no native extension.
10
+
11
+ ## Install (dev)
12
+
13
+ ```bash
14
+ pip install -e ".[dev]"
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ from pyhdtkit import ttl2hdt, hdt2ttl, hdtcat
21
+
22
+ ttl2hdt("graph.ttl", "graph.hdt")
23
+ hdt2ttl("graph.hdt", "graph.ttl")
24
+ hdtcat(["a.hdt", "b.hdt"], "combined.hdt")
25
+ ```
26
+
27
+ ## Status
28
+
29
+ Base scaffold. The public API shape above is stable, but conversion is not
30
+ implemented yet — each function currently raises `NotImplementedError`.
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pyhdtkit"
7
+ version = "0.1.0"
8
+ description = "Convert between RDF Turtle (.ttl) and HDT (.hdt) in pure Python — ttl2hdt, hdt2ttl, hdtcat."
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ license = { text = "MIT" }
12
+ dependencies = []
13
+
14
+ [project.optional-dependencies]
15
+ dev = ["pytest>=8"]
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/Shyam-Sundar-Reddy/pyhdtkit"
19
+ Repository = "https://github.com/Shyam-Sundar-Reddy/pyhdtkit"
20
+
21
+ [tool.hatch.build.targets.wheel]
22
+ packages = ["src/pyhdtkit"]
@@ -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"]
@@ -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,26 @@
1
+ import pytest
2
+
3
+ import pyhdtkit
4
+ from pyhdtkit import hdt2ttl, hdtcat, ttl2hdt
5
+
6
+
7
+ def test_exports() -> None:
8
+ assert pyhdtkit.__version__
9
+ assert callable(ttl2hdt)
10
+ assert callable(hdt2ttl)
11
+ assert callable(hdtcat)
12
+
13
+
14
+ def test_hdtcat_requires_at_least_two_inputs() -> None:
15
+ with pytest.raises(ValueError):
16
+ hdtcat(["only-one.hdt"], "out.hdt")
17
+
18
+
19
+ def test_ttl2hdt_not_implemented_yet(tmp_path) -> None:
20
+ with pytest.raises(NotImplementedError):
21
+ ttl2hdt(tmp_path / "in.ttl", tmp_path / "out.hdt")
22
+
23
+
24
+ def test_hdt2ttl_not_implemented_yet(tmp_path) -> None:
25
+ with pytest.raises(NotImplementedError):
26
+ hdt2ttl(tmp_path / "in.hdt", tmp_path / "out.ttl")
pyhdtkit-0.1.0/uv.lock ADDED
@@ -0,0 +1,78 @@
1
+ version = 1
2
+ revision = 3
3
+ requires-python = ">=3.12"
4
+
5
+ [[package]]
6
+ name = "colorama"
7
+ version = "0.4.6"
8
+ source = { registry = "https://pypi.org/simple" }
9
+ sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
10
+ wheels = [
11
+ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
12
+ ]
13
+
14
+ [[package]]
15
+ name = "iniconfig"
16
+ version = "2.3.0"
17
+ source = { registry = "https://pypi.org/simple" }
18
+ sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
19
+ wheels = [
20
+ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
21
+ ]
22
+
23
+ [[package]]
24
+ name = "packaging"
25
+ version = "26.3"
26
+ source = { registry = "https://pypi.org/simple" }
27
+ sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
28
+ wheels = [
29
+ { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
30
+ ]
31
+
32
+ [[package]]
33
+ name = "pluggy"
34
+ version = "1.6.0"
35
+ source = { registry = "https://pypi.org/simple" }
36
+ sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
37
+ wheels = [
38
+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
39
+ ]
40
+
41
+ [[package]]
42
+ name = "pygments"
43
+ version = "2.21.0"
44
+ source = { registry = "https://pypi.org/simple" }
45
+ sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
46
+ wheels = [
47
+ { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
48
+ ]
49
+
50
+ [[package]]
51
+ name = "pyhdtkit"
52
+ version = "0.1.0"
53
+ source = { editable = "." }
54
+
55
+ [package.optional-dependencies]
56
+ dev = [
57
+ { name = "pytest" },
58
+ ]
59
+
60
+ [package.metadata]
61
+ requires-dist = [{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8" }]
62
+ provides-extras = ["dev"]
63
+
64
+ [[package]]
65
+ name = "pytest"
66
+ version = "9.1.1"
67
+ source = { registry = "https://pypi.org/simple" }
68
+ dependencies = [
69
+ { name = "colorama", marker = "sys_platform == 'win32'" },
70
+ { name = "iniconfig" },
71
+ { name = "packaging" },
72
+ { name = "pluggy" },
73
+ { name = "pygments" },
74
+ ]
75
+ sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" }
76
+ wheels = [
77
+ { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" },
78
+ ]