Search Engine DataBase utils
Project description
sedb
Search Engine DataBase utils
Install
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
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.2.1.1.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file sedb-0.2.1.1.tar.gz
.
File metadata
- Download URL: sedb-0.2.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e6b18a0dce929286c6dada8ea5d532443c6f91778159839eed59dcc3970ab3 |
|
MD5 | 0a99065736f77f61490bf2828a045108 |
|
BLAKE2b-256 | 65c64d9437785b2a7da430fa7b10b08277b09037be299fbd1d141e6794f503d7 |
File details
Details for the file sedb-0.2.1.1-py3-none-any.whl
.
File metadata
- Download URL: sedb-0.2.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d61e448fc00f0435d357c1e7ec8f98c0424b85ed20b05c1cfba4a86b1e78ddb9 |
|
MD5 | a6f78dc554eadec6458edb9fbe23fed6 |
|
BLAKE2b-256 | 6e54cbb9d56c5ce358d7235e54beccd75d49f50799b4c3cd18e32c15872c948c |