Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
420
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
36
The Road to a Masterless Multi-node Distributed System in Elixir
kirang89
5
700
Building a Tic Tac Toe AI in Python
kirang89
0
390
A Gentle Introduction to Generators and Coroutines
kirang89
1
260
Leverage PyCon India to help grow the Python community
kirang89
0
86
Lets learn Python !
kirang89
0
110
Python Month
kirang89
0
63
Why learn Python ?
kirang89
0
120
Other Decks in Technology
See All in Technology
Playwright x GitHub Actionsで実現する「レビューしやすい」E2Eテストレポート
kinosuke01
0
410
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
5
1.4k
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
590
チーリンについて
hirotomotaguchi
3
970
ガバメントクラウド利用システムのライフサイクルについて
techniczna
0
180
技術以外の世界に『越境』しエンジニアとして進化を遂げる 〜Kotlinへの愛とDevHRとしての挑戦を添えて〜
subroh0508
1
390
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
530
形式手法特論:CEGAR を用いたモデル検査の状態空間削減 #kernelvm / Kernel VM Study Hokuriku Part 8
ytaka23
2
440
AWS CLIの新しい認証情報設定方法aws loginコマンドの実態
wkm2
5
560
pmconf2025 - データを活用し「価値」へ繋げる
glorypulse
0
700
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
180
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
130
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Typedesign – Prime Four
hannesfritz
42
2.9k
Building an army of robots
kneath
306
46k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
[SF Ruby Conf 2025] Rails X
palkan
0
490
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
69k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Optimizing for Happiness
mojombo
379
70k
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