# 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](example.ipynb) for a full example
```python
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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/JustinGuese/python-openobserve",
"name": "python-openobserve",
"maintainer": "",
"docs_url": null,
"requires_python": ">3.9",
"maintainer_email": "",
"keywords": "openobserve,elasticsearch,logging,unstructured data",
"author": "Justin Guese",
"author_email": "guese.justin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9b/68/10d605cbae20b044e5d2e34d8c748a5f7c308e711161928ff12b05e25505/python_openobserve-0.1.3.tar.gz",
"platform": null,
"description": "# python-openobserve\nA python connector to submit information to OpenObserve (https://github.com/openobserve/openobserve)\n\nThe 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.\n\nOpenObserve is way more lightweight than Elasticsearch, and it is open source, like everything should be.\n\n## install\n\n`pip install python-openobserve`\n\n## usage\n\nsee [example.ipynb](example.ipynb) for a full example\n\n```python\nfrom python_openobserve.openobserve import OpenObserve\n\nOO = OpenObserve(user = \"root@example.com\", password = \"Complexpass#123\")\n\nfrom datetime import datetime\nfrom random import random\nfrom pprint import pprint\ndocument = {\n \"@timestamp\" : datetime.utcnow(),\n \"component\" : \"testagent\",\n \"action\" : \"buy\", \n \"amount\" : random() * 100,\n \"portfolio\" : {\n \"USD\" : random() * 100.0,\n \"BTC\" : 0.1 + random() * 0.1\n }\n}\npprint(document)\n\n# insert document\nOO.index(\"dd\", document)\n\n#search\n# example sql parsing helper\nsql = 'SELECT * FROM \"dd\"'\nresults = OO.search(sql)\nprint(f\"got {len(results)} results\")\npprint(results)\n```",
"bugtrack_url": null,
"license": "GNUv3",
"summary": "",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/JustinGuese/python-openobserve",
"Repository": "https://github.com/JustinGuese/python-openobserve"
},
"split_keywords": [
"openobserve",
"elasticsearch",
"logging",
"unstructured data"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6891592fc4c9bad69f2c0f9f9e05281b6f73c475144e3d394d8269d26515fa82",
"md5": "4630b3f9043a01ac13b5c5a0e15e25db",
"sha256": "c5c8cf344efac351e923853d15ad7cd4e323fadb32d08512464f361756847975"
},
"downloads": -1,
"filename": "python_openobserve-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4630b3f9043a01ac13b5c5a0e15e25db",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3.9",
"size": 28037,
"upload_time": "2023-07-07T10:19:33",
"upload_time_iso_8601": "2023-07-07T10:19:33.014347Z",
"url": "https://files.pythonhosted.org/packages/68/91/592fc4c9bad69f2c0f9f9e05281b6f73c475144e3d394d8269d26515fa82/python_openobserve-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b6810d605cbae20b044e5d2e34d8c748a5f7c308e711161928ff12b05e25505",
"md5": "64712ead3a6287eb79ff9e53277d66d1",
"sha256": "6edca48549568023e5acfbe8ad1b6de3f574ed0e107138cf51906b32f1f022b7"
},
"downloads": -1,
"filename": "python_openobserve-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "64712ead3a6287eb79ff9e53277d66d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.9",
"size": 14974,
"upload_time": "2023-07-07T10:19:34",
"upload_time_iso_8601": "2023-07-07T10:19:34.090721Z",
"url": "https://files.pythonhosted.org/packages/9b/68/10d605cbae20b044e5d2e34d8c748a5f7c308e711161928ff12b05e25505/python_openobserve-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-07 10:19:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JustinGuese",
"github_project": "python-openobserve",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "python-openobserve"
}