irahorecka / pycraigslist

Craigslist API wrapper
MIT License
41 stars 14 forks source link

Missing categories (subcategories?) #1

Closed usctzen closed 3 years ago

usctzen commented 3 years ago

Hi,

Your API does not allow me me to use some categories (subcategories?) . For example I specifically want to use the "mcy" category which a subset of the "mca" category. The API return an error if I use this:

bikes = pycraigslist.forsale.mcy(site='miami', area='brw', filters=bike_filters)

This is the error return.

Traceback (most recent call last):
File "C:/Users/mgpd/PycharmProjects/molivo/py_clist.py", line 11, in <module>
bikes = pycraigslist.forsale.mcy(site='miami', area='brw', filters=bike_filters)
AttributeError: type object 'forsale' has no attribute 'mcy'

The "mcy" category is valid. This is the motorcycles for sale by owners.

This category is returned in the data set. Here the full test script:

import pycraigslist

bike_filters = {
    'posted_today': True,
    'bundle_duplicates': True,
    'make': 'Harley',
    'model': 'Softail'
}

bikes = pycraigslist.forsale.mca(site='miami', area='brw', filters=bike_filters)

for bike in bikes.search(limit=5):
    print(bike)
irahorecka commented 3 years ago

Excellent, I'll add this feature to the next release.

irahorecka commented 3 years ago

Hello Marc, the latest version (v0.3.6) should address this issue. Please let me know if it persists.

usctzen commented 3 years ago

Hello Marc, the latest version (v0.3.6) should address this issue. Please let me know if it persists.

Installed and tested. Works like a charm. Let me make it a production script and I'll come back to you with some more features.

irahorecka commented 3 years ago

Thanks Marc, let me know if this issue pops up in the future

usctzen commented 3 years ago

I will. Thanks again. Your project is turning out really good.