kms - a tiny side project tuned into a library.
JSON storage wrapper and editor. Created with love by Boss_1s.
Once upon a time, this was just a small project to solve a problem: the over-steep learning curve for scratchattach's database functionality. Now, I have decided to make it a library, something with humble beginnings with big hopes in its future.
This is, after all, the greatest piece of a CPython progam I have made. ;)
Important
kms-semver1.4.x is officially built off of kms-v1.3.1/2026.08.12, and partially off of kms-v1.3.2/2026.09.30.
- Public API Cleanup: Added
atpublic-based visibility markers across the package and type stubs for a cleaner public/private API surface. - Storage Improvements: Added
Storage.update()and support for slice deletion withdel storage[start:stop]. - Testing Improvements: Expanded
kms.help()coverage and folded older issue-related tests into the main suite. - Release Automation: Improved nightly and release workflows so version generation and branch validation are more reliable.
- Slice Deletion Fix: Corrected
Storage.__delitem__so integer and slice deletion follow the correct logic. - Workflow Fixes: Resolved branch detection, deployment checks, and syntax issues in the automation workflows.
- Compatibility Fixes: Fixed
atpublicmetadata/type errors and cleaned up stale storage tests.
- Branch & Deployment Stability: Improved validation for supported
semver1.xbranches and pull request deployment checks. - Python Test Environment: Updated the test runner to CPython
3.15.0. - Dependency Refresh: Updated linting, docs, and test tooling across the
semver1.4.xbranch.
Important
Forward-ports from semver1.3.x are not included here. Check the semver1.3.x branch's README for specific changes there.
π Working Changelog
Install with pip:
pip install -U key-multivalue-storageOr, download the latest version of the .whl file in the releases page
You can also choose to download the development environment alongside the package:
pip install -U key-multivalue-storage[dev]The development package includes Pylint for testing and Griffe for finding breaking changes. You can see every test script in the repo's test folder.
- Create a Storage object to wrap the data to be stored:
>>> from key_multivalue_storage import Storage
>>> my_db = Storage("my_top_level_key", mysubkey="myvalue", myothersk="anotherval")- To store the object, use
Storage.store().
>>> my_db.store("database.json")
Data stored successfully in 'database.json'.- You can change certain global variables for each
Storageinstance.
>>> Storage.indent = 4 # indent size of JSON files
>>> Storage.encode = True # Whether to encode stored values- Load the data back into a Storage object:
>>> import key_multivalue_storage as kms
>>> loaded_db = kms.Load.by_key("database.json", "my_top_level_key") # You can also use Storage.Load.by_key()
>>> loaded_db = my_db
True- You can also cast a Storage object into a dictionary!
>>> dict_db = dict(my_db)
>>> dict_db
{"my_top_level_key":{"mysubkey":"myvalue","myothersk":"anotherval"}}There's a lot more to this library that what meets the eye.
See the full documentation here!
Have a GREAT day/night! :)