Skip to content

Commit 39ef7a9

Browse files
committed
Fix sphinx errors, warnings
1 parent 0e05e9c commit 39ef7a9

211 files changed

Lines changed: 5660 additions & 5518 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/_template.rst

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
1+
#############
12
YourConnector
2-
=============
3+
#############
34

4-
********
55
Overview
6-
********
6+
========
77

88
Provide a brief description of the tool your connector integrates with.
99

10-
Describe which features your connector implements and which features it doesn't. For example,
11-
you could specify that `YourConnector` implements the `thing` and `place` endpoints of the API, but
12-
does not implement the `person` endpoints.
10+
Describe which features your connector implements and which features it doesn't.
11+
For example, you could specify that ``YourConnector`` implements the ``thing`` and ``place`` endpoints of the API,
12+
but does not implement the ``person`` endpoints.
1313

14-
==========
1514
Quickstart
1615
==========
1716

18-
Provide a few examples of how to use `YourConnector`. Each example should be limited to a
19-
few lines of code. Use the [Sphinx Markup syntax](https://www.sphinx-doc.org/en/1.5/markup/code.html)
17+
Provide a few examples of how to use ``YourConnector``.
18+
Each example should be limited to a few lines of code.
19+
Use the `Sphinx Markup syntax <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code>`__
2020
to embed your examples. Be sure to provide an explanation of exactly what the code is doing.
2121

22-
**Example 1**
23-
2422
.. code-block:: python
23+
:caption: Get all things updated since Jan 01 2020
2524
26-
from parsons import YourConnector
27-
yc = YourConnector()
28-
table = yc.get_things(updated_since='2020-01-01')
29-
30-
This example shows how to get all of the things updated since the first day of the year 2020.
25+
from parsons import YourConnector
26+
yc = YourConnector()
27+
table = yc.get_things(updated_since='2020-01-01')
3128
32-
***
3329
API
34-
***
30+
====
3531

3632
.. autoclass:: parsons.yourconnector.yourconnector.YourConnector
3733
:inherited-members:

docs/actblue.rst

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
1+
#######
12
ActBlue
2-
=======
3+
#######
34

4-
********
55
Overview
6-
********
6+
========
77

8-
The ActBlue class allows you to interact with the ActBlue CSV API. Users of this Parsons integration can generate CSVs and
8+
The :class:`~parsons.actblue.actblue.ActBlue` class allows you to interact with the ActBlue CSV API.
9+
Users of this Parsons integration can generate CSVs and
910
manipulate entity CSV data within the Parsons table format.
1011

11-
.. note::
12+
.. admonition:: Authentication
1213

13-
Authentication
14-
In order to use this class you must generate and use a Client UUID and Client Secret set of credentials. Instructions for
15-
generating the set of keys can be found within the `CSV API documentation <https://secure.actblue.com/docs/csv_api#authentication>`_.
14+
In order to use this class you must generate and use a Client UUID and Client Secret set of credentials. Instructions for
15+
generating the set of keys can be found within the `ActBlue CSV API Authentication Documentation`_.
1616

17-
==========
1817
Quickstart
1918
==========
2019

21-
To instantiate the ActBlue class, you can either store your ``ACTBLUE_CLIENT_UUID`` and ``ACTBLUE_CLIENT_SECRET`` keys as environment
20+
To instantiate the :class:`~parsons.actblue.actblue.ActBlue` class, you can either store your
21+
``ACTBLUE_CLIENT_UUID`` and ``ACTBLUE_CLIENT_SECRET`` keys as environment
2222
variables or pass them in as arguments:
2323

2424
.. code-block:: python
25+
:caption: Use API key environment variables
2526
2627
from parsons import ActBlue
27-
28-
# First approach: Use API key environment variables
29-
30-
# In bash, set your environment variables like so:
31-
# export ACTBLUE_CLIENT_UUID='MY_UUID'
32-
# export ACTBLUE_CLIENT_SECRET='MY_SECRET'
3328
actblue = ActBlue()
3429
35-
# Second approach: Pass API keys as arguments
30+
.. code-block:: python
31+
:caption: Pass API keys as arguments
32+
33+
from parsons import ActBlue
3634
actblue = ActBlue(actblue_client_uuid='MY_UUID', actblue_client_secret='MY_SECRET')
3735
38-
You can then make a request to generate a CSV and save its data to a Parsons table using the main helper method, ``get_contributions()``:
36+
You can then make a request to generate a CSV and save its data to a Parsons table using the main helper method,
37+
:meth:`~parsons.actblue.actblue.ActBlue.get_contributions`:
3938

4039
.. code-block:: python
40+
:caption: Create Parsons table with entity CSV data for the month of January 2020
4141
42-
# Create Parsons table with entity CSV data
43-
parsons_table = actblue.get_contributions(csv_type='paid_contributions', date_range_start='2020-01-01', date_range_end='2020-02-01')
42+
parsons_table = actblue.get_contributions(
43+
csv_type='paid_contributions',
44+
date_range_start='2020-01-01',
45+
date_range_end='2020-02-01'
46+
)
4447
45-
The above example shows how to create a Parsons table with paid contribution data of your entity for the month of January 2020. In
46-
addition to 'paid_contributions', the other options for ``csv_type`` are 'refunded_contributions' and 'managed_form_contributions'.
47-
48-
***
4948
API
50-
***
49+
====
5150
5251
.. autoclass:: parsons.actblue.actblue.ActBlue
5352
:inherited-members:
5453
:members:
54+
55+
.. _ActBlue CSV API Authentication Documentation: https://secure.actblue.com/docs/csv_api#authentication

docs/action_builder.rst

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,57 @@
1+
##############
12
Action Builder
2-
==============
3+
##############
34

4-
********
55
Overview
6-
********
6+
========
77

8-
`Action Builder <https://actionbuilder.org/>`_ is an online tool for field organizing, with an
8+
`Action Builder <https://www.actionbuilder.org/>`__ is an online tool for field organizing, with an
99
original use-case designed for the Labor context. While it has essentially no built-in outreach
1010
capabilities, it does provide robust record and relationship storage, including the ability to
1111
create custom record types. For more information, see
12-
`Action Builder developer docs <https://www.actionbuilder.org/docs/v1/index.html>`_
13-
14-
.. note::
15-
16-
Custom Fields/Tags
17-
Action Builder custom fields are treated as tags in both the SQL Mirror, and the API. This
18-
means that, with a couple exceptions such as date, values must be created ahead of time to be
19-
applied to a record. Each tag has two layers of taxonomy above it as well, that appear slightly
20-
differently in the SQL Mirror and in the API. In the SQL Mirror, each tag has a
21-
``tag_category``, and each category has a ``tag_group``. In the API, the equivalents are called
22-
``tag_field`` and ``tag_section``, respectively (closer to the naming in the UI). Tags can be
23-
applied on Connections as well as on Entities.
24-
25-
***********
26-
Quick Start
27-
***********
28-
29-
To instantiate a class, you can either pass in the API token as an argument or set the
30-
``ACTION_BUILDER_API_TOKEN`` environmental variable. The subdomain at which you access the UI must
31-
also be provided. If all calls from this object will be to the same Campaign in Action Builder,
32-
an optional campaign argument may also be supplied. If not supplied when instantiating, campaign
12+
`Action Builder developer docs <https://www.actionbuilder.org/docs/v1/index.html>`__
13+
14+
.. admonition:: Custom Fields/Tags
15+
16+
Action Builder custom fields are treated as tags in both the SQL Mirror, and the API. This
17+
means that, with a couple exceptions such as date, values must be created ahead of time to be
18+
applied to a record. Each tag has two layers of taxonomy above it as well, that appear slightly
19+
differently in the SQL Mirror and in the API. In the SQL Mirror, each tag has a
20+
``tag_category``, and each category has a ``tag_group``. In the API, the equivalents are called
21+
``tag_field`` and ``tag_section``, respectively (closer to the naming in the UI). Tags can be
22+
applied on Connections as well as on Entities.
23+
24+
Quickstart
25+
==========
26+
27+
To instantiate the :class:`~parsons.action_builder.action_builder.ActionBuilder` class,
28+
you can either pass in the API token as an argument or set the ``ACTION_BUILDER_API_TOKEN``
29+
environmental variable. The subdomain at which you access the UI must also be provided.
30+
If all calls from this object will be to the same Campaign in Action Builder, an optional
31+
campaign argument may also be supplied. If not supplied when instantiating, campaign
3332
may be passed to individual methods, instead.
3433

3534
.. code-block:: python
35+
:caption: Use API credentials via environmental variables
3636
3737
from parsons import ActionBuilder
38-
39-
# First approach: Use API credentials via environmental variables
4038
bldr = ActionBuilder(subdomain='yourorgsubdomain')
4139
42-
# Second approach: Pass API credentials as arguments
40+
.. code-block:: python
41+
:caption: Pass API credentials as arguments
42+
43+
from parsons import ActionBuilder
4344
bldr = ActionBuilder(api_token='MY_API_TOKEN', subdomain='yourorgsubdomain')
4445
45-
# Third approach: Include campaign argument
46-
bldr = ActionBuilder(
47-
api_token = 'MY_API_TOKEN',
48-
subdomain = 'yourorgsubdomain',
49-
campaign = 'your-desired-campaign-id'
50-
)
46+
.. code-block:: python
47+
:caption: Include campaign argument
48+
49+
from parsons import ActionBuilder
50+
bldr = ActionBuilder(
51+
api_token = 'MY_API_TOKEN',
52+
subdomain = 'yourorgsubdomain',
53+
campaign = 'your-desired-campaign-id',
54+
)
5155
5256
You can then call various endpoints:
5357

@@ -83,10 +87,13 @@ You can then call various endpoints:
8387
tag_data = tag_data
8488
)
8589
86-
***
8790
API
88-
***
91+
====
8992

