{ "info": { "author": "Rob Hoelz", "author_email": "rob.hoelz@skinnycorp.com", "bugtrack_url": null, "classifiers": [], "description": "# Spoke\n\nSpoke (formerly known as Case-Mate) is a company that makes cases for phones\nand tablets (ed: among other things).\n\nThey are kind enough to expose an API for others to use, and\nthis is a Python library that interacts with that API. The API is XML-based (but\nnot SOAP). The structure of this library is meant to reflect the structure of the\nAPI calls and closely as possible; you should be able to read the API docs and use\nthis library comfortably. Only parameters that do not change between requests are\nomitted from each call; for example:\n\n## Example API XML:\n\n```xml\n\n\nCustomerName\nNew\n1234554321123450\n\n jpg\n http://MyLogoImage.com/logo.jpg\n\n\n CustomerOrderNumber\n FC\n \n jpg\n http://PackingSlipImage.com/packslip.jpg\n \n \n \n Packaging\n Custom Sticker\n \n \n \n John\n Customer\n 1 Main Street\n \n Atlanta\n GA\n 30084\n US\n 11/08/2011\n 404-555-9000\n PO\n Thanks for your purchase!\n \n \n \n \n \n \n \n \n \n Yes\n $\n 245\n 450\n 500\n \n \n \n \n 10001\n iph4bt\n 1\n \n jpg\n http://qcimage.com\n \n \n $\n 1000\n 0\n \n \n \n 10002\n iph4tough\n 1\n \n tiff\n http://printimage.com\n \n \n jpg\n http://qcimage.com\n \n \n $\n 1500\n 500\n \n \n \n Packaging\n Other Custom Sticker\n \n \n \n \n\n\n```\n\n## Equivalent Python Code:\n\n### Setup\n\n```python\nimport spoke\n\ns = spoke.Spoke(\n Customer='CustomerName',\n Key='1234554321123450',\n Logo={\n 'ImageType' : 'jpg',\n 'Url' : 'http://threadless.com/logo.jpg',\n },\n)\n\n### Create a new order:\n\nresult = s.new(\n OrderId='CustomerOrderNumber',\n ShippingMethod='FirstClass',\n PackSlip={\n 'ImageType' : 'jpg',\n 'Url' : 'http://PackingSlipImage.com/packslip.jpg',\n },\n Comments=[{\n 'Type' : 'Packaging',\n 'CommentText' : 'Custom Sticker',\n }],\n OrderInfo={\n 'FirstName' : 'John',\n 'LastName' : 'Customer',\n 'Address1' : '1 Main Street',\n 'City' : 'Atlanta',\n 'State' : 'GA',\n 'PostalCode' : '30084',\n 'CountryCode' : 'US',\n 'OrderDate' : '11/08/2011',\n 'PhoneNumber' : '4045559000',\n 'PurchaseOrderNumber' : 'PO',\n 'GiftMessage' : 'Thanks for your purchase',\n 'Prices' : {\n 'DisplayOnPackingSlip' : 'Yes',\n 'CurrencySymbol' : '$',\n 'TaxCents' : '245',\n 'ShippingCents' : '450',\n 'DiscountCents' : '500',\n },\n },\n Cases=[{\n 'CaseId' : '10001',\n 'CaseType' : 'iph4bt',\n 'Quantity' : '1',\n 'QcImage' : {\n 'ImageType' : 'jpg',\n 'Url' : 'http://qcimage.com',\n },\n 'Prices' : {\n 'CurrencySymbol' : '$',\n 'RetailCents' : '1000',\n 'DiscountCents' : '0',\n },\n }, {\n 'CaseId' : '10002',\n 'CaseType' : 'iph4tough',\n 'Quantity' : '1',\n 'PrintImage' : {\n 'ImageType' : 'tiff',\n 'Url' : 'http://printimage.com',\n },\n 'QcImage' : {\n 'ImageType' : 'jpg',\n 'Url' : 'http://qcimage.com',\n },\n 'Prices' : {\n 'CurrencySymbol' : '$',\n 'RetailCents' : '1500',\n 'DiscountCents' : '500',\n },\n 'Comments' : {\n 'Type' : 'Packaging',\n 'CommentText' : 'Other Custom Sticker',\n }\n }]\n)\n```\n\n### Update shipping info:\n\n```python\ns.update(\n OrderId='CustomerOrderNumber',\n OrderInfo={\n 'FirstName': 'Bob',\n # ...\n }\n)\n```\n\n### Cancel an order:\n\n```python\ns.cancel('CustomerOrderNumber')\n```\n\n# Conventions\n\nUpper-case keyword arguments are passed directly to the API; lower-case ones\nfiddle with the library's configuration. Strings or numbers may be used.\nDate objects may be specified for OrderDate, and instead of the two-character\nshorthand specified by the API, ShippingMethod may be specified as a more human\nreadable string.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Threadless/python-spoke", "keywords": "spoke", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Python-Spoke", "package_url": "https://pypi.org/project/Python-Spoke/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Python-Spoke/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Threadless/python-spoke" }, "release_url": "https://pypi.org/project/Python-Spoke/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "API bindings for Spoke API", "version": "1.0.0" }, "last_serial": 1115556, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "44539da3bde4feda8a5fdd7820c591a0", "sha256": "387135d3c7d13525deeb44488d26601789d1607e9878e621493872459ed4b7e8" }, "downloads": -1, "filename": "Python-Spoke-1.0.0.tar.gz", "has_sig": false, "md5_digest": "44539da3bde4feda8a5fdd7820c591a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7046, "upload_time": "2014-06-05T14:52:05", "url": "https://files.pythonhosted.org/packages/36/0a/6f871b6a4d1dd4869029b1542e89711660eb626e6e98570196f439562643/Python-Spoke-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "44539da3bde4feda8a5fdd7820c591a0", "sha256": "387135d3c7d13525deeb44488d26601789d1607e9878e621493872459ed4b7e8" }, "downloads": -1, "filename": "Python-Spoke-1.0.0.tar.gz", "has_sig": false, "md5_digest": "44539da3bde4feda8a5fdd7820c591a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7046, "upload_time": "2014-06-05T14:52:05", "url": "https://files.pythonhosted.org/packages/36/0a/6f871b6a4d1dd4869029b1542e89711660eb626e6e98570196f439562643/Python-Spoke-1.0.0.tar.gz" } ] }