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.tar.gz
(4.0 kB
view details)
Built Distribution
sedb-0.2.1-py3-none-any.whl
(4.5 kB
view details)
File details
Details for the file sedb-0.2.1.tar.gz
.
File metadata
- Download URL: sedb-0.2.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e976fa861a0364425b42b2136c53f342b54c7d721f06f86075e737c71e1f080 |
|
MD5 | ee4c1cae9d2588d6b01da3e8e51592ea |
|
BLAKE2b-256 | fbc0f576dbe47f55f7ad2943cbfe6715eb988db52720f519f544815a232d33f4 |
File details
Details for the file sedb-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: sedb-0.2.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 | bde3131ec60a52aa56bc9cd2093dce2f733b9febb98d6e9405de8bf55a38b94c |
|
MD5 | 176b3b949c7be9682eb92b03e4862964 |
|
BLAKE2b-256 | 8fcf0f4fab6ae661483185cf586b86078ee185293bc022b5ff7969cd3d446e13 |