NDCA (Nested Data Collection API) — a fast, safe, and human-readable nested data storage and manipulation library for Python.
Reason this release was yanked:
Unstable
Project description
NDCA 5
Nested Data Collection API
Version 5.0.0
INFO
NDCA 5 (Nested Data Collection API) is a high-performance, production-ready Python library for storing, reading, and manipulating nested structured data using a compact, human-readable format. It supports atomic persistence, safe in-memory operations, advanced table utilities, pagination, CSV import/export, and hash-verified writes.
Version 5.0.0 introduces enhanced table features, multi-level inheritance, Unicode support, advanced error handling, autosave, and improved list and dictionary utilities.
FEATURES
- Human-readable nested data format
- Nested objects, lists, and tuples
- Safe deep copy operations
- Atomic file writing and autosave
- Path-based nested access
- Dictionary merging and inheritance
- Increment, toggle, and append/remove helpers
- Hash-verified writes
- Import/export and CSV support
- Table utilities with row indexing, sorting, and pagination
- Multi-level parent references
- Production-ready stability and error handling
INSTALLATION
Install via pip by running the following command in your terminal:
pip install ndca
Alternatively, include NDCA directly in your project by copying the module files.
NDCA FORMAT
Compact structured syntax for nested data.
OBJECT FORMAT
<[key]="value";[key2]=123;[key3]=true;>
LIST FORMAT
(value1;value2;value3;)
NESTED STRUCTURE
<[name]="Viren";[age]=12;[skills]=("Python";"Bash";"NDCA");[settings]=<[theme]="dark";[enabled]=true;>;>
FORMAT RULES
- Objects start with < and end with >
- Keys are wrapped in [key]
- Key-value pairs are separated by =
- Each item ends with ;
- Lists use ( )
- Strings use " "
- Booleans are true and false
- Null values use null
- Nested structures are fully supported
BASIC USAGE
from ndca import NDCA
store = NDCA()
store.write("user", '<[name]="Viren";[age]=12;>') store.write("config", '<[enabled]=true;[theme]="dark";>')
print(store.get("user"))
Output: <[name]="Viren";[age]=12;>
FILE STORAGE
from ndca import file
db = file("data.ndca", autosave=True)
db.write("user.name", "Viren") db.write("user.age", 12)
print(db.get("user.name"))
CORE DATA API
READ
- get(path, default=None)
- get_with_meta(path)
- exists(path)
- keys()
- keys_at(path)
- paths()
WRITE
- write(path, value)
- setdefault(path, value)
- update(path, dict_value)
- rename(path, new_name)
DELETE
- delete(path)
- clear_path(path)
- pop(path)
- wipe()
LIST UTILITIES
- append(path, value)
- remove_from_list(path, value)
- paginate(path, page, per_page)
DATA UTILITIES
- merge(other_dict)
- incr(path, amount)
- toggle(path)
- count_rows(path)
IMPORT AND EXPORT
- export(filename)
- import_file(filename)
- dump()
- dumps()
- load(filename)
- loads(text)
- save(filename)
HASH SAFE WRITES
- hash_write(filename)
Writes the NDCA file with a verification hash to ensure integrity.
TABLE UTILITIES
CREATE TABLE
- table_create(path, columns)
INSERT ROW
- table_insert(path, row)
GET ROW
- table_get_row(path, index)
FIND ROWS
- table_find(path, criteria)
UPDATE ROW
- table_update_row(path, index, updates)
DELETE ROW
- table_delete_row(path, index)
TABLE INDEX
- table_index(path, key, unique=False)
SORT TABLE
- table_sort(path, key, reverse=False)
CSV EXPORT
- table_to_csv(path, filename, include_header=True)
CSV IMPORT
- table_from_csv(path, filename, columns=None)
PAGINATION
page = store.paginate("items", page=1, per_page=10)
print(page["items"]) print(page["total"])
Pagination returns:
page
per_page
total
items
VERSION
NDCA Version 5.0.0
EXAMPLE DATA
<[user]=<[name]="Viren";[age]=12;>;[settings]=<[theme]="dark";[notifications]=true;>;[skills]=("Python";"Bash";"NDCA");>
LICENSE
See the LICENSE file included in this project.
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 ndca-5.0.0.tar.gz.
File metadata
- Download URL: ndca-5.0.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9f2015e1d1f39671314cadf98bee6909ef2841fdafdc45ddba05889c3bba0d4
|
|
| MD5 |
1915e3979ae1d81b47fc8d15c44f71de
|
|
| BLAKE2b-256 |
29c234f5ccbfbb1868da187ce4ed4aee454356a8f71c501cea2ea013b6ca5fbd
|
File details
Details for the file ndca-5.0.0-py3-none-any.whl.
File metadata
- Download URL: ndca-5.0.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e3ac01271d6b9c3218b7e0c7ebc5c8f486313648bea4ed5323da23946acf416
|
|
| MD5 |
f400d27ac883f432cd529df0368eaf9f
|
|
| BLAKE2b-256 |
c0b3b0bd7b385053fb491b149fde86bcb6eaf3261decb2c78d058c890685fb72
|