Search Document by Field and Value.
Project description
Welcome to invsearch Documentation
A fast document search engine allow search by field and value pair.
Example:
>>> from invsearch import InvIndex
>>> ii = InvIndex([
... {"id": 1, "name": "Alice", "friends": [2, 3]},
... {"id": 2, "name": "Bob", "age": 15, "friends": [1, 3]},
... {"id": 3, "name": "Cathy", "age": None, "friends": [1, 2]},
... {"id": 4, "name": "Bob", "age": None},
... ])
>>> ii.find_one(id=1)
{"id": 1, "name": "Alice", "friends": [2, 3]}
>>> ii.find(name="Bob")
[{"id": 2, "name": "Bob", "age": 15, "friends": [1, 3]}, {"id": 4, "name": "Bob", "age": None}]
>>> ii.by_id(id=1)
{"id": 1, "name": "Alice", "friends": [2, 3]}
Install
invsearch is released on PyPI, so all you need is:
$ pip install invsearch
To upgrade to latest version:
$ pip install --upgrade invsearch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
invsearch-0.0.2.tar.gz
(13.5 kB
view hashes)
Built Distribution
Close
Hashes for invsearch-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9321360c7283edae8b9b1466f517e4d540f9c32aaa57d26791706eaa60c3408 |
|
MD5 | 88c176124b66034c87dbd4ca3c878ea5 |
|
BLAKE2b-256 | 8d514033e40b51e7303ec85eb7eaba9a0e9d70128f3f52cf7f157ceb8cdd544e |