MacHu-GWU / uszipcode-project

USA zipcode programmable database, includes up-to-date census and geometry information.
MIT License
231 stars 49 forks source link

Docs out of date #62

Open chrisspen opened 2 years ago

chrisspen commented 2 years ago

The docs don't seem to match the codebase anymore, as almost none of the example work.

https://uszipcode.readthedocs.io/01-Usage-Example/index.html#searchengine-examples

>>> from uszipcode import SearchEngine
>>> search = SearchEngine(simple_zipcode=True)
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    zipSearch = SearchEngine(simple_zipcode=False)
TypeError: __init__() got an unexpected keyword argument 'simple_zipcode'

Could you please provide working examples of how to use the package?

angietseng commented 2 years ago

Same. When I ran one of the working samples (the Fuzzy city name and state name search one), I got an AttributeError: 'Session' object has no attribute 'scalars.' I got the error when I ran it on Jupyter Notebook. However, when I ran it on normal python environment, it worked perfectly. Please let me know how to resolve this issue. Thanks!

This is the example I ran:

from uszipcode import SearchEngine
search = SearchEngine(simple_or_comprehensive=SearchEngine.SimpleOrComprehensiveArgEnum.simple)
res = search.by_city_and_state("cicago", "il", returns=999)
print(res[0])