Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ClassicUPS3 NameError: name 'unicode' is not defined

I am trying to use the ClassicUPS3 library to have a UPS API tracker. When I run the code I am getting an error message saying, "NameError: name ‘unicode’ is not defined". I am not sure if it something to do with the UPS library or if it is something in the response that is throwing me this error.

from ClassicUPS3 import UPSConnection


# Credentials obtained from the UPS website
UPS = UPSConnection('API-KEY',
                'User',
                'Password',
                debug=True)      # Use the UPS sandbox API rather than prod




tracking = UPS.tracking_info('1ZXXXXXXXXXXX')


print(tracking.ship_status)
print(tracking.in_transit)
print(tracking.delivered)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Looking at the source code here, it seems that ClassicalUPS3 relies on a specific format that must be extracted from an XML file, then converted to a dict, then processed.

I tried to run your example (with my own tracking number), and I also found out that the first member you refer to (ship_status) is not supported in the definition of TrackingInfo.

In short, it doesn’t look like ClassicalUPS3 is being maintained these days.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading