No description
Find a file
2010-07-08 10:59:15 +02:00
ox add reviews 2010-07-08 10:59:15 +02:00
.bzrignore rename bt->torrent 2008-04-27 19:10:34 +02:00
README add ox.web to this repos 2010-07-08 01:25:57 +02:00
requirements.txt only use distutils, add requirements.txt 2009-10-09 16:53:52 +02:00
setup.py install ox.web 2010-07-08 10:06:00 +02:00
test.sh fix test.sh 2010-07-08 01:28:04 +02:00

python-ox some tools to build tools

Depends:
 python2.5
 python-chardet (http://chardet.feedparser.org/)
 python-feedparser (http://www.feedparser.org/)
 python-beautifulsoup (http://www.crummy.com/software/BeautifulSoup/)

Usage:
 import ox
 
 data = ox.cache.readUrl('http:/...')
 text = ox.stripTags(data)
 ox.normalizeNewlines(text)
 ox.formatBytes(len(data))

 ox.formatBytes(1234567890)
 '1.15 GB'

 import ox.web.imdb
 imdbId = ox.web.imdb.guess('The Matrix')
 info = ox.web.imdb.Imdb(imdbId)
 info['year']
 1999

Install:
  python setup.py install

Cookies:
  some ox.web modules require user accont information or cookies to work,
  those are saved in ~/.ox/auth.json, most basic form looks like this:
  {
    "key": "value"
  }

Tests:
 nosetests --with-doctest ox