MappingOnDisk
An effort to make a map system which can be stored on hard disk/SSDs and other non voletile media.
Installation
pip install mapdisk
Usage
from mapDisk import mapDisk
create the hashed map file object md = mapDisk.MapD("HashMapName.md","path/to/file")
"HashMapName.mpd" is the name of the database file, it is created if it does not already exists and read otherwise path/to/file is "." by default
Adding key-value pairs
md.add("key","value")
key and value are converted to string and then stored for current implementation, returns the value stored for validating written data the same function is used to overwrite the previous data/value
Reading value
md.read(str("key))
returns the value in string format, only catch is if the value contains \x00 at the end it will be trimmed off for current implementation as a temporary fix
Deleting value
md.delete(str(key))
deletes the key-value from datafile
md.shrink()
can be called to shrink datafile if some delete operations are performed, isn't called by default after delete operation.
md.close()
It should be called at the end of data operations to close file descriptors
The above operations return None if they fail for some reason, this can be used to check for failures
Metadata
Release files for mapDisk 0.0.1
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 | |
|---|---|---|---|---|
| mapdisk-0.0.1.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mapdisk-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / mapdisk-0.0.1.tar.gz
| Download URL | mapdisk-0.0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d3eee6633a54eea7242dc464ed5b28ffaaa219d3e1cb07b26cf9c69e3ddeb81
|
|
BLAKE2b-256 checksum How to use checksums |
1842b9def1b2c92168b231112a94eb01819006a9745a143b87d43a34251683ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / mapdisk-0.0.1-py3-none-any.whl
| Download URL | mapdisk-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9ac378ae61de334724204fe1e49e30e1b22e65e7ac15f77e843d96f404a6689
|
|
BLAKE2b-256 checksum How to use checksums |
a5e03e42b2c36da7eaa88debf1c46be17f29452da3f08d5eb0318cf8bb016e98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for mapDisk 0.0.1
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.