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('austin','sub'):
print(listing)

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

from craigsgenerator import Section
proxies = {'https':'example.com'}
for listing in Section('austin','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('austin','sub', cachedir = 'downloads'):
print(listing)

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

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

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

from craigsgenerator import Section
for listing in Section('austin','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.8.tar.gz (3.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for craigsgenerator-0.0.8.tar.gz
Algorithm Hash digest
SHA256 429bd8012fa905f812350cc5a72f4d73f1f28095527a5315870f0dc8bb0d97b6
MD5 bdbf316704b888633fa9e79e03116379
BLAKE2b-256 c80f4d74e80710b3901dea3954f33306a1299bd21817b3a20555ce36d9b19fee

See more details on using hashes here.

Provenance

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