JsonPydexer
A (python) indexer for large collections of json files. In development and probably not good for general use yet.
Installation
pip install JsonPydexer
Usage
Starting from zero
>>>from JsonPydexer import JsonPydexer
>>># initialize with the root directory containing your json files
>>>jp = JsonPydexer("test_data/3")
>>># index on your keys. provide a list of keynamess. keyname elements can be a string for a
>>># field at root level, or a list of strings for nested fields
>>>jp.index(["id", "name", ["field_in_root", "field_below"]])
Opening an existing index
>>># initialize with the root directory containing your json files and .jp.pkl
>>>jp = JsonPydexer("test_data/3")
>>># get all the files that match a search string for non-unique index
>>>search_string = "alice"
>>>for filename in jp.get_files(["name"], search_string):
>>> print(filename)
1.json
3.json
>>># get the file matching a search string for a unique index
>>>filename = jp.get_file(["id"], "id2")
>>>print(filename)
2.json
Added, ~~removed, or modified~~ JSON files? Update the index
>>>jp = JsonPydexer("test_data/3")
>>>jp.update()
New files in the directory will be added to the index. Coming soon are: removing files not present in the directory from the index, and checking for modified files in the directory.
Current Limitations
As of 0.3.2, the library is not capable of reliably adding new keys to an existing index. Rather, the existing index file (.jp.pkl in the directory you’ve initialized JP in) should be deleted, and JP should be initialized again with the full list of desired keys.
Metadata
Release files for JsonPydexer 0.3.3
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 |
|---|---|---|---|---|
| JsonPydexer-0.3.3.tar.gz | 4.5 kB | Without provenance | Details for JsonPydexer-0.3.3.tar.gz |
Release files / JsonPydexer-0.3.3.tar.gz
| Download URL | JsonPydexer-0.3.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
117c076b521edf4d9a568b2d72010bf4311801679e243640e87ffd28721fc94b
|
|
BLAKE2b-256 checksum How to use checksums |
89b1b665a79e62740f3769c973777c13f4ad9838ce3f02b95578357062c97af2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for JsonPydexer 0.3.3
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.