Code Monkey home page Code Monkey logo

libshipkore's Introduction

libshipkore

Shipkore tracking library & CLI to track packages across couriers. This is first Open source product of Innerkore Technologies. We are commited to do things differently.

Installation

pip install libshipkore

Usage

As CLI

libshipkore providers

To get all the supported Couriers.

libshipkore track

To track a package in supported Couriers. It will ask for 2 things

  • Provider (Couries)
  • Waybill (Tracking number)

As Library

from libshipkore.track import get_track_data
from libshipkore.track import get_providers

get_track_data provides tracking utility to track package in supported Couriers. get_providers provides list of all the supported logistics providers.

As Code (like cloning this Repo)

Install poetry first. Then, to install dependencies,

poetry install

To run track command,

poetry run python -m libshipkore.cli track --provider zinc --waybill ZPYAA0073001334YQ

Features

  • Tracking through CLI
  • Embeddable as library
  • Give standard response
  • Convert Courier's statuses to standard statuses
  • Convert date & time to timezone specific ISO Format

Supported Statuses

  • InfoReceived
  • InTransit
  • OutForDelivery
  • AttemptFail
  • Delivered
  • AvailableForPickup
  • Exception
  • ReverseDelivered
  • ReverseOutForDelivery
  • ReverseInTransit

Supported Couriers

and many many more see here

Response Schema

{
"title": "Track",
"type": "object",
"properties": {
    "checkpoints": {
    "title": "Checkpoints",
    "type": "array",
    "items": {
        "$ref": "#/definitions/Checkpoint"
    }
    },
    "waybill": {
    "title": "Waybill",
    "type": "string"
    },
    "provider": {
    "title": "Provider",
    "type": "string"
    },
    "status": {
    "default": "Exception",
    "allOf": [
        {
        "$ref": "#/definitions/StatusChoice"
        }
    ]
    },
    "substatus": {
    "title": "Substatus",
    "type": "string"
    },
    "estimated_date": {
    "title": "Estimated Date",
    "anyOf": [
        {
        "type": "string",
        "format": "date-time"
        },
        {
        "type": "string",
        "format": "date"
        }
    ]
    },
    "reference_no": {
    "title": "Reference No",
    "type": "string"
    },
    "package_type": {
    "title": "Package Type",
    "type": "string"
    },
    "destination": {
    "title": "Destination",
    "type": "string"
    },
    "client": {
    "title": "Client",
    "type": "string"
    },
    "consignee_address": {
    "title": "Consignee Address",
    "type": "string"
    },
    "product": {
    "title": "Product",
    "type": "string"
    },
    "receiver_name": {
    "title": "Receiver Name",
    "type": "string"
    },
    "delivered_date": {
    "title": "Delivered Date",
    "anyOf": [
        {
        "type": "string",
        "format": "date-time"
        },
        {
        "type": "string",
        "format": "date"
        }
    ]
    }
},
"required": [
    "checkpoints",
    "waybill",
    "provider"
],
"definitions": {
    "StatusChoice": {
    "title": "StatusChoice",
    "description": "An enumeration.",
    "enum": [
        "InfoReceived",
        "InTransit",
        "OutForDelivery",
        "AttemptFail",
        "Delivered",
        "AvailableForPickup",
        "Exception",
        "ReverseDelivered",
        "ReverseOutForDelivery",
        "ReverseInTransit"
    ],
    "type": "string"
    },
    "Checkpoint": {
    "title": "Checkpoint",
    "type": "object",
    "properties": {
        "slug": {
        "title": "Slug",
        "type": "string"
        },
        "city": {
        "title": "City",
        "type": "string"
        },
        "location": {
        "title": "Location",
        "type": "string"
        },
        "country_name": {
        "title": "Country Name",
        "type": "string"
        },
        "message": {
        "title": "Message",
        "type": "string"
        },
        "submessage": {
        "title": "Submessage",
        "type": "string"
        },
        "country_iso3": {
        "title": "Country Iso3",
        "type": "string"
        },
        "status": {
        "default": "Exception",
        "allOf": [
            {
            "$ref": "#/definitions/StatusChoice"
            }
        ]
        },
        "substatus": {
        "title": "Substatus",
        "type": "string"
        },
        "checkpoint_time": {
        "title": "Checkpoint Time",
        "anyOf": [
            {
            "type": "string",
            "format": "date-time"
            },
            {
            "type": "string",
            "format": "date"
            }
        ]
        },
        "state": {
        "title": "State",
        "type": "string"
        },
        "zip": {
        "title": "Zip",
        "type": "string"
        }
    },
    "required": [
        "slug",
        "checkpoint_time"
    ]
    }
}
}

Credits

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

libshipkore's People

Contributors

gagandeep avatar innerkore avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libshipkore's Issues

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.