Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building an open source Python application, the...
Search
Kiran
October 26, 2013
Technology
0
400
Building an open source Python application, the right way
Overview of conventions/best practices to follow when writing an open source Python application
Kiran
October 26, 2013
Tweet
Share
More Decks by Kiran
See All by Kiran
Building Terrariums
kirang89
0
21
The Road to a Masterless Multi-node Distributed System in Elixir
kirang89
5
670
Building a Tic Tac Toe AI in Python
kirang89
0
370
A Gentle Introduction to Generators and Coroutines
kirang89
1
230
Leverage PyCon India to help grow the Python community
kirang89
0
74
Lets learn Python !
kirang89
0
89
Python Month
kirang89
0
51
Why learn Python ?
kirang89
0
110
Other Decks in Technology
See All in Technology
ホワイトボードチャレンジ 説明&実行資料
ichimichi
0
130
7日間でハッキングをはじめる本をはじめてみませんか?_ITエンジニア本大賞2025
nomizone
2
1.9k
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
250
エンジニアが加速させるプロダクトディスカバリー 〜最速で価値ある機能を見つける方法〜 / product discovery accelerated by engineers
rince
4
400
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
200
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
210
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
13
5.2k
現場で役立つAPIデザイン
nagix
34
12k
明日からできる!技術的負債の返済を加速するための実践ガイド~『ホットペッパービューティー』の事例をもとに~
recruitengineers
PRO
3
420
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.4k
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
6.3k
Active Directory攻防
cryptopeg
PRO
1
430
Featured
See All Featured
BBQ
matthewcrist
87
9.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Practical Orchestrator
shlominoach
186
10k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Documentation Writing (for coders)
carmenintech
67
4.6k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
We Have a Design System, Now What?
morganepeng
51
7.4k
Transcript
Building open source the Python application right way an
Hi.
I’m Kiran. Hacker Programmer Open Source enthusiast Computer Science fanboy
Currently, having an affair with Python
Why follow Conventions Guidelines Best Practices
Your code is Open Source !
What does that mean You ask ?
Code available to People will try to help start using
it everyone People will(might)
So, what do I do ?
Make it easier for people to use your application
How ?
Let’s start with basic project structure
None
Let’s make it simpler
Documentation Tests Application Dependency Management Setup Task Execution Extras Publish
Application
Write good code. http://www.python.org/dev/peps/pep-0008/
Don’t bloat your code with Use them when required classes
to architect your application modules Use
Tests
“Code not tested is broken by design” - Jacob Kaplan
Moss
Lots of ways to your application Test
Start with simple unit tests
unittest Nose py.test Most commonly used
Documentation
For small projects Code is the documentation http://www.python.org/dev/peps/pep-0257/
Sadly This is not scalable
Use Sphinx http://sphinx-doc.org/
HTML EPUB PDF Man Pages LaTex Automatic Syntax Highlighting Plain
Text Theming Support Internationalisation
None
Dependency Management
Project Dependencies requirements.txt
pip install -r requirements.txt then
None
Setup
Pro Tip: Use Virtualenv to setup your environment
Why ? Test with different Python versions No unnecessary namespace
pollution Different environments and settings per project Install dependencies inside environment
Publish
setup.py contains the necessary information required for it’s installation Every
project’s
Packages and uploads your application to Python Package Index a.k.a
PyPI
setup( name='project name', version=myapp.__version__, description='project description here', license=open("LICENSE").read(), author='author', author_email='email',
url='project url', packages=['myapp'], include_package_data=True, classifiers=( 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', ), test_suite='tests', )
Register at PyPI python setup.py register Package and Upload application
python setup.py sdist upload
Install application on any platform pip install myapp
None
Task Execution
Makefile Use a to automate multiple tasks and commands http://mrbook.org/tutorials/make/
Extras (a.k.a enhancements)
AUTHORS CHANGELOG CONTRIBUTING
is License very important for open source projects http://www.tldrlegal.com/
Recap
RECAP Documentation Tests Application Dependency Management Setup Task Execution Extras
Publish
Questions ?
Thank you ! @kirang89 http://kirang.in