Name | axiom-py JSON |
Version |
0.8.1
JSON |
| download |
home_page | None |
Summary | Official bindings for the Axiom API |
upload_time | 2024-09-30 15:04:44 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2021 Axiom, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# axiom-py
<a href="https://axiom.co">
<picture>
<source media="(prefers-color-scheme: dark) and (min-width: 600px)" srcset="https://axiom.co/assets/github/axiom-github-banner-light-vertical.svg">
<source media="(prefers-color-scheme: light) and (min-width: 600px)" srcset="https://axiom.co/assets/github/axiom-github-banner-dark-vertical.svg">
<source media="(prefers-color-scheme: dark) and (max-width: 599px)" srcset="https://axiom.co/assets/github/axiom-github-banner-light-horizontal.svg">
<img alt="Axiom.co banner" src="https://axiom.co/assets/github/axiom-github-banner-dark-horizontal.svg" align="right">
</picture>
</a>
[![CI][ci_badge]][ci]
[![PyPI version][pypi_badge]][pypi]
[![Python version][version_badge]][pypi]
[Axiom](https://axiom.co) unlocks observability at any scale.
- **Ingest with ease, store without limits:** Axiom’s next-generation datastore enables ingesting petabytes of data with ultimate efficiency. Ship logs from Kubernetes, AWS, Azure, Google Cloud, DigitalOcean, Nomad, and others.
- **Query everything, all the time:** Whether DevOps, SecOps, or EverythingOps, query all your data no matter its age. No provisioning, no moving data from cold/archive to “hot”, and no worrying about slow queries. All your data, all. the. time.
- **Powerful dashboards, for continuous observability:** Build dashboards to collect related queries and present information that’s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources
For more information check out the [official documentation](https://axiom.co/docs)
and our
[community Discord](https://axiom.co/discord).
## Quickstart
Install using `pip`:
```bash
# Linux / MacOS
python3 -m pip install axiom-py
# Windows
py -m pip install axiom-py
```
Alternatively, if you have the [`pip`](https://pip.pypa.io/) package installed, you can install `axiom-py` with the following command:
```bash
pip3 install axiom-py
```
If you use the [Axiom CLI](https://github.com/axiomhq/cli), run `eval $(axiom config export -f)` to configure your environment variables.
Otherwise create a personal token in [the Axiom settings](https://cloud.axiom.co/profile) and export it as `AXIOM_TOKEN`. Set `AXIOM_ORG_ID` to the organization ID from the settings page of the organization you want to access.
You can also configure the client using options passed to the client constructor:
```py
import axiom_py
client = axiom_py.Client("<api token>", "<org id>")
```
Create and use a client like this:
```py
import axiom_py
import rfc3339
from datetime import datetime,timedelta
client = axiom_py.Client()
client.ingest_events(
dataset="my-dataset",
events=[
{"foo": "bar"},
{"bar": "baz"},
])
client.query(r"['my-dataset'] | where foo == 'bar' | limit 100")
```
For more examples, see [`examples/client.py`](examples/client_example.py).
## Logger
You can use the `AxiomHandler` to send logs from the `logging` module to Axiom
like this:
```python
import axiom_py
from axiom_py.logging import AxiomHandler
import logging
def setup_logger():
client = axiom_py.Client()
handler = AxiomHandler(client, "my-dataset")
logging.getLogger().addHandler(handler)
```
For a full example, see [`examples/logger.py`](examples/logger_example.py).
If you use [structlog](https://github.com/hynek/structlog), you can set up the
`AxiomProcessor` like this:
```python
from axiom_py import Client
from axiom_py.structlog import AxiomProcessor
def setup_logger():
client = Client()
structlog.configure(
processors=[
# ...
structlog.processors.add_log_level,
structlog.processors.TimeStamper(fmt="iso", key="_time"),
AxiomProcessor(client, "my-dataset"),
# ...
]
)
```
For a full example, see [`examples/structlog.py`](examples/structlog_example.py).
## Contributing
This project uses [uv](https://docs.astral.sh/uv) for dependency management
and packaging, so make sure that this is installed.
To lint and format files before commit, run `uvx pre-commit install`.
## License
Distributed under MIT License (`The MIT License`).
<!-- Badges -->
[ci]: https://github.com/axiomhq/axiom-py/actions/workflows/ci.yml
[ci_badge]: https://img.shields.io/github/actions/workflow/status/axiomhq/axiom-py/ci.yml?branch=main&ghcache=unused
[pypi]: https://pypi.org/project/axiom-py/
[pypi_badge]: https://img.shields.io/pypi/v/axiom-py.svg
[version_badge]: https://img.shields.io/pypi/pyversions/axiom-py.svg
Raw data
{
"_id": null,
"home_page": null,
"name": "axiom-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/81/97/08552352f5e3403bf6634be9d51bf39c8ad2d0496e276c77e8ca621660a4/axiom_py-0.8.1.tar.gz",
"platform": null,
"description": "# axiom-py\n\n<a href=\"https://axiom.co\">\n<picture>\n <source media=\"(prefers-color-scheme: dark) and (min-width: 600px)\" srcset=\"https://axiom.co/assets/github/axiom-github-banner-light-vertical.svg\">\n <source media=\"(prefers-color-scheme: light) and (min-width: 600px)\" srcset=\"https://axiom.co/assets/github/axiom-github-banner-dark-vertical.svg\">\n <source media=\"(prefers-color-scheme: dark) and (max-width: 599px)\" srcset=\"https://axiom.co/assets/github/axiom-github-banner-light-horizontal.svg\">\n <img alt=\"Axiom.co banner\" src=\"https://axiom.co/assets/github/axiom-github-banner-dark-horizontal.svg\" align=\"right\">\n</picture>\n</a>\n \n\n[![CI][ci_badge]][ci]\n[![PyPI version][pypi_badge]][pypi]\n[![Python version][version_badge]][pypi]\n\n[Axiom](https://axiom.co) unlocks observability at any scale.\n\n- **Ingest with ease, store without limits:** Axiom\u2019s next-generation datastore enables ingesting petabytes of data with ultimate efficiency. Ship logs from Kubernetes, AWS, Azure, Google Cloud, DigitalOcean, Nomad, and others.\n- **Query everything, all the time:** Whether DevOps, SecOps, or EverythingOps, query all your data no matter its age. No provisioning, no moving data from cold/archive to \u201chot\u201d, and no worrying about slow queries. All your data, all. the. time.\n- **Powerful dashboards, for continuous observability:** Build dashboards to collect related queries and present information that\u2019s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources\n\nFor more information check out the [official documentation](https://axiom.co/docs)\nand our\n[community Discord](https://axiom.co/discord).\n\n## Quickstart\n\nInstall using `pip`:\n\n```bash\n# Linux / MacOS\npython3 -m pip install axiom-py\n\n# Windows\npy -m pip install axiom-py\n```\n\nAlternatively, if you have the [`pip`](https://pip.pypa.io/) package installed, you can install `axiom-py` with the following command:\n\n```bash\npip3 install axiom-py\n```\n\nIf you use the [Axiom CLI](https://github.com/axiomhq/cli), run `eval $(axiom config export -f)` to configure your environment variables.\n\nOtherwise create a personal token in [the Axiom settings](https://cloud.axiom.co/profile) and export it as `AXIOM_TOKEN`. Set `AXIOM_ORG_ID` to the organization ID from the settings page of the organization you want to access.\n\nYou can also configure the client using options passed to the client constructor:\n\n```py\nimport axiom_py\n\nclient = axiom_py.Client(\"<api token>\", \"<org id>\")\n```\n\nCreate and use a client like this:\n\n```py\nimport axiom_py\nimport rfc3339\nfrom datetime import datetime,timedelta\n\nclient = axiom_py.Client()\n\nclient.ingest_events(\n dataset=\"my-dataset\",\n events=[\n {\"foo\": \"bar\"},\n {\"bar\": \"baz\"},\n ])\nclient.query(r\"['my-dataset'] | where foo == 'bar' | limit 100\")\n```\n\nFor more examples, see [`examples/client.py`](examples/client_example.py).\n\n## Logger\n\nYou can use the `AxiomHandler` to send logs from the `logging` module to Axiom\nlike this:\n\n```python\nimport axiom_py\nfrom axiom_py.logging import AxiomHandler\nimport logging\n\n\ndef setup_logger():\n client = axiom_py.Client()\n handler = AxiomHandler(client, \"my-dataset\")\n logging.getLogger().addHandler(handler)\n```\n\nFor a full example, see [`examples/logger.py`](examples/logger_example.py).\n\nIf you use [structlog](https://github.com/hynek/structlog), you can set up the\n`AxiomProcessor` like this:\n\n```python\nfrom axiom_py import Client\nfrom axiom_py.structlog import AxiomProcessor\n\n\ndef setup_logger():\n client = Client()\n\n structlog.configure(\n processors=[\n # ...\n structlog.processors.add_log_level,\n structlog.processors.TimeStamper(fmt=\"iso\", key=\"_time\"),\n AxiomProcessor(client, \"my-dataset\"),\n # ...\n ]\n )\n```\n\nFor a full example, see [`examples/structlog.py`](examples/structlog_example.py).\n\n## Contributing\n\nThis project uses [uv](https://docs.astral.sh/uv) for dependency management\nand packaging, so make sure that this is installed.\n\nTo lint and format files before commit, run `uvx pre-commit install`.\n\n## License\n\nDistributed under MIT License (`The MIT License`).\n\n<!-- Badges -->\n\n[ci]: https://github.com/axiomhq/axiom-py/actions/workflows/ci.yml\n[ci_badge]: https://img.shields.io/github/actions/workflow/status/axiomhq/axiom-py/ci.yml?branch=main&ghcache=unused\n[pypi]: https://pypi.org/project/axiom-py/\n[pypi_badge]: https://img.shields.io/pypi/v/axiom-py.svg\n[version_badge]: https://img.shields.io/pypi/pyversions/axiom-py.svg\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2021 Axiom, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Official bindings for the Axiom API",
"version": "0.8.1",
"project_urls": {
"Homepage": "https://axiom.co",
"Issues": "https://github.com/axiomhq/axiom-py/issues",
"Repository": "https://github.com/axiomhq/axiom-py.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d98ba781380cce9b37d701ba80cae4256fae012e3694697c89011d5a26dc8dbc",
"md5": "58e5c31a799c9ee68bb292198082389f",
"sha256": "162297d7e27cd373eacc2a615dfb93e7e1e11a0fd85cbe311022eed1510a80f1"
},
"downloads": -1,
"filename": "axiom_py-0.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "58e5c31a799c9ee68bb292198082389f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19860,
"upload_time": "2024-09-30T15:04:42",
"upload_time_iso_8601": "2024-09-30T15:04:42.911261Z",
"url": "https://files.pythonhosted.org/packages/d9/8b/a781380cce9b37d701ba80cae4256fae012e3694697c89011d5a26dc8dbc/axiom_py-0.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "819708552352f5e3403bf6634be9d51bf39c8ad2d0496e276c77e8ca621660a4",
"md5": "c1162dff8ab5444632e7dbe1e9fefd24",
"sha256": "759fe959a06dc8bfb687266cb76d1cf7cb5f22b55b96a5dfb5d8b89b2895f578"
},
"downloads": -1,
"filename": "axiom_py-0.8.1.tar.gz",
"has_sig": false,
"md5_digest": "c1162dff8ab5444632e7dbe1e9fefd24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 87342,
"upload_time": "2024-09-30T15:04:44",
"upload_time_iso_8601": "2024-09-30T15:04:44.195266Z",
"url": "https://files.pythonhosted.org/packages/81/97/08552352f5e3403bf6634be9d51bf39c8ad2d0496e276c77e8ca621660a4/axiom_py-0.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-30 15:04:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "axiomhq",
"github_project": "axiom-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "axiom-py"
}