Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axiomhq/axiom-py
The official Python bindings for the Axiom API
https://github.com/axiomhq/axiom-py
api axiom client logger python
Last synced: 3 months ago
JSON representation
The official Python bindings for the Axiom API
- Host: GitHub
- URL: https://github.com/axiomhq/axiom-py
- Owner: axiomhq
- License: mit
- Created: 2021-03-22T08:47:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T06:27:33.000Z (5 months ago)
- Last Synced: 2024-06-25T21:54:05.846Z (4 months ago)
- Topics: api, axiom, client, logger, python
- Language: Python
- Homepage: https://axiom.co
- Size: 261 KB
- Stars: 22
- Watchers: 3
- Forks: 12
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![axiom-py: The official Python bindings for the Axiom API](.github/images/banner-dark.svg#gh-dark-mode-only)
![axiom-py: The official Python bindings for the Axiom API](.github/images/banner-light.svg#gh-light-mode-only)[![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 sourcesFor 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 axiomclient = axiom.Client("", "")
```Create and use a client like this:
```py
import axiom
import rfc3339
from datetime import datetime,timedeltaclient = axiom.Client()
time = datetime.utcnow() - timedelta(hours=1)
time_formatted = rfc3339.format(time)client.ingest_events(
dataset="my-dataset",
events=[
{"foo": "bar", "_time": time_formatted},
{"bar": "baz", "_time": time_formatted},
])
client.query(r"['my-dataset'] | where foo == 'bar' | limit 100")
```for more examples, check out the [examples](examples) directory.
## Contributing
This project uses [Poetry](https://python-poetry.org) for dependecy management
and packaging, so make sure that this is installed (see [Poetry Installation](https://python-poetry.org/docs/#installation)).Run `poetry install` to install dependencies and `poetry shell` to activate a
virtual environment.## License
Distributed under MIT License (`The MIT License`).
[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