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.1.tar.gz
(15.0 kB
view details)
Built Distribution
File details
Details for the file python_openobserve-0.1.1.tar.gz
.
File metadata
- Download URL: python_openobserve-0.1.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663ac1f4b6dc26df8c3345f3b4d34d22ba3095e34d55fb9ca4e4398a9e3ee69b |
|
MD5 | d5f0d4fada696c19f6428d0357c95ecf |
|
BLAKE2b-256 | f8cf907201d9732d16ffb8f227dd37d4644410ced015dd0f185d65ca4f4f8c7f |
File details
Details for the file python_openobserve-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_openobserve-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75338c3b8f71a92c324dab46d3ebdcdd152d7e0617c77e5aa511917dae9a3056 |
|
MD5 | 76ec00f8287fc0fdb1adcbffb4712e10 |
|
BLAKE2b-256 | 39f5fecf49471c9457d6a33c1b486c57bdbfc9ceee1cb83966be6b982aef40bd |