Skip to main content


Project description Documentation Status Updates

trackr is a lightweight Python lib to access carriers’ tracking information.


pip install trackr

Works with Python 2.7, 3.3, 3.4 and 3.5.


from trackr import Trackr

package = Trackr.track('ect', 'PN871429404BR')

for t in package.tracking_info:
    print t.location, t.status

Or also using Trackr cli:

$ trackr --carrier=ect --object-id=PN871429404BR

Available carriers

  • ect (brazilian “Correios”)
  • fake (for testing purposes)


Data is retrieved from Correios using its SOAP webservice. For that you’ll need an username and password. Get in touch with your ECT representative to gain acess.

The easiest way to provide the credentials is exporting as env variable:


You can also pass a function keyword args:

package = Trackr.track('ect', 'PN871429404BR', ect_username='**', ect_password='**')


Fake carrier is meant to be used when testing and developing integrations. It will always return as package found with 4 tracking info rows. Example

$ trackr --carrier=fake --object-id=123456789
Package found!
2017-04-23 15:12:23.521052 - City 1 - In transit 1
2017-04-23 15:12:23.521075 - City 2 - In transit 2
2017-04-23 15:12:23.521081 - City 3 - In transit 3
2017-04-23 15:12:23.521086 - City 4 - In transit 4

Integrating a new carrier

To add a new carrier, inherit carriers.base.BaseCarrier and fillout the track() method, it must return a carriers.base.Package instance. See an example below:

from datetime import datetime
from .base import BaseCarrier

class MyOwnCarrier(BaseCarrier):
    id = 'mycarrier'
    name = 'My Carrier'

    def track(self, object_id):

        # ... fetch data from carrier's data source

        package = self.create_package(
            service_name='Express service',

            date=datetime(2017, 1, 1, 10, 00),
            location='Last Location',
            status='In transit to another location'
            description='Get ready!',

            location='Current Location',

        return package

Then update the carrier mapping on trackr/carriers/ (this should be improved with some autodiscover feature). Remember to write tests!


This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for trackr, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size trackr-0.1.1-py2.py3-none-any.whl (6.7 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size trackr-0.1.1.tar.gz (17.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page