gcf-python 1.0.0__tar.gz → 1.0.1__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 (34) hide show
  1. {gcf_python-1.0.0 → gcf_python-1.0.1}/CHANGELOG.md +6 -0
  2. {gcf_python-1.0.0 → gcf_python-1.0.1}/PKG-INFO +4 -4
  3. {gcf_python-1.0.0 → gcf_python-1.0.1}/README.md +2 -2
  4. {gcf_python-1.0.0 → gcf_python-1.0.1}/pyproject.toml +2 -2
  5. gcf_python-1.0.1/src/gcf/__main__.py +5 -0
  6. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/cli.py +32 -5
  7. {gcf_python-1.0.0 → gcf_python-1.0.1}/.github/FUNDING.yml +0 -0
  8. {gcf_python-1.0.0 → gcf_python-1.0.1}/.github/workflows/ci.yml +0 -0
  9. {gcf_python-1.0.0 → gcf_python-1.0.1}/.github/workflows/publish.yml +0 -0
  10. {gcf_python-1.0.0 → gcf_python-1.0.1}/.gitignore +0 -0
  11. {gcf_python-1.0.0 → gcf_python-1.0.1}/LICENSE +0 -0
  12. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/__init__.py +0 -0
  13. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/constants.py +0 -0
  14. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/decode.py +0 -0
  15. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/decode_generic.py +0 -0
  16. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/delta.py +0 -0
  17. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/encode.py +0 -0
  18. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/generic.py +0 -0
  19. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/scalar.py +0 -0
  20. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/session.py +0 -0
  21. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/stream.py +0 -0
  22. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/stream_generic.py +0 -0
  23. {gcf_python-1.0.0 → gcf_python-1.0.1}/src/gcf/types.py +0 -0
  24. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/__init__.py +0 -0
  25. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_conformance_v2.py +0 -0
  26. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_decode.py +0 -0
  27. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_delta.py +0 -0
  28. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_encode.py +0 -0
  29. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_generic.py +0 -0
  30. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_roundtrip.py +0 -0
  31. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_roundtrip_v2.py +0 -0
  32. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_session.py +0 -0
  33. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_stream.py +0 -0
  34. {gcf_python-1.0.0 → gcf_python-1.0.1}/tests/test_stream_generic.py +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.1 (2026-06-10)
4
+
5
+ - CLI: `encode-generic` and `decode-generic` subcommands for generic profile
6
+ - CLI now supports both graph and generic profiles
7
+ - `python -m gcf` entry point
8
+
3
9
  ## v1.0.0 (2026-06-10)
4
10
 
5
11
  SPEC v2.0 implementation. 126/133 conformance fixtures passing (7 skipped: session, delta, binary UTF-8, negative zero, graph encode). 40M property-based round-trips with zero failures.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcf-python
3
- Version: 1.0.0
4
- Summary: Drop-in JSON replacement for AI pipelines. 79% fewer tokens. 90.5% comprehension across 10 models. Zero dependencies.
3
+ Version: 1.0.1
4
+ Summary: Drop-in JSON replacement for AI pipelines. 79% fewer tokens. 90.7% comprehension across 10 models. Zero dependencies.
5
5
  Project-URL: Homepage, https://github.com/blackwell-systems/gcf-python
6
6
  Project-URL: Documentation, https://blackwell-systems.github.io/gcf/
