This presentation is a lightning talk about creating pip packages. In a few steps, you will be guided through the short and non-complex process of how to create pip packages for the Python world.
4. Step 1: Share your code in public repo
Github creates a license file automatically
5. 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
------
...
6. 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='hannes@renooble.com',
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
7. Step 4: Register your package with PyPI
$ python setup.py register
PyPI asks you to create a new account
or use your credentials
8. 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
9. 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 = ''