Skip to main content

Access the Civis Platform API

Project description

Civis API Python Client
=======================

# Introduction

The Civis API Python client is a Python package that helps analysts and
developers interact with the Civis Platform. The package includes a set of
tools around common workflows as well as a convenient interface to make
requests directly to the Civis API. See the
[full documentation](https://civis-python.readthedocs.io) for more details.


# Installation

1. Get a Civis API key [(instructions)](https://civis.zendesk.com/hc/en-us/articles/216341583-Generating-an-API-Key)
2. Add a `CIVIS_API_KEY` environment variable.
3. You can add the following to `.bash_profile` for bash
```
export CIVIS_API_KEY="alphaNumericApiK3y"
```
4. Source your `.bash_profile`
5. Install the package

```
pip install civis
```
6. Optionally, install `pandas`, `pubnub`, and `requests-toolbelt` to enable some functionality in `civis-python`

```
pip install pandas
pip install pubnub
pip install requests-toolbelt
```
Installation of `pandas` will allow some functions to return `DataFrame` outputs.
Installation of `pubnub` will improve performance in all functions which
wait for a Civis Platform job to complete.
Installation of `requests-toolbelt` will allow streaming file uploads to
Civis via `civis.io.file_to_civis`.

# Usage

`civis-python` includes a number of wrappers around the Civis API for
common workflows.

```python
import civis
df = civis.io.read_civis(table="my_schema.my_table",
database="database",
use_pandas=True)
```

The Civis API may also be directly accessed via the `APIClient` class.

```python
import civis
client = civis.APIClient()
database = client.databases.list()
```

See the [full documentation](https://civis-python.readthedocs.io) for a more
complete user guide.

# Build Documentation Locally
To build the API documentation locally

```bash
cd docs
make html
```

Then open `docs/build/html/index.html`.

Note that this will use your API key in the `CIVIS_API_KEY` environment
variable so it will generate documentation for all the endpoints that you have access to.

# Contributing

See `CONTIBUTING.md` for information about contributing to this project.


# License

BSD-3

See `LICENSE.md` for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

civis-1.3.0.tar.gz (31.4 kB view details)

Uploaded Source

File details

Details for the file civis-1.3.0.tar.gz.

File metadata

  • Download URL: civis-1.3.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for civis-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d258201c7e084fd3555f158727d3eca29170061a4bcac77b5f3f1d5c4ad4c58e
MD5 7aecf98a02c48cb5f169035700907df6
BLAKE2b-256 461630232b1e9d766761b193b4bc18856d819fdc3276496e5f86aac505a9796a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page