namari
Many-to-one keys-value pair relationship Python object manager.
Usage
Install the latest namari package, upcoming versions might introduce unannounced changes, so a virtual environment is a must have before installation.
pip install --upgrade namari
To integrate namari into your Python codes, check the code snippet below:
from namari import Namari
# initialize
lexicon = Namari()
# initialize with filename
lexicon = Namari("filename.json")
# clear contents
lexicon.clear()
# set key-value pair
lexicon.set("yellow", "sun")
# check if key existing
if lexicon.contains("yellow"):
print("Exists")
# associate an existing key with another value
lexicon.attach("yellow", "hot")
lexicon.attach("yellow", "morning")
lexicon.attach("yellow", "tea")
lexicon.attach("morning", "summer")
lexicon.attach("morning", "cold")
lexicon.attach("morning", "tea")
# associate an existing key with a unique value
lexicon.attach("morning", "tea", unique=True)
# disassociate 2nd key from the 1st key
lexicon.detach("summer", "cold")
# get the value of the specified key
object = lexicon.get("morning") # None
# get the value of the specified key with specified fallback
object = lexicon.get("night", fallback="moon")
# get the first parent of child
parent = lexicon.findFirst("summer", fallback=None)
parents = lexicon.findAll("tea")
# count contents
count = lexicon.count()
# check if empty
if lexicon.is_empty():
print("Empty")
# iterate over all keys-value pairs
for keys, value in lexicon.items():
print(type(keys)) # list
print("\n".join(keys))
print(value)
Did you know?
The repository name namari was inspired from the developer's noisy cat named Anna Marie, it also means as lead or guidance in Japanese.
Metadata
Release files for namari 1.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| namari-1.1.9.tar.gz | 6.7 kB | Without provenance | Details for namari-1.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| namari-1.1.9-py3-none-any.whl | Python 3 | none | any | Details for namari-1.1.9-py3-none-any.whl |
Total release size: 11.8 kB
Release files / namari-1.1.9.tar.gz
| Download URL | namari-1.1.9.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
636c19103929fa5fc2aab4f8af0fb41ab294c2114cf9d1c358f760f92abee397
|
|
BLAKE2b-256 checksum How to use checksums |
211fbfa97c1d65f8743f37c73b88c31e898f35ce46ce0a3bd1e54e4b9b95cdeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / namari-1.1.9-py3-none-any.whl
| Download URL | namari-1.1.9-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
890706686607cfbed67e50a5f1de84366d8925d0d6758223af02ec2dd72b056f
|
|
BLAKE2b-256 checksum How to use checksums |
7f432937ec664673dfee21bf8cf61ba64918bb1c970124a0db6af4c43e7ed4f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for namari 1.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.