NASPy: Neural Associative Structure (Python Edition)
NASPy is a minimal, hash-based memory framework designed to mimic how associative memory works, storing and reconstructing structured data using atomic units. Built in Python, NASPy provides the tools to build memory streams, deduplicate data, and serialize complex structures into verifiable, non-redundant records.
🧠 Core Concepts
🔹 Datom
A "data atom," the smallest unit of memory. Each Datom has:
- A data type (e.g.,
text,int,symbol) - A value (e.g.,
"login",42) - A hash computed from the above
🔹 DatomIndex
A lookup table that deduplicates datoms. Prevents storing the same value twice.
🔹 Scanner
Accepts objects (dicts, classes) and flattens them into lists of Datom hashes. Adds new Datoms to the index as needed.
🔹 DataculeStream
An append-only list of memory entries. Each entry is:
(datacule_hash, [datom_hash1, datom_hash2, ...])
Where datacule_hash is the hash of the ordered list of datom hashes.
🔹 .nason files
Serialized memory: stores the DatomIndex and DataculeStream as JSON. You can export and reload entire memory sessions using:
export_nason(index, stream, "file.nason")index, stream = load_nason("file.nason")
📦 Installation
Clone the repo and import the package locally:
git clone https://github.com/yourname/naspy.git
cd naspy
Then in your Python files:
from naspy.datom import Datom
from naspy.scanner import Scanner
✅ Usage Example
from naspy.datom_index import DatomIndex
from naspy.dataculestream import DataculeStream
from naspy.scanner import Scanner
from naspy.io import export_nason, load_nason
index = DatomIndex()
stream = DataculeStream()
scanner = Scanner(index)
obj = {"user": "user", "event": "login"}
datacule = scanner.observe(obj)
stream.add_datacule(datacule)
export_nason(index, stream, "memory.nason")
🧪 Tests
Run the test suite from the root:
python -m unittest discover -s tests
🧩 Use Cases
- Cognitive memory simulation
- Game state snapshotting
- Transparent logging
- AI input tracking
- Behavioral analytics
🛠 Future Work
- NASPy CLI tools
- Visual datacule explorer
- Integration with
Feeds™ .nasonfile versioning and metadata
📄 License
MIT — free to use, build on, and enhance.
Metadata
Release files for naspy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| naspy-1.0.0.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| naspy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / naspy-1.0.0.tar.gz
| Download URL | naspy-1.0.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f256fc0e83278eb69585b1833d6ee2e9bbe3c648a51a8d22f5f10f9715307000
|
|
BLAKE2b-256 checksum How to use checksums |
c2990b33c6078e5406847409c5f7b725165da9447212171edcb9742d6f3dc2b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / naspy-1.0.0-py3-none-any.whl
| Download URL | naspy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f6523e99e5cdeb38921c2937ecae14ecd6a53e149f555e3bae143751f0ea524
|
|
BLAKE2b-256 checksum How to use checksums |
10ac447988748df28ca78e43f1694a7e8872af9d05ff654a2a22b24edce498dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|