Skip to main content

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


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.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sedb-0.8.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file sedb-0.8.0.tar.gz.

File metadata

  • Download URL: sedb-0.8.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for sedb-0.8.0.tar.gz
Algorithm Hash digest
SHA256 2d29a0ffa59bdc6b6d162e3c24441f87ad62f3fbd2c18390e0632094f1f5d25f
MD5 dbab7034a1bf778e37407cf8f69437cb
BLAKE2b-256 89e5e16c002bfdb597ddd332226700556778694f4418a64b54f011e4d3c11bf9

See more details on using hashes here.

File details

Details for the file sedb-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: sedb-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for sedb-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c63e8c39310d8fae314096164d5b19706d42596774dddd1a5bd4e78f2fa1614
MD5 a15090556022275645fa40bdf1e9ee73
BLAKE2b-256 deb3e9b3d43efafd1a588cffe666a4525107c9003c726c7c3a7b43762c594c62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page