python-roadie


Namepython-roadie JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/fbanu95/python-roadie
SummaryPython client for roadie API
upload_time2022-12-13 18:33:49
maintainer
docs_urlNone
authorFarhath Banu
requires_python>=3.7,<4.0
license
keywords roadie-api python-client roadie-python-client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Roadie API Client

### Installing

```bash
pip install python-roadie
```

### Usage

```python
from roadie import APIClient


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

### Resources

#### Shipments

_Create shipment_

```python
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
```python

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

```python
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`


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fbanu95/python-roadie",
    "name": "python-roadie",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "roadie-api,python-client,roadie-python-client",
    "author": "Farhath Banu",
    "author_email": "farhath@proxyroot.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/d5/a7344c559c8529f6182592b242f78f10d2efd35a3530501d3658e86fd16e/python_roadie-1.0.1.tar.gz",
    "platform": null,
    "description": "# Roadie API Client\n\n### Installing\n\n```bash\npip install python-roadie\n```\n\n### Usage\n\n```python\nfrom roadie import APIClient\n\n\nclient = APIClient(token=\"YOUR-AUTH-TOKEN\")\n```\n\n### Resources\n\n#### Shipments\n\n_Create shipment_\n\n```python\nfrom roadie.types import (\n    Contact,\n    Item,\n    Address,\n    Location,\n    TimeWindow,\n    ShipmentRequest,\n    ShipmentUpdateRequest,\n    DeliveryOptions,\n)\nfrom datetime import datetime, timedelta\n\n\nshipment_request = ShipmentRequest(\n    reference_id=\"ABCDEFG12345\",\n    idempotency_key=\"d6f9d5bb-1ba1-48d9-9125-6a61490a5ca5\",\n    alternate_id_1=\"111\",\n    alternate_id_2=\"222\",\n    description=\"General shipment description.\",\n    items=[\n        Item(\n            description=\"Item description\",\n            length=1.0,\n            width=1.0,\n            height=1.0,\n            weight=1.0,\n            quantity=1,\n            value=20,\n        )\n    ],\n    pickup_location=Location(\n        address=Address(\n            street1=\"123 Main Street\",\n            city=\"Atlanta\",\n            state=\"GA\",\n            zip=\"30305\",\n        ),\n        contact=Contact(\n            name=\"Origin Contact\",\n            phone=\"4049999999\",\n        ),\n        notes=None,\n    ),\n    delivery_location=Location(\n        address=Address(\n            street1=\"123 Main Street\",\n            city=\"Atlanta\",\n            state=\"GA\",\n            zip=\"30305\",\n        ),\n        contact=Contact(\n            name=\"Origin Contact\",\n            phone=\"4049999999\",\n        ),\n        notes=None,\n    ),\n    pickup_after=datetime.now() + timedelta(hours=4),\n    deliver_between=TimeWindow(\n        start=datetime.now() + timedelta(hours=4),\n        end=datetime.now() + timedelta(hours=8)\n    ),\n    options=DeliveryOptions(\n        signature_required=True,\n        notifications_enabled=False,\n        over_21_required=False,\n        extra_compensation=5.0,\n        trailer_required=False,\n        decline_insurance=True,\n    ),\n)\n\nclient.shipments.create_shipment(shipment_request)\n```\n\nSimilarly you can do other operations using the shipments resource\n```python\n\nclient.shipments.get_shipment(123)\n\nclient.shipments.list_shipments(ids=[123, 444], reference_ids=[\"someref-id\"])\n\nclient.shipments.update_shipment(123, shipment_update_request)\n# shipment_update_request is of type ShipmentUpdateRequest\n\nclient.shipments.cancel_shipment(123, code=\"item_not_ready\", comment=\"Its not ready to be picked\")\n\nclient.shipments.tip_driver(123, 10.00)\n\nclient.shipments.rate_driver(123, 10)\n\nclient.shipments.get_signature_image(123)\n\nclient.shipments.get_pickup_image(123)\n\nclient.shipments.get_delivery_image(123)\n```\n#### Estimates\n\n```python\nclient.estimates.create_estimate(estimate_request)\n# estimate_request is of type EstimateRequest\n```\n\n### Contributing\n\n- We use poetry for building and publishing our package to pypi\n- We use pytest for running tests\n- To add more resources simply create a file in resource folder and start implementing\n- Require tests and approval before merging to main\n\n### Authors\n\n- **Farhath Banu** `farhath@proxyroot.com` `Owner`\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python client for roadie API",
    "version": "1.0.1",
    "split_keywords": [
        "roadie-api",
        "python-client",
        "roadie-python-client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "bdfcc7097d76105c0c707b1d8a932648",
                "sha256": "c8d4e55896bdfd3ef58fc1fff35ddccc3f2858bd7f2c6e76686d5ed74a0a4d76"
            },
            "downloads": -1,
            "filename": "python_roadie-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bdfcc7097d76105c0c707b1d8a932648",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 5342,
            "upload_time": "2022-12-13T18:33:47",
            "upload_time_iso_8601": "2022-12-13T18:33:47.887635Z",
            "url": "https://files.pythonhosted.org/packages/f8/83/ae77efb56ab23787ced8df03f1ff8988bf44ea76557c6db3ac25c38d4eb6/python_roadie-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4b36698b4d702b5325fa47809274e074",
                "sha256": "a1f3f468603e67aa9c1c9993537d14dcd3ae597d6da1f490a8aee8bc5c2d04a6"
            },
            "downloads": -1,
            "filename": "python_roadie-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4b36698b4d702b5325fa47809274e074",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 4655,
            "upload_time": "2022-12-13T18:33:49",
            "upload_time_iso_8601": "2022-12-13T18:33:49.040787Z",
            "url": "https://files.pythonhosted.org/packages/6a/d5/a7344c559c8529f6182592b242f78f10d2efd35a3530501d3658e86fd16e/python_roadie-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-13 18:33:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "fbanu95",
    "github_project": "python-roadie",
    "lcname": "python-roadie"
}
        
Elapsed time: 0.04344s