Skip to main content

Tools for using the Civis Platform with Jupyter notebooks.

Project description

Tools for using the Civis Platform with Jupyter notebooks

Installation and Setup

Run the following commands in a shell:

pip install civis-jupyter-extensions
jupyter nbextension install --py civis_jupyter_ext
jupyter nbextension enable --py civis_jupyter_ext

In order to use the extensions, make sure to have your Civis Platform API key in your local environment as CIVIS_API_KEY.

Magic Commands

To load the magic commands, use the following in ipython or a Jupyter notebook:

%load_ext civis_jupyter_ext

You can also autoload the magic commands every time a notebook is opened by adding:

c.InteractiveShellApp.extensions = ['civis_jupyter_ext']

to your ~/.ipython/profile_default/

SQL Queries

To get a table preview, use the cell magic like this:

%%civisquery my-database
select * from dummy.table limit 10;

To return a DataFrame for further processing, use the line magic like this:

df = %civisquery my-database; select * from dummy.table;

Project details

Download files

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

Files for civis-jupyter-extensions, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size civis-jupyter-extensions-1.0.0.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page