473,671 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyAtom, a Python module for creating Atom syndication feeds

Hello. I have written a module called PyAtom. It is designed to make it
really easy to create an Atom syndication feed.

Atom is a format similar to RSS, but with some additional features.

http://atomenabled.org/developers/syndication/
From my Google searches, I think the name "PyAtom" is available, so I have
been calling my module by that name. If this is a bad name, please let me
know, and I'll change it.

I intend to donate this to the Python Software Foundation, so I have
released it under the terms of the Academic Free License 2.1.

You can download it from here:

http://www.blarg.net/~steveha/pyatom.tar.gz
The file includes a readme.txt file with a few notes, and pyatom.py.

I had a great time writing this. Please let me know what you think of it.
Comment here in comp.lang.pytho n, or send email to me. I have created a
special email address just for PyAtom questions and comments:

py****@langri.c om
P.S. Should I publish this to the Cheese Shop?

http://cheeseshop.python.org/

--
Steve R. Hastings "Vita est"
st***@hastings. org http://www.blarg.net/~steveha

Feb 23 '06 #1
5 3363
"Steve R. Hastings" <st***@hastings .org> writes:
I intend to donate this to the Python Software Foundation, so I have
released it under the terms of the Academic Free License 2.1.

You can download it from here:

http://www.blarg.net/~steveha/pyatom.tar.gz
The file includes a readme.txt file with a few notes, and pyatom.py.


Very interesting, I was looking forward to something like that in the past and
found atomixlib but it has heavy dependencies. Yours seems nicer. Anyway, you
don't follow PEP 8 guidelines and AFAIK a module must be widespread and used by
the community before can be accepted in the Python core. The same happened with
Lundh's ElementTree

Good job :)

--
Lawrence - http://www.oluyede.org/blog
"Anyone can freely use whatever he wants but the light at the end
of the tunnel for most of his problems is Python"
Feb 23 '06 #2
> you don't follow PEP 8 guidelines

Why do you say this? I don't think the code is perfectly polished and
ready to be called version 1.0, but I think it follows PEP 8 more than not.

and AFAIK a module must be widespread and used by
the community before can be accepted in the Python core.
I said I intend to donate it to PSF. I didn't say they would do anything
with it... :-) That's up to them, of course.

Good job :)


Thank you.
--
Steve R. Hastings "Vita est"
st***@hastings. org http://www.blarg.net/~steveha

Feb 23 '06 #3
"Steve R. Hastings" <st***@hastings .org> writes:
Why do you say this? I don't think the code is perfectly polished and
ready to be called version 1.0, but I think it follows PEP 8 more than not.


docstrings of method are messed up (why you begin them from the column 0?)

and

"
Function Names

Function names should be lowercase, with words separated by underscores
as necessary to improve readability.

mixedCase is allowed only in contexts where that's already the
prevailing style (e.g. threading.py), to retain backwards compatibility.
"

you use ThisCase for methods, quit ugly IMHO

--
Lawrence - http://www.oluyede.org/blog
"Anyone can freely use whatever he wants but the light at the end
of the tunnel for most of his problems is Python"
Feb 23 '06 #4
> docstrings of method are messed up (why you begin them from the column 0?)

Well, it seemed like a good idea at the time.

I wanted all my docstrings to look nice in an 80-column terminal
emulator, and it's easy to format them to similar lengths when they all
start in the same column. My standard is to use up to 72 columns for
line lengths.

When you have a class, which contains a function, which has a docstring,
the docstring is indented at least 3 levels. If you then use 72 columns,
the strings will wrap in the source code.

All that said, if the community doesn't do it this way, I'll go ahead and
change it. It seemed like a good way to go but I'm not combative about it.

Function Names

Function names should be lowercase, with words separated by underscores
as necessary to improve readability.

mixedCase is allowed only in contexts where that's already the
prevailing style (e.g. threading.py), to retain backwards compatibility.


Oh, right. I do have some mixed-case function names; I guess I'd better
rename them right away.

By the way, I started PyAtom as a learning project. Now that it's done I
want to share it, but I didn't study PEP 8 very much before I started it.

Thank you for the feedback.
--
Steve R. Hastings "Vita est"
st***@hastings. org http://www.blarg.net/~steveha

Feb 23 '06 #5
I have edited PyAtom, and now it should be in better conformance with the
PEP 8 guidelines. It is available from the same place as before:

http://www.blarg.net/~steveha/pyatom.tar.gz

--
Steve R. Hastings "Vita est"
st***@hastings. org http://www.blarg.net/~steveha

Feb 24 '06 #6

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

Similar topics

10
3681
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew dalke@dalkescientific.com
0
1514
by: Andy Dingley | last post by:
I'm just building my first Atom feeds (at http://gamesradar.com/rss/ps2/ should you care ) One of the requirements here is to include lots of rich media (screenshots) with each entry. There could be a dozen in each, and there may be a thumbnail/full-size pair too. Maybe even video clips. Size is _not_ an issue here, as the feed is intended for transferring content to partners who really do want it all, not just casual readers looking...
8
3032
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to what I really should do. I've had a look through Programming Python and the Python Cookbook, which have given me ideas, but nothing has gelled yet, so I thought I'd put the question to the community. But first, let me be a little more detailed...
1
2592
by: Xiao Jianfeng | last post by:
Hello, In pymol I can use "from chempy import Atom" but "import chempy.Atom" doesn't work. It says,"ImportError: No module named Atom". What is going wrong ? Thanks
0
1369
by: banjolibrarian | last post by:
I have been setting up RSS and Atom feeds for our library's podcasts. The RSS feed works fine, but when I subscribe to the Atom feed (via Bloglines), the link to the file itself defaults to blogspot.com. Any help would be appreciated. The full contents of southlakelibrary.atom are listed below: <atom:feed xmlns:atom="http://www.w3.org/2005/Atom"> <atom:id>http://www.cityofsouthlake.com/library/podcasts.asp</atom:id>
0
1184
by: Steve R. Hastings | last post by:
xe.py is a Python module to make it very easy to work with XML. I have attempted to make xe classes very Pythonic and intuitive. xe is intended for working with structured XML, such as syndication feed files, but I have added some support for unstructured XML as well. Example: >>> import xe >>> bird = xe.TextElement("bird") >>> bird.attrs = "Norwegian Blue"
0
1684
by: S.T | last post by:
Hi! I've spend this weekend trying and coding a php-based atom- and rss-feed writer. I don't know if this is the right place for my questions. However, since both feeds are based on xml, maybe someone can help. I understand that I have to replace all unknown entities, such as "&auml;". I wonder what's the common way to do so. For XML-Documents, I'd prefer to make use of an external DTD, say, referring to
2
1799
by: Brent | last post by:
I'm new to XML namespaces, and I seem to be missing something obvious in this code snippet, which is trying to retrieve the feed/entry nodes from an XPathNavigator document: XmlNamespaceManager mgr = new XmlNamespaceManager(xpNav.NameTable); mgr.AddNamespace("atom", "http://www.w3.org/2005/Atom"); XPathExpression itemsExpr = xpNav.Compile("/atom:feed/ atom:entry/");
0
8478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8919
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8599
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7439
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6230
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4225
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.