Integrate Python address parser using use-address library
Add usaddress library to project dependencies
- Implement AddressParse API view for address parsing
- Create parse() method to handle address parsing logic
- Update frontend to send requests to new API endpoint
- Display parsed address components and handle errors in UI
- Add error handling for unparseable addresses
- Update tests to cover new address parsing functionality"
This PR involves recreating an address parsing form similar to DataMade's Parserator web service. Parserator is a tool that takes input strings representing addresses (e.g., "123 main st chicago il") and splits them into their component parts, such as street number, street name, city, and state. Here's a breakdown of what this entails:
How to test this PR
-
After checking out this branch, follow these steps:
-
Setup:
-
Ensure Docker and Docker Compose are installed on your machine
-
Build the application containers:
run command in project docker-compose build
-
Start the application:
run command in project docker-compose up
- The app should now be running at http://localhost:8000
-
User Interface Testing:
-
Open http://localhost:8000 in your web browser
-
Test with valid input:
-
Enter "123 main st chicago il" in the input field
-
Click the submit button
-
Expected output:
-
AddressNumber: 123
-
StreetName: main
-
StreetNamePostType: st
-
PlaceName: chicago
-
StateName: il
-
Test with invalid input:
-
Enter "123 main st chicago il 123 main st" in the input field
-
Click the submit button
-
Expected output: An error message should be displayed indicating invalid input
-
Unit Testing:
-
Run the unit tests using:
docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
-
Expected output: All tests should pass, and no linting errors should be reported
-
Additional Notes:
-
If you make any changes, you may need to rebuild the containers
-
Ensure the console output doesn't show any unexpected errors during testing
I have cleaned up the description of the PR and I moved the javascript to the js/index.js file