An easier method to read, edit, and save data in JSONs
Project description
HikSon
HikSon is a simple and efficient Python package designed to make it easier to read, save, and delete JSON data files. This package provides a clean and intuitive API for handling basic JSON file operations in Python.
Features
- Read JSON: Easily load and return data from a JSON file.
- Save JSON: Save or overwrite data in a JSON file with simple method calls.
- Delete JSON: Remove JSON files from your system.
Installation
HikSon can be installed using pip (once published on PyPI):
pip install HikSon
Or you can clone the repository and install it manually:
git clone https://github.com/1cz1/HikSon.git
cd HikSon
pip install .
Usage
1. Reading a JSON file:
Use the read_json method to load data from a JSON file.
from hikson import HikSon
data = HikSon.read_json('data.json')
print(data)
2. Saving data to a JSON file:
Use the save_json method to write or update data in a JSON file.
from hikson import HikSon
data = {
"name": "Hikaro",
"skills": ["Cybersecurity", "Programming"]
}
HikSon.save_json('data.json', data)
3. Deleting a JSON file:
Use the delete_json method to delete a JSON file from the system.
from hikson import HikSon
HikSon.delete_json('data.json')
API Reference
read_json(file_path)
- Description: Reads a JSON file from the provided file path and returns its data.
- Arguments:
file_path(str): The path to the JSON file.
- Returns: The contents of the JSON file as a Python dictionary or list.
- Exceptions: Raises an exception if the file is not found or contains invalid JSON.
save_json(file_path, data)
- Description: Saves Python data (dict, list, etc.) to a JSON file at the specified path.
- Arguments:
file_path(str): The path to save the JSON file.data(dict or list): The data to be saved.
- Returns: "Done" when the file is successfully saved.
- Exceptions: Raises an exception if there’s an issue saving the file.
delete_json(file_path)
- Description: Deletes a JSON file from the specified path.
- Arguments:
file_path(str): The path to the JSON file to be deleted.
- Returns: "Done" when the file is successfully deleted.
- Exceptions: Raises an exception if the file does not exist.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or open a pull request.
Author
Hikaro
Cybersecurity & Programmer
Instagram: @hikaro.yy
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 hikson-0.1.0.tar.gz.
File metadata
- Download URL: hikson-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
803842801926d88c41daca60251e411e0f170588590e99501a3dc163c78a4d2b
|
|
| MD5 |
8ffccf99243eeff18dc2117b6cced943
|
|
| BLAKE2b-256 |
f3f39a4aced41ae47a5bd6bc8b826d10a8d2f8f280c65a1da53fa8a74b9b7f7a
|
File details
Details for the file HikSon-0.1.0-py3-none-any.whl.
File metadata
- Download URL: HikSon-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d95d4e7508f8cec847bcf80901f9738fc0475e2fcef905bbab4d0f85ea0df52
|
|
| MD5 |
ae5e57ad60d5c67827296ef1927b0bc9
|
|
| BLAKE2b-256 |
c6f12cb46e38e5acbc5ffe9350911451ed740cb1951950b7f927df8596ba3e4e
|