From 1628fb1ca22a267e2c1c328e1d3ecc9458981d1b Mon Sep 17 00:00:00 2001 From: karolyn Date: Sat, 20 Jul 2024 16:02:22 -0500 Subject: [PATCH 1/6] 1st commit --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4c464fdf..2b2e03bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,10 @@ 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 +RUN apt-get install npm -y # Copy the contents of the current host directory (i.e., our app code) into # the container. From 7ab92e0e0d9779e6eaaff2f29af2248706a3c522 Mon Sep 17 00:00:00 2001 From: karolyn Date: Sat, 20 Jul 2024 16:06:05 -0500 Subject: [PATCH 2/6] 2nd commit --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 2b2e03bf..da1d522a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,6 +39,8 @@ COPY ./package.json /app/package.json #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 From afdebc41f9e9592fc5cafc7acad732fb96333554 Mon Sep 17 00:00:00 2001 From: karolyn Date: Sat, 20 Jul 2024 16:18:44 -0500 Subject: [PATCH 3/6] step one --- parserator_web/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/parserator_web/views.py b/parserator_web/views.py index 0be3f4a9..5d097573 100644 --- a/parserator_web/views.py +++ b/parserator_web/views.py @@ -21,4 +21,5 @@ def get(self, request): 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 From f0d370daed9d3a1082dae9c8525934600d2bfbe4 Mon Sep 17 00:00:00 2001 From: karolyn Date: Sun, 21 Jul 2024 16:58:14 -0500 Subject: [PATCH 4/6] Step two code challenge --- parserator_web/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parserator_web/views.py b/parserator_web/views.py index 5d097573..e2b13a0c 100644 --- a/parserator_web/views.py +++ b/parserator_web/views.py @@ -16,10 +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, adress_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 + From 5431ff493778ee7c62edb57fb37ba5c04d7b3236 Mon Sep 17 00:00:00 2001 From: karolyn Date: Sun, 21 Jul 2024 18:49:03 -0500 Subject: [PATCH 5/6] speeling erro in step 2 parse code corrected --- parserator_web/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parserator_web/views.py b/parserator_web/views.py index e2b13a0c..3e9e2a5b 100644 --- a/parserator_web/views.py +++ b/parserator_web/views.py @@ -16,7 +16,7 @@ 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. - address_components, adress_type = self.parse(request.data.address) + address_components, address_type = self.parse(request.data.address) return Response(("input_string" : request.data.address, "address_components" : address_components "address_type" : address_type)) From 9d4310f620b4e2560a71618ec85720a1c9d0ee1f Mon Sep 17 00:00:00 2001 From: karolyn Date: Mon, 22 Jul 2024 16:31:09 -0500 Subject: [PATCH 6/6] syntax error corrected for step 2 --- parserator_web/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parserator_web/views.py b/parserator_web/views.py index 3e9e2a5b..a3c87f3b 100644 --- a/parserator_web/views.py +++ b/parserator_web/views.py @@ -17,9 +17,9 @@ 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. address_components, address_type = self.parse(request.data.address) - return Response(("input_string" : request.data.address, - "address_components" : address_components - "address_type" : address_type)) + return Response({"input_string" : request.data.address, + "address_components" : address_components, + "address_type" : address_type}) def parse(self, address):