Skip to main content

Iterate through Craig's list

Project description

Craig's Generator
======
Read listings Pythonically.

Examples
---------
Generate listings.

from craigsgenerator import Section
for listing in Section('oakland','sub'):
print(listing)

Additional arguments get passed to ``requests.get``.

from craigsgenerator import Section
proxies = {'https':'example.com'}
for listing in Section('oakland','sub', proxies = proxies):
print(listing)

Downloaded files are cached by default and refreshed
if they're older than a day. Change the directory by
specifying the ``cachedir``.

from craigsgenerator import Section
for listing in Section('oakland','sub', cachedir = 'downloads'):
print(listing)

Disable caching by setting the ``cachedir`` to ``None``.

from craigsgenerator import Section
for listing in Section('oakland','sub', cachedir = None):
print(listing)

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

craigsgenerator-0.0.2.tar.gz (2.7 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