Skip to main content

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.

Source Distribution

craigslist-0.1.7.tar.gz (52.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

craigslist-0.1.7-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

Details for the file craigslist-0.1.7.tar.gz.

File metadata

  • Download URL: craigslist-0.1.7.tar.gz
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.17.1 CPython/3.6.7

File hashes

Hashes for craigslist-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c73e91c0375d694cd3dbf48924ff77cdc2324fdc3372ebb25b52f24bd4dcbfd2
MD5 12781612f5396d60f318c47d072cf101
BLAKE2b-256 93c209b380ddd75e56b7c1bc619fbe429f3a1d474791e43db4d696698e0bea48

See more details on using hashes here.

File details

Details for the file craigslist-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: craigslist-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 56.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.17.1 CPython/3.6.7

File hashes

Hashes for craigslist-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 00d8106394013271d3ffd810b74afaa68102c7c01d23a731b47d9db30fe30f9c
MD5 ec5b9ce338c3704bae53ce1d7e9854eb
BLAKE2b-256 9bb55004c621bd811360b56f5b410ab3eeb0d8d661d5096ea1370a271f3aedd3

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