9093
.. autoclass:: parsons.action_builder.action_builder.ActionBuilder
9194
:inherited-members:
9295
:members:
96+
97+
.. _ActionBuilder Person Endpoint Documentation: https://www.actionbuilder.org/docs/v1/people.html#field-names
98+
.. _ActionBuilder Person Signup Helper Documentation: https://www.actionbuilder.org/docs/v1/person_signup_helper.html#post
99+
.. _ActionBuilder Connection Helper Documentation: https://www.actionbuilder.org/docs/v1/connection_helper.html#post

docs/action_kit.rst

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,78 @@
1+
#########
12
ActionKit
2-
=========
3+
#########
34

4-
********
55
Overview
6-
********
6+
========
77

8-
`ActionKit <https://actionkit.com/>`_ is a platform for advocacy, fundraising, and
8+
`ActionKit <https://actionkit.com/>`__ is a platform for advocacy, fundraising, and
99
get-out-the-vote. This Parsons integration with the
10-
`ActionKit REST API <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html>`_
11-
supports fetching, creating, and updating records of campaigns, events, mailers, orders, survey questions, transactions, and users.
12-
Bulk upload of new users and user updates is also supported.
10+
`ActionKit REST API <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html>`__
11+
supports fetching, creating, and updating records of campaigns, events, mailers, orders, survey questions,
12+
transactions, and users. Bulk upload of new users and user updates is also supported.
1313

