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)

Get the full text of the listing with the ``fulltext`` function.

from craigsgenerator import Section
for listing in Section('oakland','sub'):
print(listing)
print(fulltext(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.3.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file craigsgenerator-0.0.3.tar.gz.

File metadata

File hashes

Hashes for craigsgenerator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4784539d1c3a18b329b47091ed08c54ff03e9e13259f69e74ade0d8b6bed7bdf
MD5 a64db6cdb6a3f371bc5dc9a85402b7c2
BLAKE2b-256 6942a70588ab5f5c3c2ac3950ca2c899ec5a6b8e98761051ba5af113365c14a0

See more details on using hashes here.

Supported by

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