473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Well written open source Python apps

Ben
Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic". (Not trying to start any kind of war -
just wanted some good examples of a well written Python app to read.)

Thanks!
-Ben

P.S. - Sorry if this has been discussed at length before - I searched
the group before I posted, but didn't come up with what I was looking
for.

Oct 13 '05 #1
13 2222
On Thursday 13 October 2005 09:43, Ben wrote:
Could anyone suggest an open source project that has particularly
well written Python? I am especially looking for code that people
would describe as "very Python-ic". (Not trying to start any kind of
war - just wanted some good examples of a well written Python app to
read.)


The Python Standard Library. Thousands of lines of quite good Python
code. It might not use all the latest features, and there might be a
few dark corners here and there, but it's still solid. And quite easy
to understand (I had no difficulty understanding and modifying
httplib).

- Michael
Oct 13 '05 #2
On Oct 13, Ben wrote:
Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic". (Not trying to start any kind of war -
just wanted some good examples of a well written Python app to read.)


The Python Package Index (PyPI, or cheeseshop)
<http://www.python.org/pypi> has pointers to a lot of packages that are
likely mostly pythonic.

I don't know if this is spelled out more precisely somewhere, but here
is my notion of a pythonic distribution:

* Has modules grouped into packages, all are cohesive, loosely
coupled, and reasonable length

* Largely follows PEP <http://www.python.org/peps/> conventions

* Avoids reinventing any wheels by using as many Python-provided modules
as possible

* Well documented for users (manpages or other) and developers
(docstrings), yet self-documenting with minimal inline commenting

* Uses distutils for ease of distribution

* Contains standard informational files such as:
BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt

* Contains standard directory structure such as:
doc/ tools/ (or scripts/ or bin/) packageX/ packageY/ test/

* Clean UI, easy to use, probably relying on optparse or getopt

* Has many unit tests that are trivial to run, and code is structured to
facilitate building of tests

The first example of a pythonic package that comes to my mind is
docutils <http://docutils.source forge.net/>.

--
Micah Elliott
<md*@micah.elli ott.name>
Oct 13 '05 #3
Here is an article discussing the coding style of BitTorrent.

http://www.onlamp.com/pub/a/python/2...ythonnews.html

Maybe that code is worth looking at.

Oct 13 '05 #4
This is really synchronicity in action! I started to think yesterday
about putting together a project that measures the 'goodness' of Python
packages in the PyPI Cheese Shop repository. I call it the "Cheesecake "
project. I took the liberty of citing Micah's post in a blog entry that
I just posted:
<http://agiletesting.bl ogspot.com/2005/10/cheesecake-how-tasty-is-your-code.html>

Comments/suggestions welcome!

Grig

Oct 13 '05 #5
"Ben" <bw*******@gmai l.com> writes:
Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic". (Not trying to start any kind of war -
just wanted some good examples of a well written Python app to read.)

[...]

At the time I looked at it I thought this was nice, though that was
some time ago (it was still 'sketch' then) so I wonder if I'd still
have the same opinion if I looked now (due to me changing my view of
"good code", not the skencil source code changing!):

http://www.nongnu.org/skencil/
John

Oct 13 '05 #6
On Oct 13, Grig Gheorghiu wrote:
This is really synchronicity in action! I started to think yesterday
about putting together a project that measures the 'goodness' of Python
packages in the PyPI Cheese Shop repository. I call it the "Cheesecake "
project. I took the liberty of citing Micah's post in a blog entry that
I just posted:
<http://agiletesting.bl ogspot.com/2005/10/cheesecake-how-tasty-is-your-code.html>


Grig, I think you're onto something here; good idea. I have no
experience with CPANTS, and I'm not sure how many of my ideals could be
checked programmaticall y. But if your Cheesecake tool comes into
fruition, here are some things that I would personally find useful:

* A command-line version that I could easily run on my projects.

* An output that gives more than just an index/score; maybe a bunch of
stats/indicators like pylint. I.e., it would be say "pypkglint" or
"pydistchecker" , a higher level lint that operates on packages instead
of just source files.

* Some checks that might be useful

- Module and package naming conventions. (PEP-8 describes
module-naming, but I see this broken more often than followed in
practice. And it is silent on package names, but the tutorial uses
capitalized names.) Some consistency here would be nice.

- Existence of standard files. ESR goes into detail on this in his
"Art of UNIX Programming" book (pp 452).

- Existence of standard directories (those I mentioned before).

