Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python wrapper for craigslist.

Project description

Travis CI Status Coverage Status PyPI Version License Status

Python wrapper for craigslist. Requires Python 3.6+.

Install

pip3 install --upgrade craigslist

CLI

$ craigslist
usage: craigslist [-h] {search,list} ...

examples:
craigslist search worcester apa
craigslist search newyork tlg
craigslist search sfbay mis
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
craigslist list areas
craigslist list categories

positional arguments:
  {search,list}
    search       search
    list         list

optional arguments:
  -h, --help     show this help message and exit

For more details, try:

$ craigslist search
$ craigslist list

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

make install

Test

make test

Disclaimer

  • This library is not associated with Craigslist.
  • Please read the Craigslist terms of use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
craigslist-0.1.9-py3-none-any.whl (56.5 kB) Copy SHA256 hash SHA256 Wheel py3
craigslist-0.1.9.tar.gz (53.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page