Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Share your code with the
Python world by

creating pip packages
Hannes Hapke

1/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...
Step 3: Create a setup.pyimport os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
...
Step 4: Register your package with PyPI
$ python setup.py register



PyPI asks you to create a new account 

or use your ...
Step 5: Upload your package to PyPI
$ python setup.py sdist upload



Voila, your package is now available to the 

Python...
Use your Github README.md as README
found at 

https://coderwall.com/p/qawuyq
try:
import pypandoc
long_description =
pypa...
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 

`py...
@hanneshapke

hanneshapke.github.io
github.com/hanneshapke 

Portland, 2014

Upcoming SlideShare
Loading in …5
×

Share your code with the Python world by
 creating pip packages

620 views

Published on

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.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Share your code with the Python world by
 creating pip packages

  1. 1. Share your code with the Python world by
 creating pip packages Hannes Hapke
 1/28/2014 @PDXPython
  2. 2. Do you have a great project and want to share it with 
 the Python world?
  3. 3. Example at renooble.com >> Development of PyZillow
  4. 4. Step 1: Share your code in public repo Github creates a license file automatically
  5. 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. 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. 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. 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. 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 = ''
  10. 10. https://wiki.python.org/moin/CheeseShopTutorial

  11. 11. 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`
  12. 12. @hanneshapke
 hanneshapke.github.io github.com/hanneshapke 
 Portland, 2014


×