Skip to content

Latest commit

 

History

History
75 lines (47 loc) · 2.04 KB

README.md

File metadata and controls

75 lines (47 loc) · 2.04 KB

axiom-py CI

Axiom API Python bindings.

⚠️ This library is still a work-in-progress.

Table of Contents

  1. Introduction
  2. Installation
  3. Authentication
  4. Usage
  5. Documentation
  6. Contributing
  7. License

Introduction

Axiom Py is a Python client library for accessing the Axiom API.

Currently, Axiom Py requires Python3 or greater.

Installation

Install from source:

git clone `https://github.com/axiomhq/axiom-py`
cd axiom-py

Authentication

The Client is initialized with the url of the deployment and an access token. The access token can be a personal token retreived from the users profile page or an ingest token retrieved from the settings of the Axiom deployment.

The personal access token grants access to all resources available to the user on his behalf.

The ingest token just allows ingestion into the datasets the token is configured for.

Usage

import os
import axiom

deployment_url = os.getenv("AXIOM_URL")
access_token = os.getenv("AXIOM_TOKEN")
# needed only when using Axiom cloud, otherwise set to None
org_id = os.getenv("AXIOM_ORG_ID")

client = axiom.Client(deployment_url, access_token, org_id)

# Ingest into a dataset
print(client.datasets.ingest("foobar", [{"foo": "bar"}]))

Documentation

You can find the Axiom and Axiom Py documentation on the docs website.

Contributing

This project uses Poetry for dependecy management and packaging, so make sure that this is installed (see Poetry Installation).

Run poetry install to install dependencies and poetry shell to activate a virtual environment.

License

© Axiom, Inc., 2021

Distributed under MIT License (The MIT License).

See LICENSE for more information.