summaryrefslogtreecommitdiff
path: root/python-pandas-usaddress.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-pandas-usaddress.spec')
-rw-r--r--python-pandas-usaddress.spec338
1 files changed, 338 insertions, 0 deletions
diff --git a/python-pandas-usaddress.spec b/python-pandas-usaddress.spec
new file mode 100644
index 0000000..58d9403
--- /dev/null
+++ b/python-pandas-usaddress.spec
@@ -0,0 +1,338 @@
+%global _empty_manifest_terminate_build 0
+Name: python-pandas-usaddress
+Version: 0.21
+Release: 1
+Summary: The usaddress library made easy with Pandas.
+License: MIT
+URL: https://github.com/Lyonk71/pandas-usaddress
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/63/16/63e09bc175aee1a03dc6ba455e1f21902b3854d199b530a4cac8cf1ea9f4/pandas_usaddress-0.21.tar.gz
+BuildArch: noarch
+
+Requires: python3-pandas
+Requires: python3-usaddress
+
+%description
+# pandas-usaddress
+The usaddress library made easy with Pandas.
+
+Also supports standardizing addresses to meet USPS standards.
+
+# Installation
+
+pip install pandas-usaddress
+
+# Usage
+
+### Basic Parsing
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'])
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #Output and fields will be identical to usaddress
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'], granularity='medium', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #The standard output for usaddress has a lot of fields. The granularity parameter
+ #allows you to condense the results you get back for different types of analysis.
+ #see parameter documentation below for all granularity options.
+
+ #Addresses are often unstandardized. The same address can come as 123 1st ST, or
+ #123 First Street, etc. This can cause issues with analysis such as aggregation,
+ #or record matching. The standardize parameter attempts to standardize the address
+ #to US Postal Service (USPS) standards.
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['street1', 'street2', 'city', 'state'], granularity='single', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #You can also use pandas-usaddress to concatenate and parse multiple address lines.
+ #This can be helpful when you are working with two datasets that have different
+ #field names and you want the field names to be standardized using a specific level of
+ #granularity. It's pretty common for instance that in one dataset will concatenate
+ #address line 1 and 2, and another will not.
+
+ #You will help the parser do it's job if you try to concatenate fields in approximately
+ #same order that you would write them on an envelope.
+
+ #In this instance, we are taking multiple address fields and converting them into a
+ #single address line. That's fine to do!
+
+
+
+
+
+
+%package -n python3-pandas-usaddress
+Summary: The usaddress library made easy with Pandas.
+Provides: python-pandas-usaddress
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-pandas-usaddress
+# pandas-usaddress
+The usaddress library made easy with Pandas.
+
+Also supports standardizing addresses to meet USPS standards.
+
+# Installation
+
+pip install pandas-usaddress
+
+# Usage
+
+### Basic Parsing
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'])
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #Output and fields will be identical to usaddress
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'], granularity='medium', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #The standard output for usaddress has a lot of fields. The granularity parameter
+ #allows you to condense the results you get back for different types of analysis.
+ #see parameter documentation below for all granularity options.
+
+ #Addresses are often unstandardized. The same address can come as 123 1st ST, or
+ #123 First Street, etc. This can cause issues with analysis such as aggregation,
+ #or record matching. The standardize parameter attempts to standardize the address
+ #to US Postal Service (USPS) standards.
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['street1', 'street2', 'city', 'state'], granularity='single', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #You can also use pandas-usaddress to concatenate and parse multiple address lines.
+ #This can be helpful when you are working with two datasets that have different
+ #field names and you want the field names to be standardized using a specific level of
+ #granularity. It's pretty common for instance that in one dataset will concatenate
+ #address line 1 and 2, and another will not.
+
+ #You will help the parser do it's job if you try to concatenate fields in approximately
+ #same order that you would write them on an envelope.
+
+ #In this instance, we are taking multiple address fields and converting them into a
+ #single address line. That's fine to do!
+
+
+
+
+
+
+%package help
+Summary: Development documents and examples for pandas-usaddress
+Provides: python3-pandas-usaddress-doc
+%description help
+# pandas-usaddress
+The usaddress library made easy with Pandas.
+
+Also supports standardizing addresses to meet USPS standards.
+
+# Installation
+
+pip install pandas-usaddress
+
+# Usage
+
+### Basic Parsing
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'])
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #Output and fields will be identical to usaddress
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['address_field'], granularity='medium', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #The standard output for usaddress has a lot of fields. The granularity parameter
+ #allows you to condense the results you get back for different types of analysis.
+ #see parameter documentation below for all granularity options.
+
+ #Addresses are often unstandardized. The same address can come as 123 1st ST, or
+ #123 First Street, etc. This can cause issues with analysis such as aggregation,
+ #or record matching. The standardize parameter attempts to standardize the address
+ #to US Postal Service (USPS) standards.
+
+### Parsing with Address Standardization
+
+ import pandas as pd
+ import pandas_usaddress
+
+ #load dataframe
+ df = pd.read_csv('test_file.csv')
+
+ #initiate usaddress
+ df = pandas_usaddress.tag(df, ['street1', 'street2', 'city', 'state'], granularity='single', standardize=True)
+
+ #send output to csv
+ df.to_csv('parsed_output.csv')
+
+
+ #------------------------------additional details------------------------------
+
+ #You can also use pandas-usaddress to concatenate and parse multiple address lines.
+ #This can be helpful when you are working with two datasets that have different
+ #field names and you want the field names to be standardized using a specific level of
+ #granularity. It's pretty common for instance that in one dataset will concatenate
+ #address line 1 and 2, and another will not.
+
+ #You will help the parser do it's job if you try to concatenate fields in approximately
+ #same order that you would write them on an envelope.
+
+ #In this instance, we are taking multiple address fields and converting them into a
+ #single address line. That's fine to do!
+
+
+
+
+
+
+%prep
+%autosetup -n pandas-usaddress-0.21
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-pandas-usaddress -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.21-1
+- Package Spec generated