diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..00d38ad --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,30 @@ +polipoly is licensed under a BSD-style license +---------------------------------------------- + +Copyright (c) 2007, Sunlight Labs + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Sunlight Labs nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..08bcea4 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include *.txt +recursive-include examples *.txt *.py diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..1050856 --- /dev/null +++ b/README.txt @@ -0,0 +1,36 @@ +polipoly - Python library for dealing with political boundaries. Enables + programatic conversion of latitudes/longitudes to political districts. + +http://polipoly.googlecode.com/ + +polipoly is a project of Sunlight Labs (C) 2007 see LICENSE.txt for details + +Files Included +============== +polipoly.py - The polipoly library +examples/address_to_district.py - Implementation of a webservice for an address + to district webservice. This is based on the code that runs + http://api.sunlightlabs.com/places.getDistrictFromAddress +examples/csvtest.py - Example of batch processing addresses from a csv file. + + +Requirements +============ + +python >= 2.4 +pyShapeLib 0.3 (see http://code.google.com/p/polipoly/wiki/ShapeLib) + + +Installation +============ +To install run + + python setup.py install + +which will install the bindings into python's site-packages directory. + +Documentation +============= +For documentation view the source itself and the examples included in the +examples/ subdirectory. + diff --git a/polipoly.py b/polipoly.py index f301a43..7dc24ef 100644 --- a/polipoly.py +++ b/polipoly.py @@ -1,4 +1,4 @@ -"""Python library for dealing with political boundaries +"""Python library for working with political boundaries Political boundaries are defined by one or more polygons and obtained from census.gov shapefiles. Census boundary shapefiles are available at @@ -8,6 +8,11 @@ At the moment this library has only been used with State and Congressional District boundaries. """ +__author__ = "James Turk (james.p.turk@gmail.com)" +__version__ = "0.1.0" +__copyright__ = "Copyright (c) 2007 Sunlight Labs" +__license__ = "BSD" + import urllib from shapelib import ShapeFile from dbflib import DBFFile diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..181b369 --- /dev/null +++ b/setup.py @@ -0,0 +1,26 @@ +from distutils.core import setup +from polipoly import __version__,__license__ + +# don't worry about classifiers hack for Python 2.2, polipoly requires >= 2.4 + +setup(name="polipoly", + version=__version__, + py_modules=["polipoly"], + description="Library for working with political boundary polygons.", + author="James Turk", + author_email = "james.p.turk@gmail.com", + license=__license__, + url="http://code.google.com/p/polipoly/", + long_description="""polipoly is a library for working with political boundary polygons such as those obtained from census shapefiles.""", + platforms=["any"], + classifiers=["Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: GIS", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + ) +