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
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
31
The Road to a Masterless Multi-node Distributed System in Elixir
kirang89
5
680
Building a Tic Tac Toe AI in Python
kirang89
0
380
A Gentle Introduction to Generators and Coroutines
kirang89
1
240
Leverage PyCon India to help grow the Python community
kirang89
0
79
Lets learn Python !
kirang89
0
93
Python Month
kirang89
0
56
Why learn Python ?
kirang89
0
110
Other Decks in Technology
See All in Technology
dipにおけるSRE変革の軌跡
dip_tech
PRO
1
260
AWS DDoS攻撃防御の最前線
ryutakondo
1
150
React Server ComponentsでAPI不要の開発体験
polidog
PRO
0
210
リモートワークで心掛けていること 〜AI活用編〜
naoki85
0
140
Strands Agents & Bedrock AgentCoreを1分でおさらい
minorun365
PRO
7
310
UDDのススメ - 拡張版 -
maguroalternative
1
440
Rubyの国のPerlMonger
anatofuz
3
730
AIに目を奪われすぎて、周りの困っている人間が見えなくなっていませんか?
cap120
1
550
[OCI Technical Deep Dive] OracleのAI戦略(2025年8月5日開催)
oracle4engineer
PRO
1
140
ロールが細分化された組織でSREと協働するインフラエンジニアは何をするか? / SRE Lounge #18
kossykinto
0
210
AI関数が早くなったので試してみよう
kumakura
0
280
Kiroから考える AIコーディングツールの潮流
oikon48
4
680
Featured
See All Featured
Being A Developer After 40
akosma
90
590k
Embracing the Ebb and Flow
colly
86
4.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
How to Ace a Technical Interview
jacobian
278
23k
Adopting Sorbet at Scale
ufuk
77
9.5k
The Cult of Friendly URLs
andyhume
79
6.5k
Practical Orchestrator
shlominoach
190
11k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
440
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Docker and Python
trallard
45
3.5k
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