Skip to content

Commit 45daeab

Browse files
authored
[CIVP-11087] MAINT Convert README.md to README.rst (#83)
setup.py points long_description to the readme file, but the PyPI site doesn't render Markdown.
1 parent 145388a commit 45daeab

File tree

4 files changed

+105
-99
lines changed

4 files changed

+105
-99
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
### Changed
7+
- Convert `README.md` (Markdown) to `README.rst` (reStructuredText).
68

79
### Fixed
810
- Fixed a bug which caused an exception to be set on all ``ModelFuture`` objects, regardless of job status (#86).

README.md

Lines changed: 0 additions & 98 deletions
This file was deleted.

README.rst

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
Civis API Python Client
2+
=======================
3+
4+
Introduction
5+
------------
6+
7+
The Civis API Python client is a Python package that helps analysts and
8+
developers interact with the Civis Platform. The package includes a set of
9+
tools around common workflows as well as a convenient interface to make
10+
requests directly to the Civis API. See the
11+
`full documentation <https://civis-python.readthedocs.io>`_ for more details.
12+
13+
14+
Installation
15+
------------
16+
17+
1. Get a Civis API key `(instructions) <https://civis.zendesk.com/hc/en-us/articles/216341583-Generating-an-API-Key>`_.
18+
2. Add a ``CIVIS_API_KEY`` environment variable.
19+
3. You can add the following to ``.bash_profile`` for bash::
20+
21+
export CIVIS_API_KEY="alphaNumericApiK3y"
22+
23+
4. Source your ``.bash_profile``
24+
5. Install the package::
25+
26+
pip install civis
27+
28+
6. Optionally, install ``pandas``, ``pubnub``, and ``requests-toolbelt`` to enable some functionality in ``civis-python``::
29+
30+
pip install pandas
31+
pip install pubnub
32+
pip install requests-toolbelt
33+
34+
Installation of ``pandas`` will allow some functions to return ``DataFrame`` outputs.
35+
Installation of ``pubnub`` will improve performance in all functions which
36+
wait for a Civis Platform job to complete.
37+
Installation of ``requests-toolbelt`` will allow streaming file uploads to
38+
Civis via ``civis.io.file_to_civis``.
39+
40+
Usage
41+
-----
42+
43+
``civis-python`` includes a number of wrappers around the Civis API for
44+
common workflows.
45+
46+
.. code-block:: python
47+
48+
import civis
49+
df = civis.io.read_civis(table="my_schema.my_table",
50+
database="database",
51+
use_pandas=True)
52+
53+
The Civis API may also be directly accessed via the ``APIClient`` class.
54+
55+
.. code-block:: python
56+
57+
import civis
58+
client = civis.APIClient()
59+
database = client.databases.list()
60+
61+
See the `full documentation <https://civis-python.readthedocs.io>`_ for a more
62+
complete user guide.
63+
64+
Retries
65+
~~~~~~~
66+
67+
The API client will automatically retry for certain API error responses.
68+
69+
If the error is one of [413, 429, 503] and the API client is told how long it needs
70+
to wait before it's safe to retry (this is always the case with 429s, which are
71+
rate limit errors), then the client will wait the specified amount of time
72+
before retrying the request.
73+
74+
If the error is one of [429, 502, 503, 504] and the request is not a ``patch*`` or ``post*``
75+
method, then the API client will retry the request several times, with a delay,
76+
to see if it will succeed.
77+
78+
Build Documentation Locally
79+
---------------------------
80+
81+
To build the API documentation locally::
82+
83+
cd docs
84+
make html
85+
86+
Then open ``docs/build/html/index.html``.
87+
88+
Note that this will use your API key in the ``CIVIS_API_KEY`` environment
89+
variable so it will generate documentation for all the endpoints that you have access to.
90+
91+
Contributing
92+
------------
93+
94+
See ``CONTRIBUTING.md`` for information about contributing to this project.
95+
96+
97+
License
98+
-------
99+
100+
BSD-3
101+
102+
See ``LICENSE.md`` for details.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def main():
4242
url="https://www.civisanalytics.com",
4343
description="Access the Civis Platform API",
4444
packages=find_packages(),
45-
long_description=read('README.md'),
45+
long_description=read('README.rst'),
4646
install_requires=required,
4747
extras_require={
4848
'pubnub': ['pubnub>=4.0.0,<=4.99']

0 commit comments

Comments
 (0)