Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hikson-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

HikSon-0.2.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file hikson-0.2.0.tar.gz.

File metadata

  • Download URL: hikson-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hikson-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b381fc49ea6c805e2bd9581eb68fbf600f7ed4113427e5dd683f71e1f2f8f684
MD5 b068118b6b46178ac8c5c27313cdeb65
BLAKE2b-256 ed5f9e1926045d7c27a01927985eb14048d9604f2664671b90b618e3c2a0182b

See more details on using hashes here.

File details

Details for the file HikSon-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: HikSon-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for HikSon-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6537c8ec5b708f7d0f2ae511c1566a5d195e28af97c2315684b1fd502bf6c9a
MD5 7df9494a755ea54e6da0ac902b051e9d
BLAKE2b-256 1254d25d5d6a82b2e5eb4c27e228d619a19c4a2ff30e58c33c37c08f8647373d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page