ttoon 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.
Files changed (37) hide show
  1. ttoon-0.1.0/PKG-INFO +70 -0
  2. ttoon-0.1.0/README.md +46 -0
  3. ttoon-0.1.0/pyproject.toml +45 -0
  4. ttoon-0.1.0/rust/Cargo.lock +1069 -0
  5. ttoon-0.1.0/rust/Cargo.toml +8 -0
  6. ttoon-0.1.0/rust/crates/core/Cargo.toml +24 -0
  7. ttoon-0.1.0/rust/crates/core/README.md +38 -0
  8. ttoon-0.1.0/rust/crates/core/src/arrow.rs +1382 -0
  9. ttoon-0.1.0/rust/crates/core/src/fixture_tests.rs +1114 -0
  10. ttoon-0.1.0/rust/crates/core/src/format_detect.rs +64 -0
  11. ttoon-0.1.0/rust/crates/core/src/ir.rs +44 -0
  12. ttoon-0.1.0/rust/crates/core/src/lib.rs +359 -0
  13. ttoon-0.1.0/rust/crates/core/src/schema.rs +456 -0
  14. ttoon-0.1.0/rust/crates/core/src/streaming/core.rs +655 -0
  15. ttoon-0.1.0/rust/crates/core/src/streaming/tests.rs +334 -0
  16. ttoon-0.1.0/rust/crates/core/src/streaming/tjson.rs +717 -0
  17. ttoon-0.1.0/rust/crates/core/src/streaming/ttoon.rs +478 -0
  18. ttoon-0.1.0/rust/crates/core/src/streaming/writer.rs +513 -0
  19. ttoon-0.1.0/rust/crates/core/src/streaming.rs +12 -0
  20. ttoon-0.1.0/rust/crates/core/src/tests.rs +797 -0
  21. ttoon-0.1.0/rust/crates/core/src/tjson_arrow.rs +688 -0
  22. ttoon-0.1.0/rust/crates/core/src/tjson_parser.rs +355 -0
  23. ttoon-0.1.0/rust/crates/core/src/tjson_serializer.rs +95 -0
  24. ttoon-0.1.0/rust/crates/core/src/token.rs +28 -0
  25. ttoon-0.1.0/rust/crates/core/src/tokenizer.rs +291 -0
  26. ttoon-0.1.0/rust/crates/core/src/ttoon_parser.rs +774 -0
  27. ttoon-0.1.0/rust/crates/core/src/ttoon_serializer.rs +416 -0
  28. ttoon-0.1.0/rust/crates/core/src/typed_fmt.rs +263 -0
  29. ttoon-0.1.0/rust/crates/core/src/typed_parse.rs +879 -0
  30. ttoon-0.1.0/rust/crates/core/src/typed_value.rs +40 -0
  31. ttoon-0.1.0/rust/crates/core/tests/bench_direct_path.rs +731 -0
  32. ttoon-0.1.0/rust/crates/py-bridge/Cargo.toml +17 -0
  33. ttoon-0.1.0/rust/crates/py-bridge/src/lib.rs +1382 -0
  34. ttoon-0.1.0/ttoon/__init__.py +225 -0
  35. ttoon-0.1.0/ttoon/_schema.py +90 -0
  36. ttoon-0.1.0/ttoon/_streaming.py +483 -0
  37. ttoon-0.1.0/ttoon/py.typed +0 -0
