gcf-python 2.1.0__py3-none-any.whl → 2.1.1__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.
gcf/decode_generic.py CHANGED
@@ -151,6 +151,17 @@ def _parse_object_body(
151
151
  i += consumed
152
152
  continue
153
153
 
154
+ # Key=value. Check before inline array so bracket patterns in quoted
155
+ # values (e.g. text="ERR[404]: Not Found") are not misinterpreted.
156
+ eq_idx = _find_kv_split(content)
157
+ if eq_idx > 0:
158
+ name = _parse_key_from_header(content[:eq_idx])
159
+ _check_dup(out, name)
160
+ out[name] = parse_scalar(content[eq_idx + 1:])
161
+ i += 1
162
+ continue
163
+
164
+ # Inline array (e.g. items[3]: a,b,c). Only reached if no = found.
154
165
  if not content.startswith("@") and not content.startswith("##"):
155
166
  bracket_idx = content.find("[")
156
167
  if bracket_idx > 0:
@@ -166,14 +177,6 @@ def _parse_object_body(
166
177
  i += 1
167
178
  continue
168
179
 
169
- eq_idx = _find_kv_split(content)
170
- if eq_idx > 0:
171
- name = _parse_key_from_header(content[:eq_idx])
172
- _check_dup(out, name)
173
- out[name] = parse_scalar(content[eq_idx + 1:])
174
- i += 1
175
- continue
176
-
177
180
  i += 1
178
181
  return i - start
179
182
 
@@ -191,7 +194,13 @@ def _find_kv_split(s: str) -> int:
191
194
  return i + 1 if i + 1 < len(s) and s[i + 1] == "=" else -1
192
195
  i += 1
193
196
  return -1
194
- return s.find("=")
197
+ eq_idx = s.find("=")
198
+ if eq_idx < 0:
199
+ return -1
200
+ bracket_idx = s.find("[")
201
+ if bracket_idx >= 0 and bracket_idx < eq_idx:
202
+ return -1
203
+ return eq_idx
195
204
 
196
205
 
197
206
  def _parse_key_from_header(s: str) -> str:
gcf/scalar.py CHANGED
@@ -8,6 +8,7 @@ from typing import Any
8
8
 
9
9
  _JSON_NUMBER_RE = re.compile(r"^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$")
10
10
  _NUMERIC_LIKE_RE = re.compile(r"^[+-]\.?\d|^\.\d|^0\d")
11
+ _INLINE_ARRAY_RE = re.compile(r"\[[^\]]*\]\s*:")
11
12
  _BARE_KEY_RE = re.compile(r"^[a-zA-Z_][a-zA-Z0-9_]*$")
12
13
 
13
14
 
@@ -36,6 +37,8 @@ def needs_quote(s: str) -> bool:
36
37
  return True
37
38
  if s[0] in ("#", "@", "."):
38
39
  return True
40
+ if _INLINE_ARRAY_RE.search(s):
41
+ return True
39
42
  for c in s:
40
43
  o = ord(c)
41
44
  if c in ('"', "\\", "|", ",") or o < 0x20 or c in ("\n", "\r"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcf-python
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
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/
@@ -217,26 +217,26 @@ Works on dicts, lists, and primitives. Lists of uniform dicts get tabular rows.
217
217
 
218
218
  GCF wins 13/15 datasets on the expanded [token efficiency benchmark](https://github.com/blackwell-systems/toon/tree/gcf-comparison). Full results: [gcformat.com/guide/benchmarks](https://gcformat.com/guide/benchmarks.html)
219
219
 
220
- ## Links
221
-
222
- - [Documentation](https://gcformat.com/)
223
- - [Playground](https://gcformat.com/playground.html)
224
- - [Specification](https://github.com/blackwell-systems/gcf)
225
- - [Go library](https://github.com/blackwell-systems/gcf-go)
226
- - [TypeScript library](https://github.com/blackwell-systems/gcf-typescript)
227
- - [MCP Proxy](https://github.com/blackwell-systems/gcf-proxy) (zero-code adoption)
228
- - [GCF vs TOON](https://gcformat.com/guide/vs-toon.html)
229
- - [TOON benchmark fork](https://github.com/blackwell-systems/toon/tree/gcf-comparison)
230
-
231
-
232
- <details>
233
- <summary>More links</summary>
234
-
235
- - [betterthanjson.com](https://betterthanjson.com)
236
- - [jsonalternative.com](https://jsonalternative.com)
237
- - [betterthantoon.com](https://betterthantoon.com)
238
-
239
- </details>
220
+ ## Implementations
221
+
222
+ | Language | Package | Repository |
223
+ |----------|---------|-----------|
224
+ | Go | `go get github.com/blackwell-systems/gcf-go` | [gcf-go](https://github.com/blackwell-systems/gcf-go) |
225
+ | TypeScript | `npm install @blackwell-systems/gcf` | [gcf-typescript](https://github.com/blackwell-systems/gcf-typescript) |
226
+ | Python | `pip install gcf-python` | [gcf-python](https://github.com/blackwell-systems/gcf-python) |
227
+ | Rust | `cargo add gcf` | [gcf-rust](https://github.com/blackwell-systems/gcf-rust) |
228
+ | Swift | Swift Package Manager | [gcf-swift](https://github.com/blackwell-systems/gcf-swift) |
229
+ | Kotlin | JitPack | [gcf-kotlin](https://github.com/blackwell-systems/gcf-kotlin) |
230
+ | MCP Proxy | `pip install gcf-proxy` | [gcf-proxy](https://github.com/blackwell-systems/gcf-proxy) (bidirectional, session dedup, HTTP frontend) |
231
+ | Claude Code Plugin | `/plugin install` | [gcf-claude-plugin](https://github.com/blackwell-systems/gcf-claude-plugin) (one-command install, session stats hook) |
232
+ | Codex Plugin | `codex plugin add` | [gcf-codex-plugin](https://github.com/blackwell-systems/gcf-codex-plugin) (one-command install, session stats hook) |
233
+ | VS Code | `ext install blackwell-systems.gcf-vscode` | [gcf-vscode](https://marketplace.visualstudio.com/items?itemName=blackwell-systems.gcf-vscode) (syntax highlighting) |
234
+ | n8n | `npm install n8n-nodes-gcf` | [gcf-n8n-nodes](https://github.com/blackwell-systems/gcf-n8n-nodes) (workflow encode/decode) |
235
+ | Tree-sitter | `npm install tree-sitter-gcf` | [tree-sitter-gcf](https://github.com/blackwell-systems/tree-sitter-gcf) |
236
+
237
+ Zero runtime dependencies. MIT licensed. All implementations support both generic profile (`encodeGeneric`) and graph profile (`encode`). CLI included in all 6 languages.
238
+
239
+ **Specification:** [SPEC v3.1 Stable](https://github.com/blackwell-systems/gcf/blob/main/SPEC.md) with 157 conformance fixtures, 33,000,000,000+ lossless round-trips verified across 5 formats and 6 languages. All implementations at v2.1.0+ (Go v1.2.0). Cross-language 6x6 matrix verified.
240
240
 
241
241
  ## License
242
242
 
@@ -3,17 +3,17 @@ gcf/__main__.py,sha256=EpvBz1yc8H0D5OJ1zy2tYke-kRzvudKa4DEbfeW14ao,71
3
3
  gcf/cli.py,sha256=UEe1CAZn-rKGNIo_ap8-oez3ucl6DSRbsdv6RDnzygY,5256
4
4
  gcf/constants.py,sha256=cmZ8YJSOB0im_eyfN8v4UvrLpBC6Fuf4cfcKZGbutxY,638
5
5
  gcf/decode.py,sha256=nD8bXYhoeHQQ3LCeAJQOAgFuob-V_6us4mcBYtL_bBc,5978
6
- gcf/decode_generic.py,sha256=49_X9fKuBctd9Djd1103iaZWpPZX8TP_KgnWpji130s,23428
6
+ gcf/decode_generic.py,sha256=fb0vh14zbyS0qUMN-hEKouD7Nr99Ntw5eiSTgbGfUV0,23810
7
7
  gcf/delta.py,sha256=f90UC6zejXH-ujyU_OViWDCqnxLXk3i6Qion-RJGHY4,1670
8
8
  gcf/encode.py,sha256=CcqMSNmojrQAAw2X3MNfw8YR6l4rNw9hWDqwmf846oA,2929
9
9
  gcf/generic.py,sha256=h9IcvX0MCSG0kbbbGqlBQKe7uaPrBM9ewjJzGpgUn88,10432
10
- gcf/scalar.py,sha256=YBPTGcgFPwN_lgPLuRg8U4uHVlJ2vn5d1Gz1AGf-E00,9225
10
+ gcf/scalar.py,sha256=MZay-KIROvaFHet-g2-pBghahT1bf_5bxZjG4yTZkSo,9329
11
11
  gcf/session.py,sha256=6-wytNGaBkgqH7uTar7ojUFYNwIMeEVAZhuV-s-upZM,4704
12
12
  gcf/stream.py,sha256=1Kt_a2daKpYHlWP1lnDJ4g549pUt9rc-U0xbARbXRKQ,5174
13
13
  gcf/stream_generic.py,sha256=RnqqiPSu5joJa-7e58QbbzSGfvxBICA587A3aArjZvE,3250
14
14
  gcf/types.py,sha256=AWm-LQoSqLHAYtEjcAxWQZqJ4JXqNreLUKO2mJFgNMA,1465
15
- gcf_python-2.1.0.dist-info/METADATA,sha256=f4x6jJYGrKcClX0G9OeJDPUgRv6SGCOQlUmQivk45MA,8234
16
- gcf_python-2.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
17
- gcf_python-2.1.0.dist-info/entry_points.txt,sha256=aFT6gqlkh8iGfM8cblE-LUMxHH08_v71IIoZtDdRIVA,37
18
- gcf_python-2.1.0.dist-info/licenses/LICENSE,sha256=2Fit9wnaIe--RMSAgyQqxC5hfZTyZqn4fIdBtp9qPDw,1072
19
- gcf_python-2.1.0.dist-info/RECORD,,
15
+ gcf_python-2.1.1.dist-info/METADATA,sha256=LNaTf48XfyKNcSvZ0gI8zNMCWKwUgbB8hiTugMfs45I,9554
16
+ gcf_python-2.1.1.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
17
+ gcf_python-2.1.1.dist-info/entry_points.txt,sha256=aFT6gqlkh8iGfM8cblE-LUMxHH08_v71IIoZtDdRIVA,37
18
+ gcf_python-2.1.1.dist-info/licenses/LICENSE,sha256=2Fit9wnaIe--RMSAgyQqxC5hfZTyZqn4fIdBtp9qPDw,1072
19
+ gcf_python-2.1.1.dist-info/RECORD,,