Search Engine DataBase utils
Project description
sedb
Search Engine DataBase utils
Install
pip install sedb[common] --upgrade
Currently, sedb supports interacting with following services:
-
common:
- MongoDB
- ElasticSearch
- Redis
- LLM REST API (OpenAI format)
-
vector:
- Milvus
- Qdrant
You can install all dependencies by:
pip install sedb[all] --upgrade
or default extreme light-weight dependencies by:
pip install sedb --upgrade
Usage
Run example:
python example.py
See: example.py
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / "src"))
import sedb
from sedb import MongoOperator, MongoConfigsType
if __name__ == "__main__":
mongo_configs = {
"host": "localhost",
"port": 27017,
"dbname": "test",
}
collection = "videos"
mongo = MongoOperator(configs=mongo_configs, indent=0)
cursor1 = mongo.get_cursor(
collection,
filter_index="pubdate",
filter_op="lte",
filter_range="2012-01-01",
sort_index="pubdate",
sort_order="asc",
)
print(cursor1.next())
cursor2 = mongo.get_cursor(
collection,
filter_index="pubdate",
filter_op="range",
filter_range=["2012-12-31", "2012-01-01"],
sort_index="pubdate",
sort_order="asc",
)
print(cursor2.next())
cursor3 = mongo.get_cursor(
collection,
filter_index="pubdate",
filter_op="range",
filter_range=["2012-01-01", None],
sort_index="pubdate",
sort_order="asc",
)
print(cursor3.next())
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
sedb-0.8.1.tar.gz
(13.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
sedb-0.8.1-py3-none-any.whl
(17.2 kB
view details)
File details
Details for the file sedb-0.8.1.tar.gz.
File metadata
- Download URL: sedb-0.8.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bc76df09d1f163ab55d722c5b427e4c7e6d74ca9f5164cf52db7893e09fcc40
|
|
| MD5 |
c2ef719eb138fc2605d7683243ca7f9a
|
|
| BLAKE2b-256 |
0125574a159be8cec5b4a35b6e880c050cb43faa26afaa90d51c91ca4df073ec
|
File details
Details for the file sedb-0.8.1-py3-none-any.whl.
File metadata
- Download URL: sedb-0.8.1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47ac4a658b387f8a4a8384dac0bcd54965ff6878b6f08663495bf301916b4e4b
|
|
| MD5 |
e2420e07e4c2871aa4f70ffe95fa25de
|
|
| BLAKE2b-256 |
3e48c67c8f5952b522e5227b215e6d7b6eecac292ca80b94e6181da538875430
|