From 21cbd9e9b03e856ec5544b0f88b32135dee65850 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Thu, 8 Jun 2017 12:55:05 +0300 Subject: [PATCH] Prepared for publishing into PyPi --- .gitignore | 5 ++++ README.md | 12 -------- README.rst | 21 ++++++++++++++ polytiles/__init__.py | 1 + polytiles.py => polytiles/polytiles.py | 0 setup.py | 38 ++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 12 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 README.rst create mode 100644 polytiles/__init__.py rename polytiles.py => polytiles/polytiles.py (100%) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a99b67 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +build/ +__pycache__/ +*.pyc +dist/ +*.egg* diff --git a/README.md b/README.md deleted file mode 100644 index b001396..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# polytiles.py - -A script to get tiles from mapnik. Area can be defined by bbox, polygon or an OSM polygon; tiles can be served in image files or mbtiles. Run the script without parameters to see command line help. - -## Requirements - -Mapnik and `python-shapely` package. Optional dependencies are `python-psycopg2` and `sqlite3`. - -## Author and license - -Written by Ilya Zverev, based on [generate\_tiles\_multiprocess.py](http://svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles_multiprocess.py), licensed WTFPL. - diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..fed3aff --- /dev/null +++ b/README.rst @@ -0,0 +1,21 @@ +PolyTiles +========= + +A script to get tiles from mapnik. Area can be defined by bbox, polygon +or an OSM polygon; tiles can be served in image files or mbtiles. Run +the script without parameters to see command line help. + +Requirements +------------ + +Mapnik and ``python-shapely`` package. Optional dependencies are +``python-psycopg2`` and ``sqlite3``. + +Author and license +------------------ + +Written by Ilya Zverev, based on `generate\_tiles\_multiprocess.py`_, +licensed WTFPL. + +.. _generate\_tiles\_multiprocess.py: http://svn.openstreetmap.org/applications/rendering/mapnik/generate_tiles_multiprocess.py + diff --git a/polytiles/__init__.py b/polytiles/__init__.py new file mode 100644 index 0000000..c37aac8 --- /dev/null +++ b/polytiles/__init__.py @@ -0,0 +1 @@ +from .polytiles import main diff --git a/polytiles.py b/polytiles/polytiles.py similarity index 100% rename from polytiles.py rename to polytiles/polytiles.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2563d0f --- /dev/null +++ b/setup.py @@ -0,0 +1,38 @@ +from setuptools import setup +from os import path + +try: + import mapnik +except ImportError: + raise ImportError('Mapnik library and its python bindings are required to install Polytiles.') + +here = path.abspath(path.dirname(__file__)) + +setup( + name='polytiles', + version='1.0.0', + author='Ilya Zverev', + author_email='ilya@zverev.info', + packages=['polytiles'], + install_requires=[ + 'mapnik', + 'shapely', + ], + url='https://github.com/zverik/polytiles', + license='WTFPL', + description='A script to render tiles for an area with mapnik', + long_description=open(path.join(here, 'README.rst')).read(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Information Technology', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Topic :: Utilities', + 'License :: Public Domain', + 'Programming Language :: Python :: 2', + ], + entry_points={ + 'console_scripts': ['polytiles = polytiles:main'] + }, +)