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))
======
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
Release history Release notifications | RSS feed
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.9.tar.gz
(3.3 kB
view details)
File details
Details for the file craigsgenerator-0.0.9.tar.gz
.
File metadata
- Download URL: craigsgenerator-0.0.9.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e6eef6d4abfa5feecc1cb438a24532df4f7ba2496db3a13804ecb9ffabaa892 |
|
MD5 | 2830fb27a7005ac7dfd216e1cb6a1248 |
|
BLAKE2b-256 | 93ea3c06ca154ced8475bcfcb8f6f0d3a4b37605431159249835fab0bbd86e84 |