Skip to content

Commit

Permalink
New release with python 3.4/ 3.5 support (#6)
Browse files Browse the repository at this point in the history
* update requirements

* json parsing fix for python 3.4/3.5 and updated tests (#5)
  • Loading branch information
ndanielsen committed Feb 14, 2018
1 parent 70eec10 commit e715476
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
py-opensecrets changelog
==========================

0.2.4
-----
* Compatibility fixes for python 3.4, 3.5 by @ndanielsen

0.2.3
-----
* Fork and restructure package by @ndanielsen

0.2.X
-----
* Doc strings, tests and added Independent Expenditures by @robrem

0.1.X
-----
* Core concept, code and magic sunbeams by James Turk (jturk@sunlightfoundation.com)
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Py-OpenSecrets API

An unofficial Python client for the `Center for Responsive Politics API <https://www.opensecrets.org/resources/create/apis.php>` at OpenSecrets.org.

Support for python 2.7, 3.4, 3.5, 3.6

Access campaign contribution and personal financial data for US congressional members.

You will need a `Center for Responsive Politics API key <https://www.opensecrets.org/api/admin/index.php?function=signup>`.
Expand Down
2 changes: 1 addition & 1 deletion opensecrets/crpapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fetch(self, method, **kwargs):
headers = {'User-Agent' : 'Mozilla/5.0'}

resp, content = self.http.request(url, headers=headers)
content = json.loads(content)
content = json.loads(content.decode('utf-8'))

if not resp.get('status') == '200':
raise CRPError(method, resp, url)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_requires(path=REQUIRE_PATH):
yield line

setup(name="py-opensecrets",
version="0.2.3",
version="0.2.4",
description="Libraries for interacting with the Opensecrets API",
author="Nathan Danielsen <nathan.danielsen@gmail.com>",
author_email = "nathan.danielsen@gmail.com",
Expand All @@ -51,7 +51,8 @@ def get_requires(path=REQUIRE_PATH):
'Programming Language :: Python',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5"
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],
install_requires=list(get_requires()),
)
4 changes: 2 additions & 2 deletions tests/test_live_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Test suite for the CRP API client.
Authored by:
Authored by and big shout out to:
https://github.com/robrem/opensecrets-crpapi
"""

Expand Down Expand Up @@ -36,7 +36,7 @@ def tearDown(self):
def check_response(self, result, url, parse=''):
headers = {'User-Agent' : 'Mozilla/5.0'}
response = self.http.request(url, headers=headers)[1]
response = json.loads(response)
response = json.loads(response.decode('utf-8'))

if callable(parse):
response = parse(response)
Expand Down

0 comments on commit e715476

Please sign in to comment.