7
7
  Project-URL: Specification, https://github.com/blackwell-systems/gcf
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  Python implementation of [GCF](https://gcformat.com/) — the most token-efficient wire format for LLMs. A drop-in alternative to JSON and TOON for any structured data.
34
34
 
35
- **79% fewer input tokens than JSON. 63% fewer output tokens. 90.5% average comprehension accuracy across 10 models and 3 providers (four models hit 100%). 1,300+ LLM evaluations. Zero training.**
35
+ **79% fewer input tokens than JSON. 63% fewer output tokens. 90.7% average comprehension accuracy across 10 models and 3 providers (four models hit 100%). 1,300+ LLM evaluations. Zero training.**
36
36
 
37
37
  Docs: [gcformat.com](https://gcformat.com/) · [Playground](https://gcformat.com/playground.html) · [GCF vs TOON](https://gcformat.com/guide/vs-toon.html)
38
38
 
@@ -210,7 +210,7 @@ Works on dicts, lists, and primitives. Lists of uniform dicts get tabular rows.
210
210
 
211
211
  | | GCF | TOON | JSON |
212
212
  |---|---|---|---|
213
- | **Comprehension** (23 runs, 10 models) | **90.5%** | 68.5% | 53.6% |
213
+ | **Comprehension** (23 runs, 10 models) | **90.7%** | 68.5% | 53.6% |
214
214
  | **Generation** (28 runs, 9 models) | **5/5** | 1.0/5 | 5.0/5 |
215
215
  | **Input tokens** (500 symbols) | **11,090** | 16,378 | 53,341 |
216
216
  | **Output tokens** (100 symbols) | **5,976** | 8,937 | 16,121 |
@@ -7,7 +7,7 @@
7
7
 
8
8
  Python implementation of [GCF](https://gcformat.com/) — the most token-efficient wire format for LLMs. A drop-in alternative to JSON and TOON for any structured data.
9
9
 
10
- **79% fewer input tokens than JSON. 63% fewer output tokens. 90.5% average comprehension accuracy across 10 models and 3 providers (four models hit 100%). 1,300+ LLM evaluations. Zero training.**
10
+ **79% fewer input tokens than JSON. 63% fewer output tokens. 90.7% average comprehension accuracy across 10 models and 3 providers (four models hit 100%). 1,300+ LLM evaluations. Zero training.**
11
11
 
12
12
  Docs: [gcformat.com](https://gcformat.com/) · [Playground](https://gcformat.com/playground.html) · [GCF vs TOON](https://gcformat.com/guide/vs-toon.html)
13
13
 
@@ -185,7 +185,7 @@ Works on dicts, lists, and primitives. Lists of uniform dicts get tabular rows.
185
185
 
186
186
  | | GCF | TOON | JSON |
187
187
  |---|---|---|---|
188
- | **Comprehension** (23 runs, 10 models) | **90.5%** | 68.5% | 53.6% |
188
+ | **Comprehension** (23 runs, 10 models) | **90.7%** | 68.5% | 53.6% |
189
189
  | **Generation** (28 runs, 9 models) | **5/5** | 1.0/5 | 5.0/5 |
190
190
  | **Input tokens** (500 symbols) | **11,090** | 16,378 | 53,341 |
191
191
  | **Output tokens** (100 symbols) | **5,976** | 8,937 | 16,121 |
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "gcf-python"
7
- version = "1.0.0"
8
- description = "Drop-in JSON replacement for AI pipelines. 79% fewer tokens. 90.5% comprehension across 10 models. Zero dependencies."
7
+ version = "1.0.1"
8
+ description = "Drop-in JSON replacement for AI pipelines. 79% fewer tokens. 90.7% comprehension across 10 models. Zero dependencies."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
11
11
  requires-python = ">=3.9"
@@ -0,0 +1,5 @@
1
+ """Allow running as `python -m gcf`."""
2
+
3
+ from .cli import main
4
+
5
+ main()
@@ -5,19 +5,25 @@ import sys
5
5
 
6
6
  from .decode import decode
7
7
  from .encode import encode
8
+ from .decode_generic import decode_generic
9
+ from .generic import encode_generic
8
10
  from .types import Edge, Payload, Symbol
9
11
 
10
12
  USAGE = """gcf - token-optimized wire format for LLM tool responses
11
13
 
12
14
  Usage:
13
- gcf encode [file] Encode JSON payload to GCF (stdin if no file)
14
- gcf decode [file] Decode GCF text to JSON (stdin if no file)
15
- gcf stats [file] Compare token counts: JSON vs GCF (stdin if no file)
16
- gcf version Print version
15
+ gcf encode [file] Encode JSON graph payload to GCF (stdin if no file)
16
+ gcf decode [file] Decode GCF graph text to JSON (stdin if no file)
17
+ gcf encode-generic [file] Encode JSON to GCF generic profile (stdin if no file)
18
+ gcf decode-generic [file] Decode GCF generic text to JSON (stdin if no file)
19
+ gcf stats [file] Compare token counts: JSON vs GCF (stdin if no file)
20
+ gcf version Print version
17
21
 
18
22
  Examples:
19
23
  gcf encode < payload.json
20
24
  gcf decode < payload.gcf
25
+ echo '{"name":"Alice"}' | gcf encode-generic
26
+ echo 'GCF profile=generic\\nname=Alice' | gcf decode-generic
21
27
  gcf stats payload.json
22
28
  """
23
29
 
@@ -37,11 +43,18 @@ def main() -> None:
37
43
  elif cmd == "decode":
38
44
  data = _read_input(file_args)
39
45
  _do_decode(data)
46
+ elif cmd == "encode-generic":
47
+ data = _read_input(file_args)
48
+ _do_encode_generic(data)
49
+ elif cmd == "decode-generic":
50
+ data = _read_input(file_args)
51
+ _do_decode_generic(data)
40
52
  elif cmd == "stats":
41
53
  data = _read_input(file_args)
42
54
  _do_stats(data)
43
55
  elif cmd == "version":
44
- print("gcf 0.1.0")
56
+ from . import __version__
57
+ print(f"gcf {__version__}")
45
58
  else:
46
59
  print(f"unknown command: {cmd}\n", file=sys.stderr)
47
60
  print(USAGE, file=sys.stderr, end="")
@@ -115,6 +128,20 @@ def _payload_to_json(p: Payload) -> str:
115
128
  return json.dumps(obj, indent=2)
116
129
 
117
130
 
131
+ def _do_encode_generic(data: str) -> None:
132
+ try:
133
+ obj = json.loads(data)
134
+ except json.JSONDecodeError as e:
135
+ print(f"error: invalid JSON: {e}", file=sys.stderr)
136
+ sys.exit(1)
137
+ print(encode_generic(obj), end="")
138
+
139
+
140
+ def _do_decode_generic(data: str) -> None:
141
+ result = decode_generic(data)
142
+ print(json.dumps(result))
143
+
144
+
118
145
  def _do_encode(data: str) -> None:
119
146
  try:
120
147
  p = _payload_from_json(data)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes