No project description provided
Project description
python-openobserve
A python connector to submit information to OpenObserve (https://github.com/openobserve/openobserve)
The idea is to have a similar python connector to the "Elasticsearch" package, which allows a 1:1 replacement of the "Elasticsearch" package with the "OpenObserve" package.
OpenObserve is way more lightweight than Elasticsearch, and it is open source, like everything should be.
install
pip install python-openobserve
usage
see example.ipynb for a full example
from python_openobserve.openobserve import OpenObserve
OO = OpenObserve(user = "root@example.com", password = "Complexpass#123")
from datetime import datetime
from random import random
from pprint import pprint
document = {
"@timestamp" : datetime.utcnow(),
"component" : "testagent",
"action" : "buy",
"amount" : random() * 100,
"portfolio" : {
"USD" : random() * 100.0,
"BTC" : 0.1 + random() * 0.1
}
}
pprint(document)
# insert document
OO.index("dd", document)
#search
# example sql parsing helper
sql = 'SELECT * FROM "dd"'
results = OO.search(sql)
print(f"got {len(results)} results")
pprint(results)
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
python_openobserve-0.1.3.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for python_openobserve-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5c8cf344efac351e923853d15ad7cd4e323fadb32d08512464f361756847975 |
|
MD5 | 4630b3f9043a01ac13b5c5a0e15e25db |
|
BLAKE2b-256 | 6891592fc4c9bad69f2c0f9f9e05281b6f73c475144e3d394d8269d26515fa82 |