Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

### Added
- Added instructions in the README for adding an API key to a Windows 10
environment

### Changed

Expand Down
62 changes: 51 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,68 @@ requests directly to the Civis API. See the
`full documentation <https://civis-python.readthedocs.io>`_ for more details.


Installation
------------
API Keys
--------

Usage of ``civis-python`` requires a valid Civis Platform API key, which can
be created by following the instructions
`here <https://civis.zendesk.com/hc/en-us/articles/216341583-Generating-an-API-Key>`_.
API keys have a set expiration date and new keys will need to be created at
least every 30 days. ``civis-python`` will look for a ``CIVIS_API_KEY``
environmental variable to access your API key, so after creating a new API key,
follow the steps below for your operating system to set up your environment.

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::
Linux / MacOS
~~~~~~~~~~~~~

1. Add the following to ``.bash_profile`` for bash::

export CIVIS_API_KEY="alphaNumericApiK3y"

4. Source your ``.bash_profile``
5. Install the package::
2. Source your ``.bash_profile`` (or restart your terminal).

Windows 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth mentioning https://docs.microsoft.com/en-us/windows/wsl/install-win10, which in my opinion is the best way to use python in windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect users will already have a workflow for python on Windows before they install civis. This is pretty cool, though.

~~~~~~~~~~

1. Navigate to ``Settings`` -> type "environment" in search bar ->
``Edit environment variables for your account``. This can also be found
in ``System Properties`` -> ``Advanced`` -> ``Environment Variables...``.
2. In the user variables section, if ``CIVIS_API_KEY`` already exists in
the list of environment variables, click on it and press ``Edit...``.
Otherwise, click ``New..``.
3. Enter CIVIS_API_KEY as the ``Variable name``.
4. Enter your API key as the ``Variable value``. Your API key should look
like a long string of letters and numbers.


Installation
------------

After creating an API key and setting the ``CIVIS_API_KEY`` environmental
variable, install ``civis-python`` with::

pip install civis

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

pip install pandas
pip install pubnub

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 ``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.

You can test your installation by running

.. code-block:: python

import civis
client = civis.APIClient()
print(client.users.list_me()['username'])

If ``civis-python`` was installed correctly, this will print your Civis

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Civis" -> "Civis Platform"

Platform username.


Usage
-----
Expand Down