Skip to main content

Many-to-one keys-value pair relationship Python object manager.

Project description

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 namair import Namari

# initialize
lexicon = Namari()

# set key-value pair
lexicon.set("yellow", "sun")

# associate existing keys with a new and unique key
lexicon.attach("yellow", "hot")
lexicon.attach("yellow", "morning")
lexicon.attach("morning", "summer")
lexicon.attach("morning", "cold")

# 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")

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

namari-1.0.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

namari-1.0.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page