A versatile Python toolkit for working with JSON data. It includes features for streaming large JSON files, filtering and transforming data, converting to different formats, exporting data, and performing advanced JSON analysis.
- Streaming: Efficiently stream large JSON files without loading everything into memory.
- Filtering: Filter JSON data based on keys or key-value pairs.
- Conversion: Convert JSON data to various formats like CSV and XML.
- Export: Export JSON data to multiple formats including CSV and XML.
- Analysis: Analyze JSON data for statistical insights and more.
-
Clone the repository:
git clone https://github.com/Jenderal92/json_toolkit.git cd json_toolkit
-
Install the package:
pip install .
from json_toolkit import JSONStreamer
def process_large_json(file_path):
streamer = JSONStreamer(file_path)
for data in streamer.stream():
# Process each chunk of JSON data
print(data)
process_large_json('large_data.json')
from json_toolkit import JSONConverter
def convert_json_to_csv(json_data):
JSONConverter.json_to_csv(json_data, 'output.csv')
data = [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
convert_json_to_csv(data)
from json_toolkit import JSONFilter
def filter_json_by_key(json_data, key):
return JSONFilter.filter_by_key(json_data, key)
data = [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
filtered_data = filter_json_by_key(data, 'name')
print(filtered_data)
To set up the development environment:
-
Clone the repository:
git clone https://github.com/Jenderal92/json_toolkit.git cd json_toolkit
-
Set up the environment:
./scripts/setup_env.sh
-
Install development dependencies:
pip install -r requirements-dev.txt
-
Run tests:
./scripts/run_tests.sh
We welcome contributions to this project. If you'd like to contribute, please fork the repository, create a new branch, and submit a pull request. Make sure to follow the code style guidelines, write tests, and update the documentation as necessary.
For detailed instructions, please see CONTRIBUTING.md.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by various open-source JSON processing tools.
- Thanks to all contributors and the open-source community.
This README.md
includes the following sections:
- Project Overview: A brief description of what the toolkit does.
- Features: Highlights the main functionalities.
- Installation: Instructions for installing the toolkit from PyPI or from source.
- Usage: Examples of how to use different features of the toolkit (streaming, conversion, filtering).
- Development: Guidelines for setting up a development environment and running tests.
- Contributing: Encouragement for external contributions.
- License: Information about the project's license (MIT License in this case).
Feel free to modify or add any other sections as needed!