SciSave - Serialization for Scientific Data
Project description
SciSave - Serialization for Scientific Data
- Repository: github.com/otvam/scisave
- PyPi: pypi.org/project/scisave
- Conda: anaconda.org/conda-forge/scisave
Summary
SciSave is a Python serialization/deserialization module:
- Specially targeted for scientific applications.
- Load and write JSON/MessagePack/Pickle data files.
- Load JSON/YAML configuration files.
- Validate data with JSON schemas.
For YAML files, the following custom extensions are used:
- Parse relative paths with respect to the YAML file (
!path). - Include other YAML files into the YAML file (
!include). - Evaluate a Python literal using literal_eval (
!eval). - Substitute YAML strings with values from environment variables (
!env). - Substitute YAML strings with values from a provided dictionary (
!sub). - Merge a list of dicts (
!merge_dict). - Merge a list of lists (
!merge_list).
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
For MessagePack files, the following custom extensions are used:
- Allows the serialization/deserialization of complex numbers (
__complex__). - Allows the serialization/deserialization of NumPy arrays (
__numpy__).
For JSON schemas, the following custom extensions are used:
- Handling NumPy types (integer, floating, and complex).
- Handling NumPy multidimensional arrays.
The following file extensions are used:
.yaml, .yml- for YAML files.json, .js- for JSON text files.gz, .gzip- for JSON gzip files.mpk, .msg", .msgpack- for MessagePack files.pck, .pkl, .pickle- for Pickle files
The JSON/YAML/MessagePack files with the custom extensions are still valid files. Pickle/MessagePack is typically faster than JSON for very large data files.
SciSave is written in Python (NumPy, PyYAML, msgpack, and jsonschema 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.pycontains an example file for the loader/dumperrun_bench.pycontains a simple benchmark for the different formatsconfig_main.yamlYAML configuration file with custom extensionsconfig_include.yamlYAML configuration file for include extensionconfig_schema.yamlYAML file containing the JSON schema definitiondump.jsonJSON text file for testing data dumping/loadingdump.gzJSON gzip file for testing data dumping/loadingdump.picklePickle file for testing data dumping/loading
Project Links
- Repository: https://github.com/otvam/scisave
- Releases: https://github.com/otvam/scisave/releases
- Tags: https://github.com/otvam/scisave/tags
- Issues: https://github.com/otvam/scisave/issues
- PyPi: https://pypi.org/project/scisave
- Conda: https://anaconda.org/conda-forge/scisave
Author
- Thomas Guillod
- Email: guillod@otvam.ch
- Website: https://otvam.ch
Copyright
(c) 2023 - Thomas Guillod
BSD 2-Clause "Simplified" License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scisave-1.6.0.tar.gz.
File metadata
- Download URL: scisave-1.6.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc417f1b4fbe27d343eca5698a7feee9328bc422f030f5ea3335d87852803983
|
|
| MD5 |
f80e705cc87a7123d77ae42203d966a0
|
|
| BLAKE2b-256 |
3d6a8752d8f04b817b476a553afe2267da14743e817bf60c5139d3309febf070
|
File details
Details for the file scisave-1.6.0-py3-none-any.whl.
File metadata
- Download URL: scisave-1.6.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb2b9a942ec8f356aee293cb9843383c5ceff04d3ec545a0f5efd2f0de0526af
|
|
| MD5 |
c390cee8d013fb483888624d5ae2e013
|
|
| BLAKE2b-256 |
a767e18d76c3325a2a609adec3cd5d4a17d7c344f3f4cd5f4f720bc64e2ef883
|