https://github.com/jms/urban-spoon
fastapi project
https://github.com/jms/urban-spoon
docker fastapi postgis postgresql sqlalchemy
Last synced: 2 months ago
JSON representation
fastapi project
- Host: GitHub
- URL: https://github.com/jms/urban-spoon
- Owner: jms
- License: mit
- Created: 2020-08-12T04:00:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T21:21:51.000Z (almost 6 years ago)
- Last Synced: 2025-08-02T04:02:27.576Z (11 months ago)
- Topics: docker, fastapi, postgis, postgresql, sqlalchemy
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# urban-spoon
fastapi project
To run the project
setup db, using the shapefile from [Timezone boundary builder project](https://github.com/evansiroky/timezone-boundary-builder/releases/) and the postgis tool `shp2pgsl`
```sql
CREATE DATABASE tzdb;
\c tzdb
CREATE EXTENSION postgis;
```
export shapefile to db
```bash
shp2pgsql -D combined-shapefile.shp timezones | psql -U -d tzdb
```
then:
```bash
export DATABASE_URL=postgresql://user:password@localhost/tzdb
uvicorn main:app --reload
```
testing the endpoint:
```bash
curl -X GET "http://localhost:8000/timezone?latitude=12&longitude=-86" -H "accept: application/json"
# result
{
"name": "America/Managua"
}
```