Skip to main content

SciSave - Python Data Loader/Dumper for Science

Project description

SciSave - Python Data Loader/Dumper for Science

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).
  • !env - include YAML string from environment variables.
  • !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.

SciSave is written in Python (NumPy and PyYAML are the only dependencies).

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.2.0.tar.gz (10.2 kB view hashes)

Uploaded Source

Built Distribution

scisave-1.2.0-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

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