Package: django-owo
django-owoStartingThese instructions will allow you to install the library in your python project.Current featuresGet default payload.Create shipping.Pre-requisitosPython >= 3.7Django >= 3requests >= 2InstallationTo get the latest stable release from PyPi:pip install django-owoorFrom a buildgit clone https://gitlab.com/linets/ecommerce/oms/integrations/django-owocd {{project}}python setup.py sdistand, install in your project djangopip install {{path}}/django-owo/dist/{{tar.gz file}}Settings in django projectDJANGO_OWO = {
    'OWO': {
        'BASE_URL': '<OWO_BASE_URL>',
        'TOKEN': '<OWO_TOKEN>',
        'EMAIL': '<OWO_EMAIL>',
        'PASSWORD': '<OWO_PASSWORD>',
    },
    'SENDER': {
        'COMMERCE_ID': '<OWO_COMMERCE_ID>',
        'BRANCH_OFFICE_ID': '<OWO_BRANCH_OFFICE_ID>',
    }
}UsageCreate instance to be sentimport json
from types import SimpleNamespace

dict_ = {
    'reference': '99999',
    'delivery_date': '2018-12-06 13:00:00'
    'created_at': '12/12/21',
    'shipping_date': '12/12/21',
    'expiration_date': '26/12/21'
    'tracking_code': '6075620-1',
    'transport_guide_number': '1121632479536-01-1',
    'purchase_number': 'CLV0048146676851-1',
    'items': [
        {
            'code': 'SKU1234',
            'name': 'POLOS',
            'price': '2500',
            'qty': '2'
        },
        {
            'code': 'SKU12345',
            'name': 'SHORT',
            'price': '1500',
            'qty': '1'
        }
    ]
    'customer': {
        'first_name': 'Marcos',
        'last_name': 'Sac',
        'full_name': 'Marcos Sac',
        'phone': '932932932',
        'email': 'test@gmail.com',
        'rut': '16936195-9'
    },
    'address': {
        'street': 'ALEJANDRO VENEGAS CADIZ',
        'number': '513',
        'unit': 'DEPTO 6A',
        'full_address': 'ALEJANDRO VENEGAS CADIZ 513 DEPTO 6A'
    },
    'commune': {
        'name': 'Aisen',
        'code': '',
        'zone_code': '11201',
        'zone_post': 'WPA',
    },
    'location': {
        'code': 'MONTANDON',
        'name': 'MNN',
    },
    'region': {
        'name': 'Aysén del General Carlos Ibáñez del Campo',
        'code': '11',
        'iso_code': 'CL-XI',
    }
}

instance = json.loads(json.dumps(dict_), object_hook=lambda attr: SimpleNamespace(**attr))Get default payload:from owo.handler import OwoHandler

handler = OwoHandler()
default_data = handler.get_default_payload(<instance>)Create shipping:from owo.handler import OwoHandler

handler = OwoHandler()
default_data = handler.create_shipping(<default_data>)Get events:from owo.handler import OwoHandler

handler = OwoHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'Entregado',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_events(raw_data)

Output:
[{
    'city': 'Santiago'
    'state': 'RM',
    'description': 'Llego al almacén',
    'date': '12/12/2021'
}]Get status and if "is_delivered":from owo.handler import OwoHandler

handler = OwoHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'Entregado',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_status(raw_data)

Output:
('Entregado', True)Get shipping label:from owo.handler import OwoHandler

handler = OwoHandler()
response = handler.get_shipping_label(tracking_number)

Output:
header: {'Content-Type' : 'application/pdf'}
body: bytes