a dict that supports alias of KEY
Project description
Install cachelite:
pip install aliasdict
Then you can use it.
import aliasdict from AliasDict
adct = AliasDict()
#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.3.tar.gz
(2.8 kB
view details)
File details
Details for the file aliasdict-0.9.3.tar.gz.
File metadata
- Download URL: aliasdict-0.9.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a71ae5a228b4da8ba53655f89069dcc3457015f757b244f06e1f766867e0ad
|
|
| MD5 |
1a98e857913184577ad86b724043c047
|
|
| BLAKE2b-256 |
39590d48e52081d4cf59a978b5d84c17da3210291163c4ac712cfa581e9900bd
|