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.10.tar.gz (53.1 kB view details)

Uploaded Source

Built Distribution

craigslist-0.1.10-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: craigslist-0.1.10.tar.gz
  • Upload date:
  • Size: 53.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for craigslist-0.1.10.tar.gz
Algorithm Hash digest
SHA256 97860ac91febd3e235f2dfc8cbb84f66fa916763a3dfd08c64595bc66d4711a9
MD5 69ac7db9b499d19a1e59104a4956abac
BLAKE2b-256 1f56528c37fa53b3b706ed50024b1ca8d92df9b3aecf88513baa0fda0ad1b3b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: craigslist-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for craigslist-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4a91b734146f7511c561b69926df9e3266f769bb0cc003374424165ab8b35ef5
MD5 9fb03f3d0997a908928093a092fa9d72
BLAKE2b-256 05951e5b5c0829673c6e030f2ee7fad7da152565a8adf660130e08d0019fdb81

See more details on using hashes here.

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