Jigfyp is a query-builder for leveldb. It lets you specify leveldb ranges as tuples of strings.
Initializing
Initalize a Jigfyp with a LevelDB object.
import leveldb, Jigfyp db = leveldb.LevelDB() j = jigfyp.Jigfyp(db)
Working with individual keys
The key in these examples is b'one!two!three'.
j.put_one((b'one', b'two', b'three'), b'Hi') j.get_one((b'one', b'two', b'three')) j.delete_one((b'one', b'two', b'three'))
Working with ranges of keys
Here’s one way of adding a few records.
j.put_one((b'one', b'two', b'three'), b'Hi') j.put_one((b'one', b'two', b'four'), b'Hi') j.put_one((b'one', b'two', b'seven), b'Hi') j.put_one((b'over', b'nine', b'thousand'), b'Hi')
If you’re writing several records, you can use the put_many method to save the same data but with a leveldb.WriteBatch, which is usually faster.
records = [
((b'one', b'two', b'three'), b'Hi'),
((b'one', b'two', b'four'), b'Hi'),
((b'one', b'two', b'seven), b'Hi'),
((b'over', b'nine', b'thousand'), b'Hi'),
]
j.put_many(records)
The cool part is the get_many and delete_many methods. With these, you specify a partial key, and everything that starts with that key is emitted. Consider a database containing the four above records. If we pass no arguments to get_many, we’ll read all the data.
j.get_many()
If we pass (b'one', b'two'),
j.get_many(b'one', b'two')
we’ll get three records with these keys
* ``(b'one', b'two', b'three')`` * ``(b'one', b'two', b'four')``
and not the record with these keys
(b'one', b'two', b'seven)
(b'over', b'nine', b'thousand')
Similarly, if we run the following command,
j.delete_many(b'one')
we delete all the records whose keys begin with b'one', leaving us with a single record in the database, with the key (b'over', b'nine', b'thousand').
Metadata
Release files for jigfyp 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 | Actions |
|---|---|---|---|---|
| jigfyp-0.0.1.tar.gz | 2.2 kB | Without provenance | Details for jigfyp-0.0.1.tar.gz |
Release files / jigfyp-0.0.1.tar.gz
| Download URL | jigfyp-0.0.1.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad38e1c7ecede3187c1b9de90fdd180b0c0503216ce8dc078828a92e0faab2b8
|
|
BLAKE2b-256 checksum How to use checksums |
bd8f4d5b9068ddec8c066e6b4fc8b6d01fbf68b104aaa04aceaa7c874900a2a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jigfyp 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.