Skip to main content

a dict that supports alias of KEY

Project description

This module helps users to make multiple keys dict with same value. In addition to that, this dict automatically gzip-compress values. So it’s very efficient.

I hope this module helps you python programing in your lap-top PC.

Quickstart

Install cachelite:

pip install aliasdict

Then you can use it.

import aliasdict from AliasDict

adct = AliasDict()
#if you don't need value compression, AliasDict(compress=False)

#put a key-value
adct["YOUR_KEY"] = "YOUR_VALUE"

#set a alias to key
adct.set_alias("YOUR_KEY", "YOUR_ALIAS")

#get value by alias
adct["YOUR_ALIAS"]

#save1
with open( "PATH_TO_FILE", "wb") as f:
    adct.dump(f)

#save2
with open( "PATH_TO_FILE", "wb") as f:
    f.write(adct.dumps())


#load1
with open( "PATH_TO_FILE", "rb") as f:
    adct = AliasDict.load(f)

#load2
with open( "PATH_TO_FILE", "rb") as f:
    adct = AliasDict.loads(f.read())

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

aliasdict-0.9.5.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file aliasdict-0.9.5.tar.gz.

File metadata

  • Download URL: aliasdict-0.9.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for aliasdict-0.9.5.tar.gz
Algorithm Hash digest
SHA256 4363299478becfaec8330cdc889967b17b843427c4a91b6a28e1cd3da2fe6f51
MD5 a0927f6e9020bfe5639203fa7a4c6386
BLAKE2b-256 61adaf2fcbe2f98b6083e5f6d3b3409821bae1a8a926e4e792cfd7d3a7b29bd2

See more details on using hashes here.

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