Skip to content

Commit

Permalink
bump version to 0.14.0 (#279)
Browse files Browse the repository at this point in the history
* bump version to 0.14.0

Also, this commit cleans up a few stray `print` calls.

* add Targets to VAN docs
  • Loading branch information
Eliot Stone authored Jun 18, 2020
1 parent 42977e6 commit 89c9049
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
40 changes: 23 additions & 17 deletions docs/html/_sources/van.rst.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
VAN
==========


********
Overview
********

The VAN module leverages the VAN API and generally follows the naming convention of their API endpoints. It
The VAN module leverages the VAN API and generally follows the naming convention of their API endpoints. It
is recommended that you reference their `API documentation <https://developers.ngpvan.com/van-api#van>`_ to
additional details and information.

.. note::
.. note::
API Keys
- VAN API Keys are required to use this module.
- API Keys are specific to each committee and state, so you might need many.
- Not all API Keys are provisioned for all end points. You should contact VAN if you need access.
- VAN typically offers a cap of free API calls per day. API calls which exceed the free limit
incurr a cost.

.. warning::
.. warning::
VANIDs
VANIDs are unique to each state and instance of the VAN. VANIDs used for the AV VAN **will not** match
those of the SmartVAN.
Expand Down Expand Up @@ -69,7 +69,7 @@ Score: Loading and Updating
===========================

Loading a score a multi-step process. Once a score is set to approved, loading takes place
overnight.
overnight.

.. code-block:: python
Expand All @@ -91,7 +91,7 @@ overnight.
'vanid',
'VANID',
score_slot_id,
'myscore',
'myscore',
email='[email protected]')
Expand All @@ -105,7 +105,7 @@ overnight.
===========================
People: Add Survey Response
===========================
The following workflow can be used to apply survey questions, activist codes
The following workflow can be used to apply survey questions, activist codes
and canvass reponses.

.. code-block:: python
Expand All @@ -115,7 +115,7 @@ and canvass reponses.
# Instatiate Class
van = VAN(db="MyVoters")
sq_id = 311838 # Valid survey question id
sq_id = 311838 # Valid survey question id
sr = 1288926 # Valid survey response id
ct = 36 # Valid contact type id
it_id = 4 # Valid input type id
Expand All @@ -139,7 +139,7 @@ Events are made up of sub objects that need to exist to create an event
in the VAN UI and can be reused for multiple events.
* Locations - An event can have multiple locations. While not required to initially create an
event, these are required to add signups to an event.
* Roles - The various roles that a person can have at an event, such as ``Lead`` or
* Roles - The various roles that a person can have at an event, such as ``Lead`` or
``Canvasser``. These are set as part of the event type.
* Shifts - Each event can have multiple shits in which a person can be assigned. These are
specified in the event creation.
Expand All @@ -153,7 +153,7 @@ Events are made up of sub objects that need to exist to create an event
# Create A Location
loc_id = van.location(name='Big `Ol Canvass', address='100 W Washington', city='Chicago', state='IL')
# Create Event
name = 'GOTV Canvass' # Name of event
short_name = 'GOTVCan' # Short name of event, 12 chars or less
Expand All @@ -163,11 +163,11 @@ Events are made up of sub objects that need to exist to create an event
roles = [259236] # A list of valid role ids
location_ids = [loc_id] # An optional list of locations ids for the event
description = 'CPD Super Volunteers Canvass' # Optional description of 200 chars or less
shifts = [{'name': 'Shift 1',
'start_time': '2018-11-01T15:00:00',
shifts = [{'name': 'Shift 1',
'start_time': '2018-11-01T15:00:00',
'end_time': '2018-11-11T17:00:00'}] # Shifts must fall within event start/end time.
new_event = van.event_create(name, short_name, start_time, end_time, event_type_id, roles,
new_event = van.event_create(name, short_name, start_time, end_time, event_type_id, roles,
location_ids=location_ids, shifts=shifts, description=description)
Expand Down Expand Up @@ -251,7 +251,7 @@ Canvass Responses
***********
Saved Lists
***********
.. note::
.. note::
A saved list must be shared with the user associated with your API key to
be listed.
Expand All @@ -261,7 +261,7 @@ Saved Lists
*******
Folders
*******
.. note::
.. note::
A folder must be shared with the user associated with your API key to
be listed.
Expand All @@ -280,11 +280,11 @@ Scores
Prior to loading a score for the first time, you must contact VAN support to request
a score slot.
.. note::
.. note::
Score Auto Approval
Scores can be automatically set to ``approved`` through the file_load function allowing
you to skip calling the :meth:`file_load` function. To automatically approve scores,
if the average of the scores is within the fault tolerance specified by the user.It
if the average of the scores is within the fault tolerance specified by the user.It
is only available to API keys with permission to automatically approve scores.
Expand All @@ -297,6 +297,12 @@ Score Updates
.. autoclass:: parsons.ngpvan.van.ScoreUpdates
:inherited-members:
*******
Targets
*******
.. autoclass:: parsons.ngpvan.van.Targets
:inherited-members:
*****************
File Loading Jobs
*****************
Expand Down
1 change: 0 additions & 1 deletion parsons/ngpvan/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def get_target_export(self, export_job_id):
if job_status == 'Complete':
csv = json_obj[0]['file']['downloadUrl']
response_csv = requests.get(csv)
print(response_csv)
return Table.from_csv_string(response_csv.text)
elif job_status == 'Pending' or job_status == 'InProcess':
logger.info(f'Target export job is pending or in process for {export_job_id}.')
Expand Down
1 change: 0 additions & 1 deletion parsons/rockthevote/rtv.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def create_registration_report(self, before=None, since=None):
# of the request.
response = self.client.request(report_url, 'post', json=report_parameters)
if response.status_code != requests.codes.ok:
print(response.text)
raise RTVFailure("Couldn't create RTV registrations report")

response_json = response.json()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main():

setup(
name="parsons",
version='0.13.1',
version='0.14.0',
author="The Movement Cooperative",
author_email="[email protected]",
url='https://github.com/movementcoop/parsons',
Expand Down

0 comments on commit 89c9049

Please sign in to comment.