Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ RUN pip install --no-cache-dir -r requirements.txt

# Install Node requirements
COPY ./package.json /app/package.json
RUN npm install

#this process errored out
#RUN npm install

# i used this one instead
RUN apt-get install npm -y

# Copy the contents of the current host directory (i.e., our app code) into
# the container.
Expand Down
8 changes: 7 additions & 1 deletion parserator_web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ class AddressParse(APIView):
def get(self, request):
# TODO: Flesh out this method to parse an address string using the
# parse() method and return the parsed components to the frontend.
return Response({})
address_components, address_type = self.parse(request.data.address)
return Response({"input_string" : request.data.address,
"address_components" : address_components,
"address_type" : address_type})


def parse(self, address):
# TODO: Implement this method to return the parsed components of a
# given address using usaddress: https://github.com/datamade/usaddress
address_components, address_type = usaddress.tag(address)
return address_components, address_type