Skip to main content

Simple Python package for text file operations.

Project description

JSONFile

Simple Python package for JSON file operations.

Install

pip install wixok.jsonfile

Usage

from wixok.jsonfile import JSONFile

# Load JSON data
items = JSONFile.load("data.json")
print(items)  # [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}, ...]

# Append to existing file (list or dict)
success = JSONFile.append("data.json", {"id": 3, "name": "Charlie"})
print(success)  # True

# Save (overwrite) JSON data
saved = JSONFile.save("output.json", [{"a": 1}, {"b": 2}])
print(saved)  # True

Methods

Method Description Returns
load(path) Load JSON content. Wraps dicts as [dict], returns empty list on error. list
append(path, data) Append a dict or list item to an existing JSON list/dict file. bool
save(path, data) Overwrite file with JSON-serializable data. bool

Debug Mode

JSONFile.debug = True  # Enable error messages

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

wixok_jsonfile-25.8.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

wixok_jsonfile-25.8.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file wixok_jsonfile-25.8.3.tar.gz.

File metadata

  • Download URL: wixok_jsonfile-25.8.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for wixok_jsonfile-25.8.3.tar.gz
Algorithm Hash digest
SHA256 0b02ad62b4abfce3c081102192216f29e8d97bb734b58801ad3916afb5203473
MD5 94f66b5b61b493c6b53fed0dbb3c6981
BLAKE2b-256 c2179eba9f8e41172919bccb65d1758bc32a402c392063f84995e292fbcbfa24

See more details on using hashes here.

File details

Details for the file wixok_jsonfile-25.8.3-py3-none-any.whl.

File metadata

File hashes

Hashes for wixok_jsonfile-25.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35b0fb342aedfc9eea0ea646d2c9f8df4a636e1d9d4157b79b1a46fa5c83557d
MD5 c096af0dde87e22660c4fd2278273e1a
BLAKE2b-256 37bc300e748bba4900184c839efa0118a9e89e9dd23234ced4cf878d3044aac0

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