ttoon-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: ttoon
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Rust
13
+ Classifier: Topic :: Database
14
+ Classifier: Topic :: File Formats
15
+ Classifier: Typing :: Typed
16
+ Requires-Dist: polars>=1.37.1
17
+ Requires-Dist: pyarrow>=23.0.0
18
+ Summary: TTOON — cross-language typed text data exchange for T-TOON and T-JSON with Arrow support
19
+ Keywords: ttoon,t-json,toon-format,serialization,arrow
20
+ License-Expression: MIT
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+
24
+ # ttoon
25
+
26
+ `ttoon` is the Python SDK for TTOON.
27
+
28
+ ## Features
29
+
30
+ - `T-TOON` and `T-JSON` serialization and parsing
31
+ - Conversion between Python values and typed values
32
+ - Arrow-based workflows for `pyarrow` and `polars`
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ pip install ttoon
38
+ ```
39
+
40
+ ## Quick Example
41
+
42
+ ```python
43
+ import ttoon
44
+
45
+ text = ttoon.dumps({"name": "Alice", "score": 95})
46
+ data = ttoon.loads(text)
47
+
48
+ typed_json = ttoon.to_tjson({"name": "Alice"})
49
+ fmt = ttoon.detect_format(text)
50
+ ```
51
+
52
+ ## Arrow Example
53
+
54
+ ```python
55
+ import polars as pl
56
+ import ttoon
57
+
58
+ df = pl.DataFrame({"name": ["Alice", "Bob"], "score": [95, 87]})
59
+ text = ttoon.dumps(df)
60
+ table = ttoon.read_arrow(text)
61
+ ```
62
+
63
+ ## Notes
64
+
65
+ - `dumps()` accepts standard Python objects as well as `polars.DataFrame`, `pyarrow.Table`, and `pyarrow.RecordBatch`.
66
+ - `read_arrow()` returns a `pyarrow.Table`.
67
+ - `loads()` automatically detects `T-TOON`, `T-JSON`, and `typed_unit` inputs.
68
+
69
+ See `docs/public/en/` for guides and API reference material.
70
+
ttoon-0.1.0/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # ttoon
2
+
3
+ `ttoon` is the Python SDK for TTOON.
4
+
5
+ ## Features
6
+
7
+ - `T-TOON` and `T-JSON` serialization and parsing
8
+ - Conversion between Python values and typed values
9
+ - Arrow-based workflows for `pyarrow` and `polars`
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install ttoon
15
+ ```
16
+
17
+ ## Quick Example
18
+
19
+ ```python
20
+ import ttoon
21
+
22
+ text = ttoon.dumps({"name": "Alice", "score": 95})
23
+ data = ttoon.loads(text)
24
+
25
+ typed_json = ttoon.to_tjson({"name": "Alice"})
26
+ fmt = ttoon.detect_format(text)
27
+ ```
28
+
29
+ ## Arrow Example
30
+
31
+ ```python
32
+ import polars as pl
33
+ import ttoon
34
+
35
+ df = pl.DataFrame({"name": ["Alice", "Bob"], "score": [95, 87]})
36
+ text = ttoon.dumps(df)
37
+ table = ttoon.read_arrow(text)
38
+ ```
39
+
40
+ ## Notes
41
+
42
+ - `dumps()` accepts standard Python objects as well as `polars.DataFrame`, `pyarrow.Table`, and `pyarrow.RecordBatch`.
43
+ - `read_arrow()` returns a `pyarrow.Table`.
44
+ - `loads()` automatically detects `T-TOON`, `T-JSON`, and `typed_unit` inputs.
45
+
46
+ See `docs/public/en/` for guides and API reference material.
@@ -0,0 +1,45 @@
1
+ [project]
2
+ name = "ttoon"
3
+ version = "0.1.0"
4
+ license = "MIT"
5
+ description = "TTOON — cross-language typed text data exchange for T-TOON and T-JSON with Arrow support"
6
+ readme = "README.md"
7
+ requires-python = ">=3.11"
8
+ keywords = ["ttoon", "t-json", "toon-format", "serialization", "arrow"]
9
+ classifiers = [
10
+ "Development Status :: 3 - Alpha",
11
+ "Intended Audience :: Developers",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3 :: Only",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Rust",
19
+ "Topic :: Database",
20
+ "Topic :: File Formats",
21
+ "Typing :: Typed",
22
+ ]
23
+ dependencies = [
24
+ "polars>=1.37.1",
25
+ "pyarrow>=23.0.0",
26
+ ]
27
+
28
+ [build-system]
29
+ requires = ["maturin>=1.5,<2.0"]
30
+ build-backend = "maturin"
31
+
32
+ [tool.maturin]
33
+ features = ["pyo3/extension-module", "pyo3/abi3-py311"]
34
+ module-name = "ttoon._core"
35
+ python-source = "."
36
+ manifest-path = "rust/crates/py-bridge/Cargo.toml"
37
+
38
+ [tool.pytest.ini_options]
39
+ testpaths = ["tests"]
40
+ pythonpath = ["."]
41
+
42
+ [dependency-groups]
43
+ dev = [
44
+ "pytest>=9.0.2",
45
+ ]