14-
.. note::
14+
.. admonition:: Authentication
1515

16-
Authentication
17-
ActionKit requires `HTTP Basic Auth <https://en.wikipedia.org/wiki/Basic_access_authentication>`_.
18-
Clients with an ActionKit account can obtain the domain, username, and password needed
19-
to access the ActionKit API. See the `ActionKit REST API Authentication <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#authentication>`_
20-
documentation for more information on obtaining ActionKit API credentials.
16+
ActionKit requires `HTTP Basic Auth <https://en.wikipedia.org/wiki/Basic_access_authentication>`__.
17+
Clients with an ActionKit account can obtain the domain, username, and password needed to access the ActionKit API.
18+
See the `ActionKit API Authentication Documentation`_ for more information on obtaining ActionKit API credentials.
2119

22-
**********
2320
Quickstart
24-
**********
21+
==========
2522

26-
To instantiate the ActionKit class, you can either store your ActionKit API
23+
To instantiate the :class:`~parsons.action_kit.action_kit.ActionKit` class, you can either store your ActionKit API
2724
domain, username, and password as environmental variables (``ACTION_KIT_DOMAIN``,
2825
``ACTION_KIT_USERNAME``, and ``ACTION_KIT_PASSWORD``, respectively) or pass in your
2926
domain, username, and password as arguments:
3027

3128
.. code-block:: python
29+
:caption: Use API credentials via environmental variables
3230
3331
from parsons import ActionKit
34-
35-
# First approach: Use API credentials via environmental variables
3632
ak = ActionKit()
3733
38-
# Second approach: Pass API credentials as arguments
34+
.. code-block:: python
35+
:caption: Pass API credentials as arguments
36+
37+
from parsons import ActionKit
3938
ak = ActionKit(domain='myorg.actionkit.com', username='my_name', password='1234')
4039
4140
You can then call various endpoints:
4241

4342
.. code-block:: python
43+
:caption: Create a new user
4444
45-
# Create a new user
46-
ak.create_user(email='john@email', first_name='John', last_name='Smith', city='Boston')
45+
ak.create_user(email='john@email', first_name='John', last_name='Smith', city='Boston')
4746
48-
# Fetch user fields
49-
user_fields = ak.get_user(user_id='123')
47+
.. code-block:: python
48+
:caption: Fetch user fields
5049
51-
# Update user fields
52-
ak.update_user(user_id='123', city='New York')
50+
user_fields = ak.get_user(user_id='123')
5351
54-
# Delete user
55-
ak.delete_user(user_id='123')
52+
.. code-block:: python
53+
:caption: Update user fields
54+
55+
ak.update_user(user_id='123', city='New York')
56+
57+
.. code-block:: python
58+
:caption: Delete user
59+
60+
ak.delete_user(user_id='123')
5661
57-
***
5862
API
59-
***
63+
====
6064

6165
.. autoclass:: parsons.action_kit.action_kit.ActionKit
6266
:inherited-members:
6367
:members:
68+
69+
.. _ActionKit API Authentication Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#authentication
70+
.. _ActionKit API Action processing Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/actionprocessing.html
71+
.. _ActionKit API Ordering Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#ordering
72+
.. _ActionKit API Uploads Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/uploads.html
73+
.. _ActionKit API Autocreate_user_fields Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/uploads.html#create-a-multipart-post-request
74+
.. _ActionKit API Users Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/users.html
75+
.. _ActionKit API Mailer Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/mailer.html
76+
.. _ActionKit API Event Search Examples: https://roboticdogs.actionkit.com/docs/manual/api/rest/examples/eventsearch.html
77+
.. _ActionKit Email Blackhole Documentation: https://docs.actionkit.com/docs/manual/guide/mailings_tools.html#blackhole
78+
.. _Django Field Lookup Documentation: https://docs.djangoproject.com/en/3.1/topics/db/queries/#field-lookups

0 commit comments

Comments
 (0)