Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
67
Why learn Python ?
kirang89
0
120
Other Decks in Technology
See All in Technology
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.4k
Connection-based OAuthから学ぶOAuth for AI Agents
flatt_security
0
350
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
880
LayerX QA Night#1
koyaman2
0
250
2025年のデザインシステムとAI 活用を振り返る
leveragestech
0
170
NIKKEI Tech Talk #41: セキュア・バイ・デザインからクラウド管理を考える
sekido
PRO
0
200
Introduce marp-ai-slide-generator
itarutomy
0
110
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
650
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.6k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
2
190
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
230
[Neurogica] 採用ポジション/ Recruitment Position
neurogica
1
110
Featured
See All Featured
Music & Morning Musume
bryan
46
7k
Navigating Team Friction
lara
191
16k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
69
The Cult of Friendly URLs
andyhume
79
6.7k
How to Talk to Developers About Accessibility
jct
1
85
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
51
43k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Documentation Writing (for coders)
carmenintech
77
5.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
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