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/ipython_config.py.
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;
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file civis-jupyter-extensions-0.1.3.tar.gz.
File metadata
- Download URL: civis-jupyter-extensions-0.1.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
371e0adde3e6708b17de4e296c3f9fc2486048be036bbac51fadc4ac00b137da
|
|
| MD5 |
eb5575b6611c2d1c94195c25161e4351
|
|
| BLAKE2b-256 |
b4cbd9c98b5a3da1a1580bbb348fed7b782b42558b48d77d6299c167845c8bf0
|