954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

New python 3 modules

I started this for any information on new python modules apart from standard library. Many people (Including me), aren't willing to move into p3k due to lack of external/non-standard modules.

So I started this to keep ourselves informed on New Python 3 Modules.
No Limitation, ANY PYTHON 3 MODULE

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

Like I mentioned in another thread, the problem is that a lot of those modules are freeware done by different folks. Monetary reward is more of a driving force, and it will take a while to get those free things to show up. Python30 has a lot of rather subtle changes that need to be considered to avoid buggy code.

Ene Uran
Posting Virtuoso
1,723 posts since Aug 2005
Reputation Points: 625
Solved Threads: 213
 

Well i know this may be obvious, but Tkinter is all ready to be used in python 3. So anybody who uses that GUI toolkit will still be able to use it in python 30.

Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
 
Well i know this may be obvious, but Tkinter is all ready to be used in python 3. So anybody who uses that GUI toolkit will still be able to use it in python 30.

Tkinter ships with the Python30, it better work! Also Tkinter uses its own language called TCL, so changes would have been minor.

Anyway evstevemd, a good idea to keep an eye out for some of those popular open-source modules to appear.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
Like I mentioned in another thread, the problem is that a lot of those modules are freeware done by different folks. Monetary reward is more of a driving force, and it will take a while to get those free things to show up. Python30 has a lot of rather subtle changes that need to be considered to avoid buggy code.

Yeah, I understand!
I wanted us to keep each other updated in case any module comes for python 3

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 
Yeah, I understand! I wanted us to keep each other updated in case any module comes for python 3

Nice idea! Will keep checking it for the next year or so.

sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212
 

Mark Pilgrim is preparing his Book dive into python 3. He isn't finished yet and I thought I should publish here for someone to watch

:)

http://diveintopython3.org/

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

Well i think i can post the first one. Beautiful Soup!
http://www.crummy.com/software/BeautifulSoup/

All you need to do is an automatic python 3 conversion on it and then it works fine with python 3. So enjoy :)

Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
 

Cython, for writing extension modules works with Python 3. One of the great things about it is that extension modules you write with it work for both Python 2.x and Python 3.x most of the time, without adjustment.

scru
Posting Virtuoso
1,629 posts since Feb 2007
Reputation Points: 975
Solved Threads: 140
 

SQLite is also packaged with Python 3.x. PostgreSQL has pg8000-py3. Don't know about MySQL or any of the others.

woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
 

Well i think i can post the first one. Beautiful Soup! http://www.crummy.com/software/BeautifulSoup/

All you need to do is an automatic python 3 conversion on it and then it works fine with python 3. So enjoy :)

This will not work! Python30 does not have a module called 'sgmllib'. The error is:
Traceback (most recent call last):
File "", line 248, in run_nodebug
File "C:\Python30\Atest30\Bull\BS_ParseHtml1.py", line 4, in
from BeautifulSoup import BeautifulSoup
File "C:\Python30\Atest30\Bull\BeautifulSoup.py", line 54, in
from sgmllib import SGMLParser, SGMLParseError
ImportError: No module named sgmllib

sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212
 

Well it must somehow, the site says it does and im sure they wouldnt say that without some foundation at least.

http://www.crummy.com/software/BeautifulSoup/ says
Beautiful Soup is known to work with Python versions 2.4, 2.5, and (after an automatic conversion) 3.0. Currently the 3.0.x series is better at parsing bad HTML than the 3.1 series.

Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
 

from: http://www.crummy.com/software/BeautifulSoup/3.1-problems.html

In Python 3.0, the latest version of Python, SGMLParser has been removed. The only parser that's part of the Python 3.0 standard library is HTMLParser, a simpler parser that's much worse at processing malformed HTML.

In the meantime, an excellent new HTML parsing library called html5lib has emerged. It's very good at processing malformed HTML, but it's not part of the Python standard library, and at the moment it's slower than either SGMLParser or HTMLParser.

I no longer enjoy working on Beautiful Soup, but too many people depend on it for me to let the project die just because it depends on code that's been removed from the Python standard library. So I wrote Beautiful Soup 3.1.0, which cleans up the Python 2.x code so that it can be automatically converted to Python 3.0. code. Part of this change was to switch the underlying parser from SGMLParser to HTMLParser. The errors you're seeing are caused by HTML that SGMLParser could handle but HTMLParser can't.

When Beautiful Soup was first released in May of 2004, there were no lenient HTML parsers that were easy to program, only the ones embedded in web browsers. Now there are lots of programmable lenient HTML parsers, and most of them are better than SGMLParser, let alone HTMLParser. These days, Beautiful Soup is useful for its Unicode handling and its tree-traversal methods. Parsing is longer a competitive advantage for Beautiful Soup, and I'd be happier if I could get out of the parser business altogether.

What I gather from this is that the author of the library no longer wants to continue develop BeautifulSoup, and since python 3 it's become worse at parsing real world html (malformed html). Even if the code can be converted into working python 3 code, it's probably a good idea to start looking for other parsers.

I've found a couple of blogs that points to lxml as the parser of choice. Take a look at http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/

-Vidaj-

vidaj
Junior Poster in Training
68 posts since Jul 2007
Reputation Points: 45
Solved Threads: 14
 

BeautifulSoup works fine with Python30 if you
copy
BeautifulSoup.py (version3.0.7a or lower)
and
sgmllib.py (find it typically in C:\Python25\Lib)
to a separate directory and convert both programs with 2to3.py

This rather obvious approach was overlooked by the BeautifulSoup folks.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

Win32 Extensions for Python from:
http://starship.python.net/crew/mhammond/win32/Downloads.html
is available in it's Python3 version, see:
http://sourceforge.net/project/showfiles.php?group_id=78018
and download and install:
pywin32-213.win32-py3.0.exe

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

PyQT is out for QT fans.
It is in pyQT 4.5
For more, see here:
http://www.riverbankcomputing.co.uk/news/pyqt-45

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

wxPython isn't yet out and I asked on the mail list, there is no nearby plan to port it to 3k. So Stick with your python 2.x version.

I also hope haven't missed any module apart from mentioned above

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You