Share your code with the Python world by
creating pip packages
Hannes Hapke1/28/2014 @PDXPython
Do you have a great project and want to share it with
the Python world?
Example at renooble.com
>> Development of PyZillow
Step 1: Share your code in public repo
Github creates a license file automatically
Step 2: Create helpful support files
• Create your tests
• Create __version__.py VERSION = '0.2.2'
• Create README.txt or README.md ================== pyzillow 0.2.2 ==================
README ------ ...
Step 3: Create a setup.pyimport os
try: from setuptools import setup except ImportError: from distutils.core import setup
from __version__ import VERSION
setup( name='pyzillow', version=VERSION, author='Hannes Hapke', author_email='[email protected]', url='https://github.com/hanneshapke/pyzillow', download_url='https://github.com/hanneshapke/pyzillow/archive/master.zip', description='Python interface for Zillow\'s API. Currently supporting GetDeepSearchResults and GetUpdatedPropertyDetails API.', long_description=open(os.path.join(os.path.dirname(__file__), 'README.txt'), 'r').read(), py_modules=['pyzillow', 'pyzillowerrors', '__version__'], provides=['pyzillow'], requires=['requests'], install_requires=['requests >= 2.2.0'], classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Financial and Insurance Industry', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'License :: OSI Approved :: MIT License', 'Topic :: Internet', 'Topic :: Internet :: WWW/HTTP', ], keywords='zillow real estate rental xml api address zipcode', license='MIT', )
https://pypi.python.org/pypi?:action=list_classifiers
Step 4: Register your package with PyPI
$ python setup.py register PyPI asks you to create a new account or use your credentials
Step 5: Upload your package to PyPI
$ python setup.py sdist upload Voila, your package is now available to the Python world!
$ pip install YOUR_PACKAGE
Use your Github README.md as README
found at https://coderwall.com/p/qawuyq
try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except (IOError, ImportError): long_description = ''
https://wiki.python.org/moin/CheeseShopTutorial
Check out Python Wheel
Why? PEP 376 compliant install
http://pythonwheels.com https://pypi.python.org/pypi/wheel
Run `python setup.py sdist bdist_wheel upload`
@hanneshapkehanneshapke.github.io
github.com/hanneshapke
Portland, 2014