arkadia-data 0.1.7__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 (63) hide show
  1. arkadia_data-0.1.7/.gitignore +210 -0
  2. arkadia_data-0.1.7/LICENCE +21 -0
  3. arkadia_data-0.1.7/PKG-INFO +261 -0
  4. arkadia_data-0.1.7/README.md +247 -0
  5. arkadia_data-0.1.7/data/akd-test-01.ak-data +12 -0
  6. arkadia_data-0.1.7/data/akd-test-01.json +1 -0
  7. arkadia_data-0.1.7/data/akd-test.ak-data +17 -0
  8. arkadia_data-0.1.7/data/arrays-nested.ak-data +68 -0
  9. arkadia_data-0.1.7/data/arrays-nested.json +99 -0
  10. arkadia_data-0.1.7/data/arrays-objects.ak-data +105 -0
  11. arkadia_data-0.1.7/data/arrays-objects.json +138 -0
  12. arkadia_data-0.1.7/data/arrays-primitive.ak-data +13 -0
  13. arkadia_data-0.1.7/data/arrays-primitive.json +87 -0
  14. arkadia_data-0.1.7/data/arrays-tabular.ak-data +33 -0
  15. arkadia_data-0.1.7/data/arrays-tabular.json +62 -0
  16. arkadia_data-0.1.7/data/delimiters.ak-data +71 -0
  17. arkadia_data-0.1.7/data/delimiters.json +253 -0
  18. arkadia_data-0.1.7/data/normalization.ak-data +16 -0
  19. arkadia_data-0.1.7/data/normalization.json +107 -0
  20. arkadia_data-0.1.7/data/objects.ak-data +35 -0
  21. arkadia_data-0.1.7/data/objects.json +220 -0
  22. arkadia_data-0.1.7/data/options.ak-data +20 -0
  23. arkadia_data-0.1.7/data/options.json +88 -0
  24. arkadia_data-0.1.7/data/primitives.ak-data +39 -0
  25. arkadia_data-0.1.7/data/primitives.json +226 -0
  26. arkadia_data-0.1.7/data/toon.ak-data +6 -0
  27. arkadia_data-0.1.7/data/toon.json +34 -0
  28. arkadia_data-0.1.7/data/whitespace.ak-data +8 -0
  29. arkadia_data-0.1.7/data/whitespace.json +29 -0
  30. arkadia_data-0.1.7/pyproject.toml +35 -0
  31. arkadia_data-0.1.7/src/arkadia/__init__.py +0 -0
  32. arkadia_data-0.1.7/src/arkadia/cli/__init__.py +6 -0
  33. arkadia_data-0.1.7/src/arkadia/cli/akd/__init__.py +0 -0
  34. arkadia_data-0.1.7/src/arkadia/cli/akd/akd.py +114 -0
  35. arkadia_data-0.1.7/src/arkadia/cli/akd/benchmark.py +509 -0
  36. arkadia_data-0.1.7/src/arkadia/cli/akd/decode.py +407 -0
  37. arkadia_data-0.1.7/src/arkadia/cli/akd/encode.py +345 -0
  38. arkadia_data-0.1.7/src/arkadia/cli/akd/meta.py +20 -0
  39. arkadia_data-0.1.7/src/arkadia/cli/akd/report.py +0 -0
  40. arkadia_data-0.1.7/src/arkadia/cli/colors.py +16 -0
  41. arkadia_data-0.1.7/src/arkadia/cli/print_banner.py +72 -0
  42. arkadia_data-0.1.7/src/arkadia/cli/print_options.py +48 -0
  43. arkadia_data-0.1.7/src/arkadia/cli/print_usage.py +11 -0
  44. arkadia_data-0.1.7/src/arkadia/data/Config.py +40 -0
  45. arkadia_data-0.1.7/src/arkadia/data/Decoder.py +1445 -0
  46. arkadia_data-0.1.7/src/arkadia/data/Encoder.py +496 -0
  47. arkadia_data-0.1.7/src/arkadia/data/Meta.py +116 -0
  48. arkadia_data-0.1.7/src/arkadia/data/Node.py +256 -0
  49. arkadia_data-0.1.7/src/arkadia/data/Schema.py +229 -0
  50. arkadia_data-0.1.7/src/arkadia/data/__init__.py +9 -0
  51. arkadia_data-0.1.7/src/arkadia/data/colorize.py +67 -0
  52. arkadia_data-0.1.7/src/arkadia/data/decode.py +16 -0
  53. arkadia_data-0.1.7/src/arkadia/data/encode.py +86 -0
  54. arkadia_data-0.1.7/src/arkadia/data/parse.py +140 -0
  55. arkadia_data-0.1.7/tests/test_00_primitive.py +102 -0
  56. arkadia_data-0.1.7/tests/test_01_schema.py +54 -0
  57. arkadia_data-0.1.7/tests/test_02_data.py +64 -0
  58. arkadia_data-0.1.7/tests/test_03_errors.py +55 -0
  59. arkadia_data-0.1.7/tests/test_04_list.py +232 -0
  60. arkadia_data-0.1.7/tests/test_05_record.py +78 -0
  61. arkadia_data-0.1.7/tests/test_06_meta.py +560 -0
  62. arkadia_data-0.1.7/tests/utils.py +54 -0
  63. arkadia_data-0.1.7/uv.lock +850 -0
