JSON to NDJSONify is a Python package specifically engineered for converting JSON files to NDJSON (Newline Delimited JSON) format. Built for developers who are working with APIs or data platforms that require NDJSON input, this package helps streamline your workflow by automating the conversion process.
- Supports complex nested JSON structures
- Ability to filter specific nodes (e.g.,
edges) - Highly optimized and lightweight
- Written in Python, making it highly extensible and maintainable
- Unit tests to validate NDJSON output
Clone the repository:
git clone https://github.com/mohjak/json_to_ndjsonify.gitNavigate to the cloned directory and run:
pip install .Or directly via pip:
pip install json-to-ndjsonifyTo convert a JSON file to NDJSON:
json-to-ndjsonify --input sample.json --node edgesThis will create an NDJSON file in the same directory as the sample.json file, suffixed with a timestamp.
For additional configurations, consult the inline help:
json-to-ndjsonify --help-
--input: Specifies the path of the JSON file to be converted. -
--node: Specifies the node name in the JSON file. Default is 'edges'. -
--output: Path to the output folder.Example:
json-to-ndjsonify --input /path/to/your/file.json --node custom_edges --output /path/to/output/folder
To execute the unit tests:
export NDJSON_DIR=/path/to/your/ndjson/directory
python -m unittest tests/test_main.pySee the CHANGELOG.md file for the latest changes in the current version.
See the CONTRIBUTING.md file for how to contribute to this project.
This package is licensed under the MIT License. See the LICENSE.md file for details.