Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DataMade Parserator Challenge Solution
Hi DataMade Team,
My name is Ahmad, and I work at the New York City Council. Welcome to my code challenge solution! 👋
At the City Council, I frequently engage in civic projects like your team do. These projects often involve making calls to public APIs and displaying the returned data on interactive Leaflet maps. This challenge was a delightful experience, and I thoroughly enjoyed working on it.
Overview
The challenge was both fun and educational. Below is a summary of what I accomplished during this project:
Demo: Handling Various Address Entry Scenarios
Accomplishments
Backend Development
Implemented the
parse
Method:usaddress
to parse address strings into components.Enhanced Error Handling:
Frontend Development
Wired Up the Form:
Displayed Results and Errors:
Docker File
Docker Setup:
Testing
Added Unit Tests:
Passed All Tests:
tests/test_views.py::test_api_parse_succeeds
PASSEDtests/test_views.py::test_api_parse_raises_error
PASSEDInstallation Instructions
Development requires a local installation of Docker and Docker Compose. These are the only two system-level dependencies you should need.
Once you have Docker and Docker Compose installed, build the application containers:
Next, run the app:
The app will log to the console, and you should be able to visit it at http://localhost:8000.
You can run the tests using Docker:
Test Cases and Expected Output
Test Case 1: Valid Address
Input:
123 main st chicago il
Expected Output:
Test Case 2: Repeated Address
Input:
1123 main st chicago il 123 main st
Expected Output:
Test Case 3: Invalid Address
Input:
asdsadfdsaf
Expected Output:
Test Case 4: Empty Address
Input:
""
Expected Output:
This project involved recreating the address parsing functionality of DataMade's Parserator service. Key tasks included implementing the parsing logic, enhancing error handling, wiring up the frontend form to the backend API, and ensuring comprehensive testing with unit tests.
So excited and looking forward to your feedback!
Thank you!