JFIO - Json Fast Input Output
JFIO is a high-performance Python package for reading and writing JSON files, powered by the popular C++ library nlohmann/json and pybind11. This package aims to provide simple and efficient JSON input/output operations while maintaining a user-friendly API.
Features
- High-performance JSON serialization and deserialization
- Simple and easy-to-use API with just two main functions:
readandwrite - Compatible with Python 3.6 and later
Installation
Prerequisites
- C++ compiler with support for C++11 or later
- Python 3.6 or later
- pybind11
Install using pip
pip install JFIO
Build from source
git clone git@github.com:PabloIbannez/JFIO.git
cd JFIO
python setup.py install
Alternatively:
git clone git@github.com:PabloIbannez/JFIO.git
cd JFIO
pip install .
Usage
Here is a basic example of how to use JFIO for reading and writing JSON files:
import JFIO
# Writing a JSON file
data = {
"name": "Alice",
"age": 30,
"city": "New York"
}
JFIO.write("output.json", data, formatted=True)
# Reading a JSON file
data_read = JFIO.read("output.json")
print(data_read)
API Reference
JFIO.write(filename: str, data, formatted: bool = False)
Write JSON data to a file.
Arguments:
filename(str): The name of the file to write to.data: The data to write. This can be any data type that is serializable to JSON.formatted(bool): Write JSON file in a human-readable format. Default:False.
JFIO.read(filename: str)
Read JSON data from a file.
Arguments:
filename(str): The name of the file to read from.
Returns:
- Parsed JSON data as a Python data structure.
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any questions or suggestions.
Acknowledgements
- nlohmann/json for providing the powerful C++ JSON library
- pybind11 for enabling seamless Python-C++ bindings
- pybind11_json for simplifying the integration of nlhomann/json with pybind11
Metadata
Release files for JFIO 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| JFIO-1.0.3.tar.gz | 135.8 kB | Without provenance | Details for JFIO-1.0.3.tar.gz |
Release files / JFIO-1.0.3.tar.gz
| Download URL | JFIO-1.0.3.tar.gz |
|---|---|
| Size | 135.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
769f959b4748503f80268ad598d900a3412e3e51cd2d5989604ed0aad990720b
|
|
BLAKE2b-256 checksum How to use checksums |
37e0babc1a5a1deb55429b1482d1ba4131f69ffd639d31c55f1f288c102075b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.5
|
Security for JFIO 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.