SciSave - Python Data Loader/Dumper for Science
Project description
SciSave - Python Data Loader/Dumper for Science
- 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 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.
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/dumperconfig_main.yaml
YAML configuration file with custom extensionsconfig_include.yaml
YAML configuration file for include extensiondump.json
JSON plain text file for testing data dumping/loadingdump.gz
JSON plain gzip file for testing data dumping/loadingdump.pickle
Pickle 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
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.0.tar.gz
(11.2 kB
view details)
Built Distribution
File details
Details for the file scisave-1.4.0.tar.gz
.
File metadata
- Download URL: scisave-1.4.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd836a2cd566f97ca397e8ed7f38ddb7bc69a35fe12fb17c1ba0159216fb93bd |
|
MD5 | 881cc40d9c3e99bda2a3652d52e9662c |
|
BLAKE2b-256 | bf11a01bffab3ea8359d4049d10c5e21bacac8a6e7808218148af0e9a6c55fbb |
File details
Details for the file scisave-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: scisave-1.4.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 218370ef10a6f1f12eb6c28f2d1b2282a611cdecf272fb60901b615c0e1efa7e |
|
MD5 | 77ad8516671db3ec617221fef1ec1aa3 |
|
BLAKE2b-256 | fccc65acfdb73e580014e31c0d3240070796d2fb7681cf7b0fcb4f41b23f6bc0 |