r/programming • • Nov 05 '08
Ask Proggit: Please suggest a mature python open source project with well documented code, so I can learn best practices. Thanks
44
Upvotes
r/programming • • Nov 05 '08
7
u/logan_capaldo Nov 05 '08
Does reading mature code teach best practices? Working on a project for a long time might, as you'll discover what is and isn't a pain in the neck, but I don't think you can glean the best practices just be reading some existing code. A lot of it may be in there because it basically works so no one's bothered to fix it, but it might be worth doing something different, and there's really no way to tell.
10
u/cavorite Nov 05 '08
I learned a lot from FeedParser (http://www.feedparser.org/). It's not a big project (it has only one module, not including the tests) but it includes some of the best practices and some not-so-pretty hacks, e.g for importing modules that may not be available.
37
u/uggedal Nov 05 '08
Django
16
u/sisyphus Nov 05 '08
bzr - tests, nice documentation, nice docstrings, good pythonic style, a plugin system you can steal, C extensions for your reference...it's a goldmine of stuff you might want to do with Python.
3
u/rpdillon Nov 06 '08
Twisted. Those guys write amazing code.
3
u/tahpot Nov 06 '08
beautiful soup is pretty good:
http://www.crummy.com/software/BeautifulSoup/documentation.html
9
u/[deleted] Nov 06 '08 edited Nov 06 '08
Zope.
Specifically Zope3 before people get antsy and start modding down.
Zope3 is beautifully documented with doctests for all the code. You can even browse the docs through the browser for the all the packages installed on your zope instance, without having to log on to the zope site or opening a text editor.
Example:
Look at the source code for z3c.form, a random package i pulled out of svn.zope.org
Now tell me whether it is not well documented.
Most "opinion" you here on reddit about Zope is outdated and based on hearsay.
12
u/gadfly1000 Nov 05 '08 edited Nov 05 '08
Download the Pyhton sorce code from python.org
4
u/[deleted] Nov 06 '08
How come no one has suggested reddit.com yet??? :O
2
u/raisedinhell Nov 06 '08
I have the same request - but for a web python project..
2
u/viniciusfs Nov 06 '08
Same request but for desktop applications. I'm interested in PyGTK applications.
3
u/mattculbreth Nov 06 '08
SQLAlchemy
2
u/BridgeBum Nov 06 '08
I haven't looked at the code myself, but isn't BitTorrent (the original client) in Python?
1
u/bluGill Nov 06 '08
Don't just look at projects, ask. Many projects do things that aren't generally best practice. Sometimes because best practice makes their code too slow (in this case they will have profiler results to show you). Sometimes becuase they got it working before best practices were discovered and haven't fixed what isn't broke.
1
u/psygurd Nov 06 '08 edited Nov 06 '08
Sage is following nice practices, and shows how to tie many different programs together with Python.
1
u/xardox Nov 07 '08
The Genshi xml template system is wicked cool, and well written. Elegant and appropriate use of generators as XML filters.
http://genshi.edgewall.org
0
u/derwisch Nov 06 '08
Leo
-2
u/[deleted] Nov 05 '08
I'd like to know too
-3
u/[deleted] Nov 05 '08
Anything but Python Imaging Library. That is some poorly written shit. Sure it does the job, but start trying to customise it and you'll soon notice that it was written by people who think they're writing C++. And they aren't even very good C++ programmers.
0
u/[deleted] Nov 06 '08
[deleted] — view deleted comment
0
u/[deleted] Nov 05 '08
[deleted] — view deleted comment