Skip to content

Commit

Permalink
commit coinciding with bug fixes for release 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aschleg committed Aug 8, 2019
1 parent 67c340e commit b36c448
Show file tree
Hide file tree
Showing 25 changed files with 3,247 additions and 3,379 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## Version 2.0.2

Minor bug fix release with following:
- `breeds()` method now correctly returns data when a single animal type is supplied.
- `animals()` method now properly displays the correct error message when the `distance` parameter is
0 <= distance <= 500.

## Version 2.0.1

- Fixes the `animals()` and `organizations()` method to return all matching search results when the `pages` parameter
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -146,6 +146,13 @@ are currently being updated to reflect the new version of `petpy`.**
* Although not strictly required to use `petpy`, the [pandas](https://pandas.pydata.org/) library is needed
for returning the results as a DataFrame.

## About [Petfinder.com](https://www.petfinder.com)

Petfinder.com is one of the largest online, searchable databases for finding a new pet online. The database contains
information on over 14,000 animal shelters and adoption organizations across North America with nearly 300,000 animals
available for adoption. Not only does this make it a great resource for those looking to adopt their new best friend,
but the data and information provided in Petfinder's database makes it ideal for analysis.

## License

MIT
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/versions.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ac03f6a75fb2bca48e096cef5c4abd3a
config: 1c0b5de14d3417496c8d3a16acddf901
tags: 645f666f9bcd5a90fca523b33c5a78b7
9 changes: 9 additions & 0 deletions docs/build/html/_sources/versions.rst.txt
Expand Up @@ -5,6 +5,15 @@ Version History

Changelog and version changes made with each release.


Version 2.0.2
-------------

Minor bug fix release with following:
- :code:`breeds()` method now correctly returns data when a single animal type is supplied.
- :code:`animals()` method now properly displays the correct error message when the :code:`distance` parameter is
0 <= distance <= 500.

Version 2.0.1
-------------

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '2.0.1',
VERSION: '2.0.2',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/api.html
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>API Reference &mdash; petpy 2.0.1 documentation</title>
<title>API Reference &mdash; petpy 2.0.2 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/genindex.html
Expand Up @@ -9,7 +9,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Index &mdash; petpy 2.0.1 documentation</title>
<title>Index &mdash; petpy 2.0.2 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/index.html
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Petpy - Python Wrapper of the Petfinder API &mdash; petpy 2.0.1 documentation</title>
<title>Petpy - Python Wrapper of the Petfinder API &mdash; petpy 2.0.2 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/parameters.html
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>&lt;no title&gt; &mdash; petpy 2.0.1 documentation</title>
<title>&lt;no title&gt; &mdash; petpy 2.0.2 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/search.html
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Search &mdash; petpy 2.0.1 documentation</title>
<title>Search &mdash; petpy 2.0.2 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion docs/build/html/versions.html
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Version History &mdash; petpy 2.0.1 documentation</title>
<title>Version History &mdash; petpy 2.0.2 documentation</title>



Expand Down Expand Up @@ -86,6 +86,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="api.html">API Reference</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Version History</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#version-2-0-2">Version 2.0.2</a></li>
<li class="toctree-l2"><a class="reference internal" href="#version-2-0-1">Version 2.0.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="#version-2-0-0">Version 2.0.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="#version-1-8-2">Version 1.8.2</a></li>
Expand Down Expand Up @@ -174,6 +175,18 @@
<div class="section" id="version-history">
<span id="versions"></span><h1>Version History<a class="headerlink" href="#version-history" title="Permalink to this headline"></a></h1>
<p>Changelog and version changes made with each release.</p>
<div class="section" id="version-2-0-2">
<h2>Version 2.0.2<a class="headerlink" href="#version-2-0-2" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt>Minor bug fix release with following:</dt>
<dd><ul class="first last simple">
<li><code class="code docutils literal notranslate"><span class="pre">breeds()</span></code> method now correctly returns data when a single animal type is supplied.</li>
<li><code class="code docutils literal notranslate"><span class="pre">animals()</span></code> method now properly displays the correct error message when the <code class="code docutils literal notranslate"><span class="pre">distance</span></code> parameter is
0 &lt;= distance &lt;= 500.</li>
</ul>
</dd>
</dl>
</div>
<div class="section" id="version-2-0-1">
<h2>Version 2.0.1<a class="headerlink" href="#version-2-0-1" title="Permalink to this headline"></a></h2>
<ul class="simple">
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -66,7 +66,7 @@
# The short X.Y version.
version = '2.0'
# The full version, including alpha/beta/rc tags.
release = '2.0.1'
release = '2.0.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
9 changes: 9 additions & 0 deletions docs/source/versions.rst
Expand Up @@ -5,6 +5,15 @@ Version History

Changelog and version changes made with each release.


Version 2.0.2
-------------

Minor bug fix release with following:
- :code:`breeds()` method now correctly returns data when a single animal type is supplied.
- :code:`animals()` method now properly displays the correct error message when the :code:`distance` parameter is
0 <= distance <= 500.

Version 2.0.1
-------------

Expand Down
4 changes: 2 additions & 2 deletions notebooks/01-Introduction to petpy.ipynb
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The following post introduces the `petpy` package and its methods for interacting with the Petfinder API. The goal of the `petpy` library is to enable other users to interact with the rich data available in the Petfinder database with an easy-to-use and straightforward Python interface. Methods for coercing the resulting JSON data into [pandas DataFrame](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html) are also available to help facilitate users who are more interested in using the API for data analysis. More information on the Petfinder API itself can be found on the [API documentation page](https://www.petfinder.com/developers/api-docs#methods)."
"The following post introduces the `petpy` package and its methods for interacting with the Petfinder API. The goal of the `petpy` library is to enable other users to interact with the rich data available in the Petfinder database with an easy-to-use and straightforward Python interface. Methods for coercing the resulting JSON data into [pandas DataFrame](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html) are also available to help facilitate users who are more interested in using the API for data analysis. More information on the Petfinder API itself can be found on the [API documentation page](https://www.petfinder.com/developers/v2/docs/)."
]
},
{
Expand Down Expand Up @@ -253,7 +253,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Listed breeds of the animal types found above in the Petfinder database can also be extracted using the `breeds()` method."
"Listed breeds for each animal type can be extracted using the `breeds()` method."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions petpy/api.py
Expand Up @@ -254,7 +254,6 @@ def breeds(self, types=None, return_df=False, raw_results=False):
})

result = r.json()
result['type'] = result.pop('types')

else:
raise TypeError('types parameter must be either None, str, list or tuple')
Expand Down Expand Up @@ -550,6 +549,7 @@ def organizations(self, organization_id=None, name=None, location=None, distance
if pages is None:
params['limit'] = 100
params['page'] = 1

r = requests.get(url,
headers={
'Authorization': 'Bearer ' + self.auth
Expand Down Expand Up @@ -835,7 +835,7 @@ def _check_parameters(animal_types=None, size=None, gender=None, age=None, coat=
sort_list=_sort)

if distance is not None:
if 0 > int(distance) > 500:
if not 0 >= int(distance) >= 500:
incorrect_values['distance'] = "distance cannot be greater than 500 or less than 0."

if limit is not None:
Expand Down

0 comments on commit b36c448

Please sign in to comment.