@@ -0,0 +1,210 @@
1
+ .vscode
2
+ .github
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[codz]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ share/python-wheels/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+ MANIFEST
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py.cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+ cover/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ .pybuilder/
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ # For a library or package, you might want to ignore these files since the code is
90
+ # intended to run in multiple environments; otherwise, check them in:
91
+ # .python-version
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ #Pipfile.lock
99
+
100
+ # UV
101
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ #uv.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ #poetry.lock
112
+ #poetry.toml
113
+
114
+ # pdm
115
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
117
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
118
+ #pdm.lock
119
+ #pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # pixi
124
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
125
+ #pixi.lock
126
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
127
+ # in the .venv directory. It is recommended not to include this directory in version control.
128
+ .pixi
129
+
130
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131
+ __pypackages__/
132
+
133
+ # Celery stuff
134
+ celerybeat-schedule
135
+ celerybeat.pid
136
+
137
+ # SageMath parsed files
138
+ *.sage.py
139
+
140
+ # Environments
141
+ .env
142
+ .envrc
143
+ .venv
144
+ env/
145
+ venv/
146
+ ENV/
147
+ env.bak/
148
+ venv.bak/
149
+
150
+ # Spyder project settings
151
+ .spyderproject
152
+ .spyproject
153
+
154
+ # Rope project settings
155
+ .ropeproject
156
+
157
+ # mkdocs documentation
158
+ /site
159
+
160
+ # mypy
161
+ .mypy_cache/
162
+ .dmypy.json
163
+ dmypy.json
164
+
165
+ # Pyre type checker
166
+ .pyre/
167
+
168
+ # pytype static type analyzer
169
+ .pytype/
170
+
171
+ # Cython debug symbols
172
+ cython_debug/
173
+
174
+ # PyCharm
175
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
176
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
177
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
178
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
179
+ #.idea/
180
+
181
+ # Abstra
182
+ # Abstra is an AI-powered process automation framework.
183
+ # Ignore directories containing user credentials, local state, and settings.
184
+ # Learn more at https://abstra.io/docs
185
+ .abstra/
186
+
187
+ # Visual Studio Code
188
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
189
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
190
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
191
+ # you could uncomment the following to ignore the entire vscode folder
192
+ # .vscode/
193
+
194
+ # Ruff stuff:
195
+ .ruff_cache/
196
+
197
+ # PyPI configuration file
198
+ .pypirc
199
+
200
+ # Cursor
201
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
202
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
203
+ # refer to https://docs.cursor.com/context/ignore-files
204
+ .cursorignore
205
+ .cursorindexingignore
206
+
207
+ # Marimo
208
+ marimo/_static/
209
+ marimo/_lsp/
210
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arkadia Solutions
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,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: arkadia-data
3
+ Version: 0.1.7
4
+ Summary: Arkadia Data Format (AK-DATA) - A versatile data serialization format optimized for AI applications.
5
+ Author-email: Arkadia Solutions <contact@arkadia.solutions>
6
+ License-File: LICENCE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: dotenv>=0.9.9
9
+ Requires-Dist: openai>=2.14.0
10
+ Requires-Dist: pytest>=9.0.2
11
+ Requires-Dist: tiktoken>=0.12.0
12
+ Requires-Dist: toon-format
13
+ Description-Content-Type: text/markdown
14
+
15
+ # ARKADIA DATA
16
+
17
+ ```text
18
+ ; i :J
19
+ U, .j..fraaM. nl
20
+ b h.obWMkkWWMMWMCdkvz,k
21
+ ! .mQWM:o hiMoMW v.uaXMdohbi
22
+ hI,MMmaIao.Wo .IMkoh FCMwqoXa
23
+ ,.c.aWdM. d,aToW . Mb!. MopfQ.L
24
+ jhj.xoM :k aCu F: w MpmqMvMMI,I
25
+ bzMhz:W .Mw . o lYh ai M iMa pM.j
26
+ hzqWWM; M;o.WMWWMkMX f.a aa bModpo.
27
+ ;tMbbv xp oJMMWWWWMMMM iv dLMXakM:T
28
+ mdh MMWWWWWWWbQLCzurjktvMor
29
+ ,QFw ;M,b .MWWWWWWWMWMWd xz M,kd X
30
+ qjMIo IMTW.WWWWWMWWWM.o.I rpULaMdi.
31
+ .mMM uoWWWMWWWWWWp qM,,M l M;mMbrI
32
+ f nm MMW MWWjMuMj I o LbMac
33
+ WWdMWWWW Mv a.b..aauMhMwQf
34
+ MoWWW,WWtjonJMWtoMdoaoMI
35
+ MMMM Mi xd:Mm tMwo Cr,
36
+ xMMc .otqokWMMMao:oio.
37
+ MW . C..MkTIo
38
+ WW
39
+ QWM
40
+ WW
41
+ uMW
42
+ WW
43
+ MW
44
+ ```
45
+
46
+ ---
47
+
48
+ > **The High-Density, Token-Efficient Data Protocol for Large Language Models.**
49
+ > Stop wasting context window on JSON braces. `AK-DATA` is a unified, schema-first data format designed specifically for AI understanding. It offers up to **25% token savings**, faster parsing, and human-readable structure that LLMs love.
50
+
51
+ ---
52
+
53
+ ## 📦 Installation
54
+
55
+ Get started immediately with pip:
56
+
57
+ ```bash
58
+ pip install arkadia-data
59
+ ```
60
+
61
+ ## 🚀 Fast Example
62
+
63
+ **Encoding to AK-DATA:**
64
+
65
+ ```bash
66
+ echo '{ "data": 2}' | akd enc - -c
67
+ # Output: <data:number>(2)
68
+
69
+ ```
70
+
71
+ **Decoding back to JSON:**
72
+
73
+ ```bash
74
+ echo '<data:number>(2)' | akd dec - -f json
75
+ # Output: { "data": 2 }
76
+
77
+ ```
78
+
79
+ ---
80
+
81
+ ## âš¡ Performance & Token Savings
82
+
83
+ Why switch? Because every token counts. `AKCD` (Arkadia Compressed Data) consistently outperforms standard formats in both token efficiency.
84
+
85
+ ```text
86
+ BENCHMARK SUMMARY:
87
+
88
+
89
+ JSON █████████████████████░░░░ 6921 tok ░░░░░░░░░░░░░░░░░░░░░░░░░ 0.15 ms
90
+ AKCD ████████████████░░░░░░░░░ 5416 tok █████████████████████████ 4.40 ms
91
+ AKD ███████████████████░░░░░░ 6488 tok ████████████████████████░ 4.29 ms
92
+ TOON █████████████████████████ 8198 tok █████████████░░░░░░░░░░░░ 2.36 ms
93
+
94
+
95
+ FORMAT TOKENS TIME (Total) AVG TIME/FILE VS JSON
96
+ ----------------------------------------------------------------------
97
+ AKCD 5416 4.40 ms 0.37 ms -21.7%
98
+ AKD 6488 4.29 ms 0.36 ms -6.3%
99
+ JSON 6921 0.15 ms 0.01 ms +0.0%
100
+ TOON 8198 2.36 ms 0.20 ms +18.5%
101
+
102
+
103
+ CONCLUSION: Switching to AKCD saves 1505 tokens (21.7%) compared to JSON.
104
+ ```
105
+
106
+ ---
107
+
108
+ ## 🛠 CLI Usage
109
+
110
+ The package comes with a powerful CLI tool `akd` for encoding, decoding, and benchmarking.
111
+
112
+ ```text
113
+ Arkadia DATA TOOL
114
+ --------------------------------------------------
115
+ Unified interface for AK Data Format operations.
116
+
117
+ USAGE:
118
+ ak-data / akd <command> [flags]
119
+
120
+ COMMANDS:
121
+ enc [ENCODE] Convert JSON/YAML/TOON to AK Data format
122
+ dec [DECODE] Parse AK Data format back to JSON
123
+ benchmark [BENCHMARK] Run performance and token usage tests
124
+ ai-benchmark [AI] Run AI understanding tests (not implemented yet)
125
+
126
+ GLOBAL OPTIONS:
127
+ -h, --help Show this help message
128
+ -v, --version Show version info
129
+
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 📖 Syntax Specification (Current Version)
135
+
136
+ This section describes the **actual, currently implemented** syntax of AI.DATA-FORMAT.
137
+
138
+ ### 1. Type Definition
139
+
140
+ A type defines a name and an ordered list of fields. Comments are allowed within the definition to assist the LLM.
141
+
142
+ ```akd
143
+ User</comment/ ={(23,"A",3) #tag1 #tag2} %[{ id: 4, b: "a", c: 43}]: id:number,
144
+ b: string , c:number, >
145
+ @Users
146
+ <
147
+ @list
148
+ a: number,
149
+ b: string
150
+ >
151
+ [
152
+ @size=5
153
+ /example list of values/
154
+
155
+ (1,`text`,5)
156
+ (2,`Text can be
157
+
158
+ multiline
159
+ `,5)
160
+ {
161
+ id:3,
162
+ b: "text"
163
+ }
164
+ ]
165
+
166
+ ```
167
+
168
+ **Key Rules:**
169
+
170
+ * The type name (`@Name`) is optional but recommended.
171
+ * The header `<...>` defines field names and their order.
172
+ * Comments (`/ ... /`) are **allowed** in the header.
173
+
174
+ ### 2. Data Structures
175
+
176
+ The format supports compact positional records and explicit named records.
177
+
178
+ | Structure | Syntax | Description |
179
+ | --- | --- | --- |
180
+ | **Positional Record** | `(a,b,c)` | Must follow the exact order of fields in the type header. |
181
+ | **Named Record** | `{key:value}` | Keys must match field names. No spaces allowed in keys/values. |
182
+ | **List** | `[ ... ]` | Contains positional or named records. |
183
+ | **Multiline Text** | ``text`` | Ends with a line containing only a backtick. |
184
+
185
+ ### 3. Comments
186
+
187
+ ```akd
188
+ / this is a comment /
189
+
190
+ ```
191
+
192
+ * Allowed **only** inside type definitions.
193
+ * Forbidden in raw data blocks to save space.
194
+
195
+ ### 4. General Rules
196
+
197
+ 1. **Data must contain NO spaces.** (Compactness is priority).
198
+ 2. Schema/Type definitions **may** contain spaces and comments.
199
+ 3. Named fields always use `key:value` without spaces.
200
+ 4. Positional order must exactly match the declared order.
201
+
202
+ ### 5. Inline Type Usage
203
+
204
+ You can declare a type and immediately use it:
205
+
206
+ ```akd
207
+ @User<id:number name:string desc:string>
208
+
209
+ value:@User(2,"Alice","Hello")
210
+ value2:@User(3,"Bob","World")
211
+
212
+ ```
213
+
214
+ ### 6. Nested Types
215
+
216
+ Currently, nested types are allowed as structural definitions:
217
+
218
+ ```akd
219
+ @User<
220
+ id:string
221
+ name:string
222
+ profile: < level:number, score:number >
223
+ >
224
+ [
225
+ ("u1","Aga",{level:5,score:82})
226
+ ("u2","Marek",{level:7,score:91})
227
+ ]
228
+
229
+ ```
230
+
231
+ ---
232
+
233
+ ## 🔮 Futures / Roadmap
234
+
235
+ The following features are planned for future releases and are **not yet implemented**.
236
+
237
+ * **Modifiers:**
238
+ * `!required` - field must be included.
239
+ * `?empty` - field must not be empty.
240
+ * `=value` - default value.
241
+ * `N..M` - numeric range validation.
242
+
243
+
244
+ * **Binary Data Types:**
245
+ * Hex: `~[hex]1A0F4F~`
246
+ * Base64: `~[b64]ADFKDXKZK...~`
247
+
248
+
249
+ * **Pointers/References:**
250
+ * Reference existing objects by ID: `(1, "Alex", *User[2])`
251
+
252
+
253
+ ## 📄 License
254
+
255
+ This project is licensed under the [MIT License].
256
+
257
+ ---
258
+
259
+ <div align="center">
260
+ <sub>Built by <strong>Arkadia Solutions</strong>. Engineering the kernel of distributed intelligence.</sub>
261
+ </div>