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
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
wixok_jsonfile-25.8.3.tar.gz
(4.9 kB
view details)
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b02ad62b4abfce3c081102192216f29e8d97bb734b58801ad3916afb5203473
|
|
| MD5 |
94f66b5b61b493c6b53fed0dbb3c6981
|
|
| BLAKE2b-256 |
c2179eba9f8e41172919bccb65d1758bc32a402c392063f84995e292fbcbfa24
|
File details
Details for the file wixok_jsonfile-25.8.3-py3-none-any.whl.
File metadata
- Download URL: wixok_jsonfile-25.8.3-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b0fb342aedfc9eea0ea646d2c9f8df4a636e1d9d4157b79b1a46fa5c83557d
|
|
| MD5 |
c096af0dde87e22660c4fd2278273e1a
|
|
| BLAKE2b-256 |
37bc300e748bba4900184c839efa0118a9e89e9dd23234ced4cf878d3044aac0
|