microstate
Simple REST state storage tied to a write key
You need a key
from microstate import MicroStateWriter
write_key = MicroStateWriter.create_key(difficulty=11) # Takes a while!
to instantiate a writer
writer = MicroStateWriter(write_key=write_key)
Usage pattern 1
Assume we have data taking the form of a dictionary
data = {'age':17,'model':'my model','params':{'mean':17,'std':10}
Store data:
writer.set(value=data)
Retrieve data:
data = writer.get()
Usage pattern 2 (using a logical memory location from 0 to 99)
Store data with a location index
writer.set(value=data, k=34)
Retrieve data with a location index
data = writer.get(k=34)
Other data types (caution!)
- Tuples will be converted to lists
- int, float to string
To preserve types use dict or list
Partial support for tuple
Tuples can be stored but will be converted to list.
Memory limits
Assuming a write key of difficulty at least 11:
location 0 holds 320 kb
locations 1-319 hold 1 kb each
Metadata
Release files for microstate 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| microstate-0.2.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microstate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / microstate-0.2.0.tar.gz
| Download URL | microstate-0.2.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b7d94110df6ae3e81f3479544013a336623f81af1ad62dc7341f64ec0748fa0
|
|
BLAKE2b-256 checksum How to use checksums |
762498f5098e3c6f6bce5c8eca7b5141f6f5f08dcd97f1ffbb7dbc1c0b1ef067
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / microstate-0.2.0-py3-none-any.whl
| Download URL | microstate-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fa972d80b26a6a22337752658af4db21a50a9acee256f5c1a56570eccdb55be
|
|
BLAKE2b-256 checksum How to use checksums |
dff063c9b47c02134f9c85944c5de46cb6828aca4df879d8a13f8186e6269f9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|