Skip to main content

Python client for roadie API

Project description

Roadie API Client

Installing

pip install python-roadie

Usage

from roadie import APIClient


client = APIClient(token="YOUR-AUTH-TOKEN")

Resources

Shipments

Create shipment

from roadie.types import (
    Contact,
    Item,
    Address,
    Location,
    TimeWindow,
    ShipmentRequest,
    ShipmentUpdateRequest,
    DeliveryOptions,
)
from datetime import datetime, timedelta


shipment_request = ShipmentRequest(
    reference_id="ABCDEFG12345",
    idempotency_key="d6f9d5bb-1ba1-48d9-9125-6a61490a5ca5",
    alternate_id_1="111",
    alternate_id_2="222",
    description="General shipment description.",
    items=[
        Item(
            description="Item description",
            length=1.0,
            width=1.0,
            height=1.0,
            weight=1.0,
            quantity=1,
            value=20,
        )
    ],
    pickup_location=Location(
        address=Address(
            street1="123 Main Street",
            city="Atlanta",
            state="GA",
            zip="30305",
        ),
        contact=Contact(
            name="Origin Contact",
            phone="4049999999",
        ),
        notes=None,
    ),
    delivery_location=Location(
        address=Address(
            street1="123 Main Street",
            city="Atlanta",
            state="GA",
            zip="30305",
        ),
        contact=Contact(
            name="Origin Contact",
            phone="4049999999",
        ),
        notes=None,
    ),
    pickup_after=datetime.now() + timedelta(hours=4),
    deliver_between=TimeWindow(
        start=datetime.now() + timedelta(hours=4),
        end=datetime.now() + timedelta(hours=8)
    ),
    options=DeliveryOptions(
        signature_required=True,
        notifications_enabled=False,
        over_21_required=False,
        extra_compensation=5.0,
        trailer_required=False,
        decline_insurance=True,
    ),
)

client.shipments.create_shipment(shipment_request)

Similarly you can do other operations using the shipments resource

client.shipments.get_shipment(123)

client.shipments.list_shipments(ids=[123, 444], reference_ids=["someref-id"])

client.shipments.update_shipment(123, shipment_update_request)
# shipment_update_request is of type ShipmentUpdateRequest

client.shipments.cancel_shipment(123, code="item_not_ready", comment="Its not ready to be picked")

client.shipments.tip_driver(123, 10.00)

client.shipments.rate_driver(123, 10)

client.shipments.get_signature_image(123)

client.shipments.get_pickup_image(123)

client.shipments.get_delivery_image(123)

Estimates

client.estimates.create_estimate(estimate_request)
# estimate_request is of type EstimateRequest

Contributing

  • We use poetry for building and publishing our package to pypi
  • We use pytest for running tests
  • To add more resources simply create a file in resource folder and start implementing
  • Require tests and approval before merging to main

Authors

  • Farhath Banu farhath@proxyroot.com Owner

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

python_roadie-1.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

python_roadie-1.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file python_roadie-1.0.1.tar.gz.

File metadata

  • Download URL: python_roadie-1.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Linux/5.15.0-1024-azure

File hashes

Hashes for python_roadie-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a1f3f468603e67aa9c1c9993537d14dcd3ae597d6da1f490a8aee8bc5c2d04a6
MD5 4b36698b4d702b5325fa47809274e074
BLAKE2b-256 6ad5a7344c559c8529f6182592b242f78f10d2efd35a3530501d3658e86fd16e

See more details on using hashes here.

File details

Details for the file python_roadie-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: python_roadie-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Linux/5.15.0-1024-azure

File hashes

Hashes for python_roadie-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8d4e55896bdfd3ef58fc1fff35ddccc3f2858bd7f2c6e76686d5ed74a0a4d76
MD5 bdfcc7097d76105c0c707b1d8a932648
BLAKE2b-256 f883ae77efb56ab23787ced8df03f1ff8988bf44ea76557c6db3ac25c38d4eb6

See more details on using hashes here.

Supported by

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