Skip to main content

Django Moova Integration

Project description

django-moova

Starting

These instructions will allow you to install the library in your python project.

Current features

  • Create shipment.
  • Get tracking info.
  • Get shipping label.

Pre-requisitos

  • Python >= 3.7
  • Django >= 3
  • requests >= 2

Installation

  1. To get the latest stable release from PyPi:
pip install corona-moova

or

  1. From a build
git clone git@gitlab.com:linets-projects/python-libraries/django-moova.git
cd {{project}}
python setup.py sdist

and, install in your project django

pip install {{path}}/django-moova/dist/{{tar.gz file}}
  1. Settings in django project
DJANGO_MOOVA = {
    'MOOVA': {
        'BASE_URL': '<MOOVA_BASE_URL>',
        'SECRET': '<MOOVA_SECRET_TOKEN>',
        'KEY': '<MOOVA_SECRET_KEY>',
        'CURRENCY': 'CLP',
        'TYPE': 'regular',
        'FLOW': 'manual',
    },
    'REMITENTE': {
        'ADDRESS': '<ADDRESS>',
        'COUNTRY': 'CHL',
        'INSTRUCTIONS': 'Call before delivery',
        'FIRST_NAME': '<FIRST_NAME>',
        'LAST_NAME': '<LAST_NAME>',
        'EMAIL': '<EMAIL>',
        'PHONE': '<PHONE>',
    },
}

Usage

  1. Create shipment:
from moova.handler import MoovaHandler

handler = MoovaHandler()

default_data = handler.get_default_payload(instance)
default_data["currency"] = "CLP" # eg. (Optional)
response = handler.create_shipping(default_data)
  1. Get tracking info:
from moova.handler import MoovaHandler

handler = MoovaHandler()

tracking_info = handler.get_tracking(<identifier>)
  1. Get shipping label:
from moova.handler import MoovaHandler

handler = MoovaHandler()

label_info = handler.get_shipping_label(<shipping_id>)

Output:
'https://moova-user-data-test.s3.amazonaws.com/etiqueta-10x15.pdf'

Project details


Download files

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

Source Distribution

corona-moova-1.0.3.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file corona-moova-1.0.3.tar.gz.

File metadata

  • Download URL: corona-moova-1.0.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for corona-moova-1.0.3.tar.gz
Algorithm Hash digest
SHA256 844b6ece7aec12c20cf0ec6517ad4b6941c5aed91e78aeee80bef7f0b52f9ca9
MD5 8d3866efd704d2a994a182f38ebe8694
BLAKE2b-256 8f5840bf0cef9586d230e7c6cf8548d390444a8ef0579ee47414ecdb0812a83e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page