I'm searching for Python style guidelines

ajaksu ajaksu at gmail.com
Mon Jan 7 21:08:38 EST 2008


On Jan 7, 11:25 am, MartinRineh... at gmail.com wrote:
> There's a lot of dumb stuff out there. "Algorithms should be coded
> efficiently ..." Thanks, I'll keep that in mind.
>
> van Rossum's guidelines tend toward "pick something and stick to it"
> which is OK if you have enough experience to pick something Pythonic.
> I'm a relative newbie, not qualified to pick.
>
> Anything written somewhere that's thorough? Any code body that should
> serve as a reference?

I've done this search before and it was very interesting, doing it
again gave me new results that also seem valuable. Here's most of them
(where PCG = Python Coding Guidelines).

Cogent project PCG
http://jaynes.colorado.edu/PythonGuidelines.html
(also http://jaynes.colorado.edu/PythonIdioms.html)

Freevo Coding Standard
http://doc.freevo.org/CodingStandard

Mercurial Basic Coding Style
http://www.selenic.com/mercurial/wiki/index.cgi/Basic_Coding_Style

PyBlosxom Coding Style Guide
http://pyblosxom.sourceforge.net/blog/static/development#coding

MoinMoin Coding Style
http://moinmoin.wikiwikiweb.de/CodingStyle

Webware Style Guidelines
http://www.webwareforpython.org/Docs/StyleGuidelines.html

NOAA Enhanced Forecaster Tools PCG
http://www-md.fsl.noaa.gov/eft/developer/PythonCodingStandards.html

BioPython Coding Conventions
http://biopython.org/wiki/Contributing#Coding_conventions

Mnet PCG
http://mnet.sourceforge.net/coding_standards.html

Michael Foord's (aka Voidspace) PCG
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_04_01.shtml#e296

SQLObject Coding Style
http://www.sqlobject.org/DeveloperGuide.html#style-guide

WxPython PCG
http://www.wxpython.org/codeguidelines.php

Python coding style guide for Mailman
http://barry.warsaw.us/software/STYLEGUIDE.txt

VoiceCode PCG
http://voicecode.iit.nrc.ca/VoiceCode/uploads/codingGuidelines.html

Bazaar Coding Stile Guidelines
http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/HACKING.html#coding-style-guidelines

IPython Developer Guidelines
http://ipython.scipy.org/moin/Developer_Zone/Developer_Guidelines

OSAF Chandler PCG
http://chandlerproject.org/Projects/ChandlerCodingStyleGuidelines
(along with http://chandlerproject.org/Projects/ChandlerEpydocStyleGuide)

Twisted Coding Standard
http://twistedmatrix.com/trac/browser/trunk/doc/development/policy/coding-standard.xhtml?format=raw

PyPy RPython and CPython Coding Guidelines
http://codespeak.net/pypy/dist/pypy/doc/coding-guide.html

Django PCG (and general contribution recommendations)
http://www.djangoproject.com/documentation/contributing/#coding-style

Docutils PCG
http://docutils.sourceforge.net/docs/dev/policies.html#python-coding-conventions

Trac Coding Style
http://trac.edgewall.org/wiki/TracDev/CodingStyle

OLPC PCG
http://wiki.laptop.org/go/Python_Style_Guide

Skeletonz Coding and Naming Conventions
http://orangoo.com/skeletonz/Developer_guide/Coding_convention/
http://orangoo.com/skeletonz/Developer_guide/Naming_convention/

CherryPy Code Conventions
http://www.cherrypy.org/wiki/CodeConventions

More generic but still good (or great) insights:
Software Carpentry on style http://www.swc.scipy.org/lec/style.html
Zope's Coding Style http://wiki.zope.org/zope3/CodingStyle
The docstrings PEP http://www.python.org/dev/peps/pep-0257/



The NiceStyle Triad®:
Pyflakes http://divmod.org/trac/wiki/DivmodPyflakes
PyChecker http://pychecker.sourceforge.net/
Pylint http://www.logilab.org/857



Do you think this could be a valuable addition to the Python wiki?

HTH,
Daniel



More information about the Python-list mailing list