Skip to content

Commit e3b784b

Browse files
committed
2015-11-16
1 parent 9b573f1 commit e3b784b

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

readme.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ List of the way you can search
8989
Here's the list of the ways you can search zipcode:
9090

9191
- `by city and state <by_city_and_state_>`_
92+
- `by city <by_city_>`_
93+
- `by state <by_state_>`_
9294
- `by latitude, longitude and radius <by_coordinate_>`_
9395
- `by zipcode prefix <by_prefix_>`_
9496
- `by estimated population <by_population_>`_
9597
- `by estimated population density <by_density_>`_
98+
- `by landarea <by_landarea_>`_
99+
- `by waterarea <by_waterarea_>`_
96100
- `by estimated total annual wage <by_total_wage_>`_
97101
- `by estimated average total annual wage <by_wealthy_>`_
98102
- `by estimated house of units <by_house_>`_
@@ -138,6 +142,36 @@ You can add ``standard_only=False`` parameter to enable returning Po Box type zi
138142
>>> res = search.by_city_and_state("Chicago", "IL", standard_only=False)
139143

140144

145+
.. _by_city:
146+
147+
Search by City
148+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149+
150+
You can search zipcode by city name.
151+
152+
.. code-block:: python
153+
154+
>>> res = search.by_city("vienna")
155+
>>> zipcode = res[0]
156+
>>> zipcode.City
157+
'Vienna'
158+
159+
160+
.. _by_state:
161+
162+
Search by State
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
165+
You can search zipcode by state name.
166+
167+
.. code-block:: python
168+
169+
>>> res = search.by_state("Rhode Island")
170+
>>> zipcode = res[0]
171+
>>> zipcode.State
172+
'RI'
173+
174+
141175
.. _by_coordinate:
142176

143177
Search by Latitude and Longitude
@@ -204,6 +238,34 @@ You can search all zipcode by defining its population density lower bound or upp
204238
... # do whatever you want...
205239
206240
241+
.. _by_landarea:
242+
243+
Search by Landarea of Zipcode
244+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
245+
246+
You can search all zipcode by defining its Landarea lower bound or upper bound, or both:
247+
248+
.. code-block:: python
249+
250+
>>> res = search.by_landarea(lower=1000, upper=2000)
251+
>>> for zipcode in res:
252+
... # do whatever you want...
253+
254+
255+
.. _by_waterarea:
256+
257+
Search by Waterarea of Zipcode
258+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259+
260+
You can search all zipcode by defining its Waterarea lower bound or upper bound, or both:
261+
262+
.. code-block:: python
263+
264+
>>> res = search.by_waterarea(lower=100, upper=200)
265+
>>> for zipcode in res:
266+
... # do whatever you want...
267+
268+
207269
.. _by_total_wage:
208270

209271
Search by Zipcode Estimate Annual Total Wage

uszipcode/searchengine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ class ZipcodeSearchEngine(object):
7575
- :meth:`ZipcodeSearchEngine.by_zipcode`
7676
- :meth:`ZipcodeSearchEngine.by_coordinate`
7777
- :meth:`ZipcodeSearchEngine.by_city_and_state`
78+
- :meth:`ZipcodeSearchEngine.by_city`
79+
- :meth:`ZipcodeSearchEngine.by_state`
7880
- :meth:`ZipcodeSearchEngine.by_prefix`
7981
- :meth:`ZipcodeSearchEngine.by_pattern`
8082
- :meth:`ZipcodeSearchEngine.by_population`
8183
- :meth:`ZipcodeSearchEngine.by_density`
84+
- :meth:`ZipcodeSearchEngine.by_landarea`
85+
- :meth:`ZipcodeSearchEngine.by_waterarea`
8286
- :meth:`ZipcodeSearchEngine.by_totalwages`
8387
- :meth:`ZipcodeSearchEngine.by_wealthy`
8488
- :meth:`ZipcodeSearchEngine.by_house`

0 commit comments

Comments
 (0)