Skip to main content

Object Record Table - a CSV like structured data format with native object and array support.

Project description

Object Record Table (ORT)

ORT is a CSV-like structured data format with native support for objects and arrays.
Unlike inefficient human-readable data structures, ORT efficiently represents data, making it ideal for large language model (LLM) token optimization and structured data interchange.

Table of Contents


Why ORT

Standard JSON and YAML prioritize human readability, but their structural characteristics introduce significant computational overhead when passing data to large language models. ORT addresses this by optimizing data representation for token efficiency.

JSON

{
  "users": [
    {
      "id": 1,
      "profile": {
        "name": "John Doe",
        "age": 30,
        "address": {
          "city": "New York",
          "country": "USA"
        }
      }
    },
    {
      "id": 2,
      "profile": {
        "name": "Jane Smith",
        "age": 25,
        "address": {
          "city": "London",
          "country": "UK"
        }
      }
    }
  ]
}

398 Characters / 118 Tokens

Compact-JSON

{"users":[{"id":1,"profile":{"name":"John Doe","age":30,"address":{"city":"New York","country":"USA"}}},{"id":2,"profile":{"name":"Jane Smith","age":25,"address":{"city":"London","country":"UK"}}}]}

198 Characters / 58 Tokens

ORT

users:id,profile(name,age,address(city,country)):
1,(John Doe,30,(New York,USA))
2,(Jane Smith,25,(London,UK))

110 Characters / 35 Tokens


When Not to Use ORT

ORT is not always the optimal choice. Consider using JSON in the following scenarios:

  • Non-uniform data structures: ORT operates efficiently and reliably with uniform data structures. For heterogeneous data, JSON is more efficient and prevents data loss.
  • Direct application data files: ORT is not optimized for direct input/output operations. Since ORT specializes in data transformation and processing, using JSON for application data files offers better compatibility and stability.

Command-Line Tools

The Rust implementation provides CLI utilities for converting between ORT and JSON formats:

ort2json <input_file>
json2ort <input_file>

# Or with output file specification

ort2json <input_file> -o <output_file>
json2ort <input_file> -o <output_file>

Installation

Rust Library

Add to your Cargo.toml:

[dependencies]
ort-rs = "0.1.0"

TypeScript Library

npm i ort-ts

Python Library

pip install ort-python

Package Links


License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ort_python-0.2.5.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ort_python-0.2.5-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file ort_python-0.2.5.tar.gz.

File metadata

  • Download URL: ort_python-0.2.5.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ort_python-0.2.5.tar.gz
Algorithm Hash digest
SHA256 53407517d1e6acaa0b12ebbbdb361ea63a1afc3ad80732c5882156274f41547a
MD5 4ee1ef4a7e0a206deb8cf5c1b3668ad3
BLAKE2b-256 6952a83526f6447fb8ea4c3921d9e792008f8885a9f4c5e5abe762b5d4c6281c

See more details on using hashes here.

File details

Details for the file ort_python-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: ort_python-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ort_python-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 df323716c97b5b2d913f1890de590ff37bb7190aa642ae34cb1f79022a99f747
MD5 2f3a9b7c2e2f9164702f2d744f5727d2
BLAKE2b-256 f326cfd59b973736cf8bcaad0c5e933687c5e2d272bf97a893f125e476ba956b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page