From c4bf1fc3ad20762d764a81120efd29ac194a6c03 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 31 Mar 2020 23:43:08 -0700 Subject: [PATCH 1/2] Adding Revision element to address validation for more metadata. --- usps/usps.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usps/usps.py b/usps/usps.py index 63a4fc7..973c697 100644 --- a/usps/usps.py +++ b/usps/usps.py @@ -51,8 +51,10 @@ def create_label(self, *args, **kwargs): class AddressValidate(object): - def __init__(self, usps, address): + def __init__(self, usps, address, with_revision=False): xml = etree.Element('AddressValidateRequest', {'USERID': usps.api_user_id}) + if with_revision: + etree.SubElement(xml, 'Revision').text = "1" _address = etree.SubElement(xml, 'Address', {'ID': '0'}) address.add_to_xml(_address, prefix='', validate=True) From b0bf5b89222d64be7fbddc7aee260c4eb4324002 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 31 Mar 2020 23:56:50 -0700 Subject: [PATCH 2/2] Minor version update --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cba97a8..e5f9341 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='usps-api', - version='0.4', + version='0.4.1', author='Tobin Brown', author_email='tobin@brobin.me', packages=['usps'], @@ -34,4 +34,4 @@ install_requires=['requests', 'lxml', 'xmltodict'], tests_require=['coverage', 'mock'], zip_safe=False, -) \ No newline at end of file +)