Go to file
j e850296f68 download to tmp file and rename once download is complete 2024-03-22 08:48:48 +01:00
ox download to tmp file and rename once download is complete 2024-03-22 08:48:48 +01:00
.gitignore add ox.egg-info to .gitignore 2016-02-20 17:51:46 +05:30
README.md use markdown for readme, remove download url 2018-04-03 13:26:13 +05:30
requirements.txt depend on pillow>=10 2023-08-31 19:20:50 +01:00
setup.py cleanup 2023-11-18 16:40:39 +01:00
test.sh use py3 tests 2021-01-28 12:56:41 +01:00

README.md

python-ox - the web in a dict

Depends:

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

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 nosetests3 --with-doctest ox