- Output of checkee "--help" should satisfy some standards. I presently
check my own tools by running "help2man" which forces me to setup
optparse to follow a strict format. I have some active RFEs on
optik (optparse) to address this.

- Use of distutils. Maybe just a check for setup.py ?

- Consistency of module length. Not sure about this one, but you
might lower the score if some package modules are 10 lines while
others are 10KLOC.

- Number of modules per package. Maybe 4..20 is a good amount?

- Extra points for existence of something like "api.html", which
indicates that epydoc/pydoc generated API info.

- Extra points for .svn/CVS/RCS directories indicating that version
control is in place. Maybe even glarking of version numbers where
high numbers indicate that code is checked in frequently.

- Use of ReST in documentation, or even in docstrings.

- Count of unit tests. Do module names map to test_<modulenam e> in
test directory? How many testXXX functions exist?

- A summary calculation of pylint/pychecker scores for each module.

- Point deduction (or fail!) if any .doc/.xls, etc. files included in
distribution.

- Extra points for use of modules that indicate extra usability was
incorporated, such as: gettext (multi-language), optparse (clean
UI), configparser (fine control), etc.

* A PEP describing the conventions (though some will argue that PEPs
should be enforcable by the compiler, so maybe just a "Cheesecake
Convention" document).

* And of course anything that CPANTS offers :-)

I'm sure people here have more ideas for quality indicators...

--
Micah Elliott
<md*@micah.elli ott.name>
Oct 13 '05 #7
Ben wrote:
Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic". (Not trying to start any kind of war -
just wanted some good examples of a well written Python app to read.)


I'm sorry I can't speak on its "pythonicit y" (my memory sucks), but I
did find Roger Binns' BitPim program (http://bitpim.sourceforge.net/) to
be an excellent source of ideas (steal steal steal) for wxPython code,
and I do remember it struck me as being exceptionally well commented and
well structured. I suspect it's pretty Pythonic, too, since Roger seems
pretty brilliant from where I sit. :-)

-Peter
Oct 14 '05 #8
The paper on BitPim http://bitpim.sourceforge.net/papers/baypiggies/
lists and describes programs and ideas used for the project. Some of
it is just bullet-points, but everything seems to be well chosen. I've
swiped a lot of these ideas.

Oct 14 '05 #9
> Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic".


I vote for the "doctest" code in the standard library.

Michele Simionato

Oct 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35519
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy...
4
2195
by: Python Baby | last post by:
learning Python, planning on making an interactive website. To me, "interactive website" = "web app" = websites such as NetFlix, Amazon, Orbitz, Hotmail, MyYahoo, etc. Something stateful that does a lot behind the scenes, but uses the web browser as an interface. Has anyone seen any great examples of very well-written web apps like...
188
8350
by: Ilias Lazaridis | last post by:
I'm a newcomer to python: - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 - I've download (as suggested) the python 2.4 installer for windows. Now I have problems to compile python extension that some packages
3
1575
by: Alex Gittens | last post by:
Is anyone aware of any applications that handle font and graphics display--- something like Adobe Reader--- that are written in Python, and the code is available for examination? It doesn't matter what GUI toolkit is used. Thanks, Alex -- ChapterZero: http://tangentspace.net/cz/
0
1646
by: thomasasta | last post by:
Hey there is a new python written open source bit-torrent client out. Don´t mit it up with brams c++ bittorrent, in python it is bit-torrent.sf.net Don´t forget the minus - http://bit-torrent.sourceforge.net/ It´s out till 10 days and the code is open source, so you can add it to any other application in python like CyberSpace or...
158
6346
by: Giovanni Bajo | last post by:
Hello, I just read this mail by Brett Cannon: http://mail.python.org/pipermail/python-dev/2006-October/069139.html where the "PSF infrastracture committee", after weeks of evaluation, recommends using a non open source tracker (called JIRA - never heard before of course) for Python itself. Does this smell "Bitkeeper fiasco" to anyone...
113
5225
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. ...
3
1565
by: KidSensation | last post by:
Hello all, I ran into a couple applications written in c#, but we do not have the full version of visual studio.net 2003, so I thought they were most likely written in the beta version. After some research, I found out that sooner or later the applications written in beta would just stop working. This is going to be a major problem and I...
1
3043
by: seberino | last post by:
Best open source Python online chat apps? I believe there are a few PHP online chat apps to allow people to have conversation via a web server but a Python one would soothe the soul. Any available? Thanks,
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.