Skip to main content

SciSave - Serialization/Deserialization for Scientific Data

Project description

SciSave - Serialization/Deserialization for Scientific Data

Summary

SciSave is a Python serialization/deserialization module:

  • Specially targeted for scientific applications.
  • Load JSON/YAML configuration files.
  • Load and write JSON/Pickle data files.

For YAML files, the following custom extensions are used:

  • !path - parse relative paths (with respect to the YAML file).
  • !include - include other YAML files (recursion possible).
  • !eval - evaluate a Python literal (using literal_eval).
  • !env - substitute YAML strings with values from environment variables.
  • !sub - substitute YAML strings with values from a provided dictionary.
  • !merge_dict - merge a list of dicts.
  • !merge_list - merge a list of lists.

For JSON files, the following custom extensions are used:

  • Allows the serialization/deserialization of complex numbers (__complex__).
  • Allows the serialization/deserialization of NumPy arrays (__numpy__).
  • Allows the serialization/deserialization as/from text and gzip files

The following file extensions are used:

  • .yaml, .yml - for YAML files
  • .json, .js - for JSON text files
  • .gz, .gzip - for JSON gzip files
  • .pck, .pkl, .pickle - for Pickle files

The JSON/YAML files with the custom extensions are still valid JSON/YAML files. Pickle is significantly faster than JSON for very large data files.

SciSave is written in Python (NumPy and PyYAML are the only dependencies). SciSave is respecting semantic versioning (starting from version 1.4).

Warning

  • Pickling data is not secure.
  • Only load pickle files that you trust.

Example

An example is located in the example folder of the repository:

  • run_data.py contains an example file for the loader/dumper
  • config_main.yaml YAML configuration file with custom extensions
  • config_include.yaml YAML configuration file for include extension
  • dump.json JSON plain text file for testing data dumping/loading
  • dump.gz JSON plain gzip file for testing data dumping/loading
  • dump.pickle Pickle file for testing data dumping/loading

Project Links

Author

Copyright

(c) 2023 - Thomas Guillod

BSD 2-Clause "Simplified" License

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

scisave-1.4.3.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

scisave-1.4.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file scisave-1.4.3.tar.gz.

File metadata

  • Download URL: scisave-1.4.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.11

File hashes

Hashes for scisave-1.4.3.tar.gz
Algorithm Hash digest
SHA256 ee335128698e039f8a17a5c8ac7cafab86b699894ffe5e853292a59e5d393824
MD5 0b315227b50c776d4981a777eb1a8c7f
BLAKE2b-256 58e6439507f55820355135cc137677f320f9b36b66b56ff0e886212da4d0e35d

See more details on using hashes here.

File details

Details for the file scisave-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: scisave-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.11

File hashes

Hashes for scisave-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cdecc02c019ca63a311a4c561c76f01ab1d06eb171949edc31b65d7db0cf814a
MD5 c85e391e213c281015b7ae53b4bc8ff9
BLAKE2b-256 a3a80108157a9daa615e4471347c4332fd390894af3df0345a50fde465b1d097

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