https://github.com/pythonbyte/zipcode-api
https://github.com/pythonbyte/zipcode-api
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pythonbyte/zipcode-api
- Owner: pythonbyte
- Created: 2021-01-24T22:28:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-24T22:29:06.000Z (over 5 years ago)
- Last Synced: 2025-03-05T11:35:29.960Z (over 1 year ago)
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Challenge
# Description
This project is a Zipcode API.
# Installing
First step of installation is having Pipenv installed in your machine, if you doesn't have just use the below command:
``` $ pip install pipenv ```
Now after cloned the repository all you need to do is:
```
$ cd zipcodeapi/
$ pipenv install
$ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
```
# Testing
To test the application use:
```$ python manage.py test```
# API documentation
This API works with 1 endpoint:
## Zipcode Endpoint
This endpoint works at the **/getzipcode/-zipcode-**. It uses a brazilian type of zipcode like this '30330-330', and returns the fields needed. And only accepts
POST method.
POST data:
/getzipcode/30330330
Status: 200 OK
```
{
"cep": "30330330",
"address": "Rua Campo Belo",
"neighborhood": "São Pedro",
"city": "Belo Horizonte",
"state": "MG"
}
```