Python wrapper for craigslist.
Project description
Python wrapper for craigslist. Requires Python 3.6+.
Install
pip3 install craigslist
CLI
$ craigslist --help usage: craigslist [-h] {search} ... examples: craigslist search washingtondc apa --postal 20071 --search_distance 1 craigslist search newyork aap --postal 10023 --search_distance 1 --hasPic --availabilityMode within_30_days --limit 100 craigslist search sfbay ccc --postal 94305 --search_distance 1 --limit 10 craigslist search vancouver sss "shoes" --condition new like_new --hasPic --max_price 20 --limit 10 craigslist search washingtondc jjj --is_telecommuting --is_internship positional arguments: {search} search search craigslist optional arguments: -h, --help show this help message and exit
For more details, try:
$ craigslist search --help
API
See the examples folder.
simple
import craigslist
for post in craigslist.search('washingtondc', 'apa', postal=20071, search_distance=1):
print(post)
# craiglist posts expire. replace the url below with something current
post = craigslist.get('https://washingtondc.craigslist.org/nva/apa/5875729002.html')
async
import asyncio
import craigslist
async def main():
async for post in craigslist.search_async('washingtondc', 'apa', postal=20071, search_distance=1):
print(post)
# craiglist posts expire. replace the url below with something current
post = await craigslist.get_async('https://washingtondc.craigslist.org/nva/apa/5875729002.html')
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
Development
Setup
mkvirtualenv craigslist -p python3.6 make install
Test
workon craigslist make test
Disclaimer
This library is not associated with Craigslist.
Please read the Craigslist terms of use.
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
craigslist-0.1.1.tar.gz
(51.6 kB
view hashes)
Built Distribution
craigslist-0.1.1-py3-none-any.whl
(57.2 kB
view hashes)
Close
Hashes for craigslist-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d610630b6d855ca5c1465a1db85bbd23db0701367bd9edbfc766985d142e87dd |
|
MD5 | fe4dcb694ac70b6c18f0ee054e43c743 |
|
BLAKE2b-256 | 30cb68d499091f2b807d5f0e832249372c830702300769bb1e6e458361e1946d |