Skip to main content

python-ox - the web in a dict

Project description

python-ox - the web in a dict

Depends:
python >= 2.6
python-chardet (http://chardet.feedparser.org/)
python-feedparser (http://www.feedparser.org/)
python-lxml (http://codespeak.net/lxml/) [optional]
django (otherwise dates < 1900 are not supported) [optional]

Usage:
import ox

data = ox.cache.read_url('http:/...')
text = ox.strip_tags(data)
ox.normalize_newlines(text)
ox.format_bytes(len(data))

ox.format_bytes(1234567890)
'1.15 GB'

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

For information on ox.django see https://wiki.0x2620.org/wiki/ox.django

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ox-2.3.692.tar.gz (107.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page