From be228efe3ec6ad6b7a0e13b2836e5da1a826cb15 Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Sun, 12 Feb 2017 20:59:10 -0500 Subject: [PATCH 1/3] Cleanup for release. --- README.md | 69 ++++++++++++++++---------- docs/index.rst | 2 +- docs/ziptastic.rst | 17 ++----- requirements.txt | 17 ------- setup.cfg | 2 + setup.py | 45 +++++++++++++++++ {ziptastic => tests}/tests.py | 4 +- ziptastic/ziptastic.py => ziptastic.py | 0 ziptastic/__init__.py | 0 9 files changed, 97 insertions(+), 59 deletions(-) create mode 100644 setup.cfg create mode 100644 setup.py rename {ziptastic => tests}/tests.py (96%) rename ziptastic/ziptastic.py => ziptastic.py (100%) delete mode 100644 ziptastic/__init__.py diff --git a/README.md b/README.md index e014da6..0f2648d 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,53 @@ -# Official Ziptastic Python Library -Official python library for GetZiptastic.com +Official Ziptastic Python Library +================================= -[![Documentation Status](https://readthedocs.org/projects/ziptastic-python/badge/?version=latest)](http://ziptastic-python.readthedocs.org/en/latest/?badge=latest) -[![CircleCI Status](https://circleci.com/gh/Ziptastic/ziptastic-python.png)](https://circleci.com/gh/Ziptastic/ziptastic-python) -[![Travis Status](https://travis-ci.org/Ziptastic/ziptastic-python.svg?branch=master)](https://travis-ci.org/Ziptastic/ziptastic-python) -[![Coverage Status](https://codecov.io/gh/ziptastic/ziptastic-python/branch/master/graph/badge.svg)](https://codecov.io/gh/ziptastic/ziptastic-python/branch/master) -## Installation - pip install ziptastic-python (coming soon) +Python library for `GetZiptastic.com `_ +--------------------------------------------------------------------- +.. image:: https://readthedocs.org/projects/ziptastic-python/badge/?version=latest + :target: http://ziptastic-python.readthedocs.org/en/latest/?badge=latest -## Testing -`$ nosetests` +.. image:: https://codecov.io/gh/ziptastic/ziptastic-python/branch/master/graph/badge.svg + :target: https://codecov.io/gh/ziptastic/ziptastic-python/branch/master -With coverage +.. image:: https://travis-ci.org/Ziptastic/ziptastic-python.svg?branch=master + :target: https://travis-ci.org/Ziptastic/ziptastic-python -`$ nosetests --with-coverage --cover-package=ziptastic` +.. image:: https://circleci.com/gh/Ziptastic/ziptastic-python.png + :target: https://circleci.com/gh/Ziptastic/ziptastic-python +Installation +------------ -## Usage -### Forward geocoding -```python -from ziptastic import Ziptastic + >>> pip install ziptastic-python -# Set your API key. (Available at https://www.getziptastic.com/dashboard) -api = Ziptastic('') -result = api.get_from_postal_code('48867') -``` -### Reverse geocoding -```python -from ziptastic import Ziptastic +Running tests +------------- -# Set API key. -api = Ziptastic('') -result = api.get_from_coordinates('42.9934', '-84.1595') -``` + $ nosetests + +Running tests with coverage +--------------------------- + + $ nosetests --with-coverage --cover-package=ziptastic + + +Usage +===== + +Forward geocoding +----------------- + + >>> from ziptastic import Ziptastic + >>> api = Ziptastic('') + >>> result = api.get_from_postal_code('48867') + + +Reverse geocoding +----------------- + + >>> from ziptastic import Ziptastic + >>> api = Ziptastic('') + >>> result = api.get_from_coordinates('42.9934', '-84.1595') diff --git a/docs/index.rst b/docs/index.rst index 57b6c64..314e601 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. ziptastic documentation master file, created by +.. Ziptastic documentation master file, created by sphinx-quickstart on Sat Oct 10 22:38:11 2015. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/docs/ziptastic.rst b/docs/ziptastic.rst index 3cfdb5f..18b0bd2 100644 --- a/docs/ziptastic.rst +++ b/docs/ziptastic.rst @@ -1,19 +1,10 @@ Ziptastic Python package -================= +======================== -ziptastic.ziptastic module --------------------------- +ziptastic module +---------------- -.. automodule:: ziptastic.ziptastic - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: ziptastic.ziptastic +.. automodule:: ziptastic :members: :undoc-members: :show-inheritance: diff --git a/requirements.txt b/requirements.txt index f3d0870..1f253b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1 @@ -alabaster==0.7.6 -Babel==2.1.1 -coverage==4.0.1 -docutils==0.12 -funcsigs==0.4 -Jinja2==2.8 -MarkupSafe==0.23 -nose==1.3.7 -nose2==0.5.0 -pbr==1.8.1 -Pygments==2.0.2 -pytz==2015.6 requests==2.8.0 -requests-mock==0.6.0 -six==1.10.0 -snowballstemmer==1.2.0 -Sphinx==1.3.1 -sphinx-rtd-theme==0.1.9 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3c6e79c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3f97cb4 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +from setuptools import setup, find_packages +from codecs import open +from os import path + + +here = path.abspath(path.dirname(__file__)) + +with open(path.join(here, 'README.md'), encoding='utf-8') as f: + long_description = f.read() + +setup( + name='ziptastic-python', + version='1.0.0b1', + + description='Official GetZiptastic.com library.', + long_description=long_description, + url='https://github.com/ziptastic/ziptastic-python', + + author='Thomas Schultz', + author_email='tom@getziptastic.com', + license='MIT', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Scientific/Engineering :: GIS', + 'Topic :: Software Development :: Libraries', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], + + keywords='ziptastic getziptastic geocoding forward reverse geocode GIS', + packages=find_packages(exclude=['docs', 'tests']), + install_requires=['requests'], + extras_require={ + 'dev': ['check-manifest'], + 'test': ['coverage', 'requests-mock'], + }, +) diff --git a/ziptastic/tests.py b/tests/tests.py similarity index 96% rename from ziptastic/tests.py rename to tests/tests.py index f0ad1a1..c83a341 100644 --- a/ziptastic/tests.py +++ b/tests/tests.py @@ -3,7 +3,9 @@ from nose.tools import eq_ from json import loads -from .ziptastic import Ziptastic, ZiptasticAPIKeyRequiredException +from ziptastic import Ziptastic +from ziptastic import ZiptasticAPIKeyRequiredException + compare_v3_json = """[{"city": "Owosso", "geohash": "dpshsfsytw8k", "country": "US", "county": "Shiawassee", "state": "Michigan", diff --git a/ziptastic/ziptastic.py b/ziptastic.py similarity index 100% rename from ziptastic/ziptastic.py rename to ziptastic.py diff --git a/ziptastic/__init__.py b/ziptastic/__init__.py deleted file mode 100644 index e69de29..0000000 From 13ab1b9eb03fadcba36ac17f405213b7704d8733 Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Sun, 12 Feb 2017 21:02:26 -0500 Subject: [PATCH 2/3] Move README.md to README.rst. --- README.md => README.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => README.rst (100%) diff --git a/README.md b/README.rst similarity index 100% rename from README.md rename to README.rst From 15bdd1cb0523579d75b10269ebdbbdd3e2f8a7ac Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Sun, 12 Feb 2017 21:03:20 -0500 Subject: [PATCH 3/3] Update .travis after cleaned up requirement.txt. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89e7c0e..018f485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,10 @@ python: - "3.5" # command to install dependencies -install: +install: - pip install -r requirements.txt + - pip install requests_mock + - pip install coverage - pip install codecov # command to run tests script: nosetests --with-coverage --cover-package=ziptastic