Skip to main content

Tools to read and write .son file

Project description

son | sequential object notation

What is this?

son is a data format that builds on JSON and adds one feature inspired by YAML: concatenation of objects with ---. Optionally, the delimiter === can be used once per son file to delimit metadata.

Why son?

While JSON is perfect for storing structured data, it is inherently impossible to add new portions of data to a file without reading it first. YAML files on the other hand are self extensible by the --- delimiter, but the flexibility YAML offers makes the files inefficient to parse. They are thus unsuited to store significant amounts of data.

son fills the gap by allowing JSON objects to be concatenated with ---. It thus combines the speed and efficiency of JSON with the sequential extensibility of YAML, see example. It further adds to discern metadata from actual data by using ===.

Who needs this?

son originated from the need to store computational data that is produced portion by portion on a computer. The requirements were:

  • Possible to be read by a human,
  • possible to store arbitrary data structures including metadata,
  • easy to write and parse by a computer,
  • efficient to parse to allow files of up to GB size (takes forever to parse with YAML),
  • 100% sequential and incorruptible.

Example

This is a valid son string:

{
  "purpose": "store biography data",
  "version": 0.1
}
===
{
  "first name": "Hildegard",
  "second name": "Kneef",
  "age": 93
}
---
{
  "first name": "Wiglaf",
  "second name": "Droste",
  "age": 57
}

It will be parsed into the metadata object, and a list containing the data objects with

import son

metadata, data = son.load('file.son')

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

son-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

son-0.1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file son-0.1.1.tar.gz.

File metadata

  • Download URL: son-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

File hashes

Hashes for son-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eae9d5328e799b08fc6398164bcf5b32323b4ad36dd7722e3302cc0dcf06bb11
MD5 96db41ee4a8b2028c98c93d74c205156
BLAKE2b-256 7ab67f92ad8b81ce1d9103643295af0935282cc6c46aa54c2cc77d4cb9576ab0

See more details on using hashes here.

File details

Details for the file son-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: son-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

File hashes

Hashes for son-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5a31460def63d4afef949bddc71243ec373bf77e8091e71477dcf452cdcd2c3
MD5 97d7a0fc9569ef8c18fb5b18739e09a5
BLAKE2b-256 a9abecd49c61c4ac19388e118b2f8f2f5abb0865a8800b60469d95212200c729

See more details on using hashes here.

Supported by

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