You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,11 +151,22 @@ Example Usage
151
151
152
152
**NOTE**:
153
153
154
-
``uszipcode`` has two backend database, ``SimpleZipcode`` and ``Zipcode``. ``Zipcode`` has more info, but the database file is 450MB (takes more time to download). ``SimpleZipcode`` doesn't has all data points listed above, but the database file is smaller (9MB). By default ``uszipcode`` use ``SimpleZipcode``. You can use this code to choose to use the rich info ``Zipcode``::
154
+
``uszipcode`` has two backend database, ``SimpleZipcode`` and ``Zipcode``. ``Zipcode`` has more info, but the database file is 450MB (takes more time to download). ``SimpleZipcode`` doesn't has all data points listed above, but the database file is smaller (9MB). By default ``uszipcode`` use ``SimpleZipcode``. You can use this code to choose to use the rich info ``Zipcode``:
155
+
156
+
.. code-block:: python
155
157
156
158
>>>from uszipcode import SearchEngine
157
159
>>> search = SearchEngine(simple_zipcode=False)
158
160
161
+
From 0.2.4, ``uszipcode`` **allows developer to choose which directory you want to use to download the database file**. By default, it is ``$HOME/.uszipcode``, but you can easily change it.:
162
+
163
+
.. code-block:: python
164
+
165
+
>>> search = SearchENgine(db_file_dir="/tmp")
166
+
167
+
For example, AWS Lambda doesn't allow to download file to $HOME directory, but allows to download to ``/tmp`` folder.
168
+
169
+
159
170
**Examples**:
160
171
161
172
.. code-block:: python
@@ -253,6 +264,19 @@ You can **easily sort your results** by any field, or distance from a coordinate
If you want to build a private uszipcode API server you have two choice:
271
+
272
+
1. Use a VM like EC2 machine, and deploy a web api server with the machine.
273
+
2. (RECOMMEND) Dump the sqlite database to any relational database like Postgres, MySQL, and inject the database connection info in your application server.
274
+
275
+
In the feature release, I will provide an easy way that allow you to deploy uszipcode as a private web api service.
0 commit comments