{
"info": {
"author": "Anders Innovations",
"author_email": "support@anders.fi",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "SmartShip API\n=============\n\nPython library to interact with the Posti SmartShip / Unifaun Online API.\n\nTODO\n----\n\n* Docs\n* Implement remaining attributes in Shipment as per schema\n* Add logging where necessary\n\nCompatibility\n-------------\n\n* Python 2.7+ or Python 3.4+\n\nUsage\n-----\n\nCreating shipments\n~~~~~~~~~~~~~~~~~~\n\nThis API supports the Smartship Shipments api for creating shipments and\nthen downloading the generated PDF's.\n\nCarriers\n''''''''\n\nThere are methods for certain carriers like Posti to cover more common use\ncases. To create a shipment for the Posti carrier, for example:\n\n.. code:: python\n\n from smartship.carriers.posti import create_shipment\n receiver = {\n \"name\": \"Anders Innovations\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"address1\": \"Iso Roobertinkatu 20-22\",\n \"zipcode\": \"00120\"\n }\n sender = {\n \"quickId\": \"1\",\n }\n agent = {\n \"quickId\": \"2\",\n }\n shipment = create_shipment(\n \"12345\", # Posti customer number\n \"PO2102\", # Service ID\n receiver,\n sender,\n [{\"copies\": 1}], # Parcels\n agent=agent, # Optional pickup point\n pdf_config=pdf_config, # Optional custom PDF config\n )\n\nSee more documentation in ``smartship.carriers.posti`` module.\n\nPDF Config\n''''''''''\n\nIf you want to pass a custom ``pdf_config``, it should have the following structure:\n\n.. code:: python\n\n {\n \"target1Media\": \"laser-a5\",\n \"target1YOffset\": 0,\n \"target1XOffset\": 0\n }\n\nWith ``\"target1Media\"`` being one of the following options::\n\n \"laser-a5\"\n \"laser-2a5\"\n \"laser-ste\"\n \"thermo-se\"\n \"thermo-225\"\n\nYou can customize the offset with ``\"target1YOffset\"`` and ``\"target1XOffset\"`` parameters.\n\nClient\n~~~~~~\n\nTo send shipments and use other API resources, you need a client.\nInitialize the client as follows with username and secret tokens. Create\nyour API tokens in the `Unifaun Online portal\n`_.\n\n.. code:: python\n\n from smartship import Client\n client = Client(\"username\", \"secret\")\n\nSending shipments\n'''''''''''''''''\n\nSend a shipment as follows:\n\n.. code:: python\n\n response = client.send_shipment(shipment)\n\nResponse will be a special ``ShipmentResponse`` wrapping a ``HttpResponse`` object with response code and\nJSON content in ``response.data``.\n\nStatus codes:\n\n* 201 - Shipment was created OK\n* 422 - Validation error with the data. Raises a ``ShipmentResponseError``.\n\nFor errors see ``error.response.json()`` for details from Unifaun Online API.\n\nShipment address PDF slips\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nOnce you have the response retrieve associated PDF data as follows:\n\n.. code:: python\n\n data = response.get_pdfs(client) # Client needed in case of additional fetching\n pdf_data = data[0][0] # Simplest case with a single shipment with a single parcel\n\nAgents\n~~~~~~\n\nRetrieve a list of agents (pickup points) as follows:\n\n.. code:: python\n\n agents = client.get_agents(\"FI\", \"ITELLASP\", \"Iso Roobertinkatu 20-22\", \"00120\")\n\nResponse will be an ``Agents`` object that can be iterated over for individual agent data.\n\nLocations\n~~~~~~~~~\n\nAs the above agents method is a paid service we also provide an interface to the Posti location service API.\n\n.. code:: python\n\n from smartship.carriers.posti import get_locations\n locations = get_locations(country_code=\"FI\", zipcode=\"00120\")\n\nResponse will be a ``Locations`` object that can be iterated over for individual location data.\n\nAdvanced usage\n~~~~~~~~~~~~~~\n\nSee full Smartship `API documentation\n`_ for a full list of attributes\nthat shipments can be given. All of these are supported when using\n``smartship.shipments.Shipment`` directly. Import the relevant objects\nfrom ``smartship.objects`` and pass them to the ``Shipment`` object.\n\nDevelopment\n-----------\n\nRequirements\n~~~~~~~~~~~~\n\nInstall the requirements to a virtual environment with::\n\n pip install -U setuptools pip # These should be up to date\n pip install -r requirements-dev.txt\n\nTests\n~~~~~\n\nTo test in the current virtual environment, run::\n\n py.test\n\nTo check the coding style, run::\n\n flake8\n\nTo test all supported environments, run::\n\n tox\n\nBuilding documentation\n~~~~~~~~~~~~~~~~~~~~~~\n\nBuild the documentation with::\n\n sphinx-build -b html docs docs/_build\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "https://github.com/andersinno/smartship/releases",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/andersinno/smartship",
"keywords": "smartship,posti",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "smartship",
"package_url": "https://pypi.org/project/smartship/",
"platform": "",
"project_url": "https://pypi.org/project/smartship/",
"project_urls": {
"Download": "https://github.com/andersinno/smartship/releases",
"Homepage": "https://github.com/andersinno/smartship"
},
"release_url": "https://pypi.org/project/smartship/1.2.0/",
"requires_dist": [
"attrs (<18,>=17.3.0)",
"enum34 (>=1.1.6,<2)",
"jsonschema (<3,>=2.0)",
"requests (>=2.11.1,<3)",
"simplejson (<4,>=3.10.0)"
],
"requires_python": "",
"summary": "Posti SmartShip API",
"version": "1.2.0"
},
"last_serial": 4308222,
"releases": {
"1.1.1": [
{
"comment_text": "",
"digests": {
"md5": "a9c7d5c6170e49f5d53064fffcf2b567",
"sha256": "aa468ce28341ceb4be5309e3eb73be657fd766ceb191d367570e80196a18c5b1"
},
"downloads": -1,
"filename": "smartship-1.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a9c7d5c6170e49f5d53064fffcf2b567",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 16893,
"upload_time": "2018-08-29T09:59:02",
"url": "https://files.pythonhosted.org/packages/d0/cd/77564b27086002a8eee5356b19bc234ba2ec5c669676cf45ff45f91983aa/smartship-1.1.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "3defd37cfb6055c138d37f85da0baba4",
"sha256": "b025817e5136bd24314ff26790e57b862de65a68ca8e6c3df92d7f0ee8edb8a1"
},
"downloads": -1,
"filename": "smartship-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "3defd37cfb6055c138d37f85da0baba4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14385,
"upload_time": "2018-08-29T09:59:03",
"url": "https://files.pythonhosted.org/packages/de/93/5b69fcb2fb48cdc0fb6fc3312289b2da671aa52d01786906be123d06956c/smartship-1.1.1.tar.gz"
}
],
"1.1.2": [
{
"comment_text": "",
"digests": {
"md5": "404bc76a8e8502e25ee5d18d25656848",
"sha256": "e0753fa2ca56d47a33fc226942c9e2591595570246620f4e912db412f58b7ee0"
},
"downloads": -1,
"filename": "smartship-1.1.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "404bc76a8e8502e25ee5d18d25656848",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 16888,
"upload_time": "2018-08-29T10:13:15",
"url": "https://files.pythonhosted.org/packages/0e/0d/dbf0390486afd809ac3d0d9e05a3c6ba3f1f343b4d40e14ef7db775f5b9e/smartship-1.1.2-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "990b5676208b16f255b7948a39502899",
"sha256": "e2f6a71e0f7c7fdfd83adbbe747b431c6a7611b3b81def49bcb5135c1f8a99ac"
},
"downloads": -1,
"filename": "smartship-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "990b5676208b16f255b7948a39502899",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14383,
"upload_time": "2018-08-29T10:13:17",
"url": "https://files.pythonhosted.org/packages/e3/9e/383dfafd3208ace5d51af9d833b7740c2bac86a6d6a90e851b2cd37a9130/smartship-1.1.2.tar.gz"
}
],
"1.2.0": [
{
"comment_text": "",
"digests": {
"md5": "db637664fb376ede9c485b5cf5aeed01",
"sha256": "f4b9875b21cdd53644470eaa568502eb77b365705a4aad2ce1eee013491d2b98"
},
"downloads": -1,
"filename": "smartship-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "db637664fb376ede9c485b5cf5aeed01",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 19729,
"upload_time": "2018-09-25T11:33:24",
"url": "https://files.pythonhosted.org/packages/bf/9b/e8fe12ef4fd47ad1f210ef7f05e04611601dce0a2f9cad30064646764991/smartship-1.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "2f5e03fbf5c08cc039c807337cfc5efe",
"sha256": "dc0597d9c1dbeb4bf65eb0fccde2f8908e83b2975448314ea6436be9c3467454"
},
"downloads": -1,
"filename": "smartship-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "2f5e03fbf5c08cc039c807337cfc5efe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14269,
"upload_time": "2018-09-25T11:33:26",
"url": "https://files.pythonhosted.org/packages/3d/bb/d0b2d83d9027fff303b7cebcc1ab28a5faa3e5384114880ac0b8c6a482b6/smartship-1.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "db637664fb376ede9c485b5cf5aeed01",
"sha256": "f4b9875b21cdd53644470eaa568502eb77b365705a4aad2ce1eee013491d2b98"
},
"downloads": -1,
"filename": "smartship-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "db637664fb376ede9c485b5cf5aeed01",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 19729,
"upload_time": "2018-09-25T11:33:24",
"url": "https://files.pythonhosted.org/packages/bf/9b/e8fe12ef4fd47ad1f210ef7f05e04611601dce0a2f9cad30064646764991/smartship-1.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "2f5e03fbf5c08cc039c807337cfc5efe",
"sha256": "dc0597d9c1dbeb4bf65eb0fccde2f8908e83b2975448314ea6436be9c3467454"
},
"downloads": -1,
"filename": "smartship-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "2f5e03fbf5c08cc039c807337cfc5efe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14269,
"upload_time": "2018-09-25T11:33:26",
"url": "https://files.pythonhosted.org/packages/3d/bb/d0b2d83d9027fff303b7cebcc1ab28a5faa3e5384114880ac0b8c6a482b6/smartship-1.2.0.tar.gz"
}
]
}