Skip to content

chris-rl/axiom-py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Axiom API Python bindings.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.7%
  • Nix 0.3%