Metadata-Version: 2.4
Name: ndca
Version: 5.0.0
Summary: NDCA (Nested Data Collection API) — a fast, safe, and human-readable nested data storage and manipulation library for Python.
Author: Viren Sahti
License: Copyright © 2026-2027 Viren Sahti
        All rights reserved.
        
        1. GRANT OF LICENSE
        This software is licensed, not sold. Subject to strict compliance with these terms, the copyright holder grants you a limited, non-exclusive, non-transferable, revocable license to use the software for lawful and legitimate purposes only. Any use beyond the scope of this license requires a separate commercial license obtained from the copyright holder.
        
        2. RESTRICTIONS
        You must not copy, redistribute, sublicense, sell, publish, adapt, translate, reverse engineer, decompile, disassemble, or create derivative works from this software, in whole or in part, except as expressly permitted in writing by the copyright holder. You must not claim authorship of this software or present it as your own.
        
        3. PROPRIETARY RIGHTS
        All title, ownership rights, and intellectual property rights in and to the software and any copies remain with the copyright holder. Unauthorized use or distribution will result in immediate termination of this license and may subject you to civil and criminal penalties.
        
        4. COMMERCIAL USE
        Commercial use, redistribution, embedding in commercial products, or inclusion in paid services is strictly prohibited unless you obtain an explicit commercial license. For licensing inquiries contact the copyright holder.
        
        5. NO WARRANTY
        The software is provided "AS IS" without warranty of any kind. The copyright holder disclaims all warranties, whether express, implied, statutory or otherwise, including without limitation any implied warranties of merchantability, fitness for a particular purpose, title, non-infringement, or arising from course of dealing or performance.
        
        6. LIMITATION OF LIABILITY — NO RISK TO COPYRIGHT HOLDER
        To the maximum extent permitted by applicable law, in no event will the copyright holder be liable for any direct, indirect, incidental, special, exemplary, punitive, or consequential damages, including loss of profits, data, goodwill, use, or other intangible losses, even if advised of the possibility of such damages. The user assumes all risk associated with the use of the software. The copyright holder bears no responsibility for misuse, illegal use, or third-party claims arising from your use of the software.
        
        7. ILLEGAL OR MALICIOUS USE
        If the software is used to facilitate, commit, or attempt illegal or malicious activities, you accept full responsibility for such use and any legal consequences. The copyright holder does not endorse and disclaims any liability for illegal uses.
        
        8. INDEMNIFICATION
        You agree to indemnify, defend, and hold harmless the copyright holder from and against any and all claims, losses, liabilities, damages, costs, and expenses (including reasonable attorneys’ fees) arising out of or in connection with your breach of this license or your use of the software.
        
        9. ENFORCEMENT AND REMEDIES
        Breach of these terms entitles the copyright holder to all available remedies under law and equity, including injunctive relief, specific performance, and recovery of damages and costs. The copyright holder may suspend or terminate your license immediately upon breach.
        
        10. EXPORT CONTROLS
        You shall comply with all applicable export control laws and regulations. You represent and warrant that you are not located in, under the control of, or a national of any country to which export is restricted.
        
        11. TERMINATION
        This license is effective until terminated. Your rights under this license will terminate automatically without notice if you fail to comply with any term of this license. Upon termination you must cease all use and destroy all copies of the software in your possession or control.
        
        12. GOVERNING LAW; SEVERABILITY
        This license will be governed by the applicable laws determined by the copyright holder. If any provision is found unenforceable, the remaining provisions will remain in full force and effect.
        
        13. NO ASSIGNMENT OF LIABILITY
        Nothing in this license transfers liability for your unlawful acts to the copyright holder. You remain fully responsible for compliance with all laws and third-party rights.
        
        14. REQUESTS FOR RIGHTS
        For permission to redistribute, modify, or obtain a commercial license, contact the copyright holder.
        
        15. NO LEGAL ADVICE
        This license is a legal document. It does not constitute legal advice. For binding legal terms or jurisdiction-specific contracts, consult qualified legal counsel.
        
        16. SURVIVAL
        Sections regarding proprietary rights, restrictions, no warranty, limitation of liability, indemnification, enforcement, termination, and governing law survive termination of this license.
        
        END OF LICENSE
Keywords: ndca,nested,data,storage,serialization,configuration,table,csv,python,library
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Database :: Database Engines/Servers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.12; extra == "dev"
Requires-Dist: isort>=6.0; extra == "dev"
Requires-Dist: pre-commit>=3.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest-cov>=4.0; extra == "test"
Dynamic: license-file

# 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.
