This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# Spoke

Spoke (formerly known as Case-Mate) is a company that makes cases for phones
and tablets (ed: among other things).

They are kind enough to expose an API for others to use, and
this is a Python library that interacts with that API. The API is XML-based (but
not SOAP). The structure of this library is meant to reflect the structure of the
API calls and closely as possible; you should be able to read the API docs and use
this library comfortably. Only parameters that do not change between requests are
omitted from each call; for example:

## Example API XML:

```xml

<request>
<customer>CustomerName</customer>
<requesttype>New</requesttype>
<key>1234554321123450</key>
<logo>
<imagetype>jpg</imagetype>
<url>http://MyLogoImage.com/logo.jpg</url>
</logo>
<order>
<orderid>CustomerOrderNumber</orderid>
<shippingmethod>FC</shippingmethod>
<packslip>
<imagetype>jpg</imagetype>
<url>http://PackingSlipImage.com/packslip.jpg</url>
</packslip>
<comments>
<comment>
<type>Packaging</type>
<commenttext>Custom Sticker</commenttext>
</comment>
</comments>
<orderinfo>
<firstname>John</firstname>
<lastname>Customer</lastname>
<address1>1 Main Street</address1>
<address2></address2>
<city>Atlanta</city>
<state>GA</state>
<postalcode>30084</postalcode>
<countrycode>US</countrycode>
<orderdate>11/08/2011</orderdate>
<phonenumber>404-555-9000</phonenumber>
<purchaseordernumber>PO</purchaseordernumber>
<giftmessage>Thanks for your purchase!</giftmessage>
<packslipcustominfo>
<text1></text1>
<text2></text2>
<text3></text3>
<text4></text4>
<text5></text5>
<text6></text6>
</packslipcustominfo>
<prices>
<displayonpackingslip>Yes</displayonpackingslip>
<currencysymbol>$</currencysymbol>
<taxcents>245</taxcents>
<shippingcents>450</shippingcents>
<discountcents>500</discountcents>
</prices>
</orderinfo>
<cases>
<caseinfo>
<caseid>10001</caseid>
<casetype>iph4bt</casetype>
<quantity>1</quantity>
<qcimage>
<imagetype>jpg</imagetype>
<url>http://qcimage.com</url>
</qcimage>
<prices>
<currencysymbol>$</currencysymbol>
<retailcents>1000</retailcents>
<discountcents>0</discountcents>
</prices>
</caseinfo>
<caseinfo>
<caseid>10002</caseid>
<casetype>iph4tough</casetype>
<quantity>1</quantity>
<printimage>
<imagetype>tiff</imagetype>
<url>http://printimage.com</url>
</printimage>
<qcimage>
<imagetype>jpg</imagetype>
<url>http://qcimage.com</url>
</qcimage>
<prices>
<currencysymbol>$</currencysymbol>
<retailcents>1500</retailcents>
<discountcents>500</discountcents>
</prices>
<comments>
<comment>
<type>Packaging</type>
<commenttext>Other Custom Sticker</commenttext>
</comment>
</comments>
</caseinfo>
</cases>
</order>
</request>
```

## Equivalent Python Code:

### Setup

```python
import spoke

s = spoke.Spoke(
Customer='CustomerName',
Key='1234554321123450',
Logo={
'ImageType' : 'jpg',
'Url' : 'http://threadless.com/logo.jpg'
},
)

### Create a new order:

result = s.new(
OrderId='CustomerOrderNumber',
ShippingMethod='FirstClass',
PackSlip={
'ImageType' : 'jpg',
'Url' : 'http://PackingSlipImage.com/packslip.jpg'
},
Comments=[{
'Type' : 'Packaging',
'CommentText' : 'Custom Sticker',
}],
OrderInfo={
'FirstName' : 'John',
'LastName' : 'Customer',
'Address1' : '1 Main Street',
'City' : 'Atlanta',
'State' : 'GA',
'PostalCode' : '30084',
'CountryCode' : 'US',
'OrderDate' : '11/08/2011',
'PhoneNumber' : '4045559000',
'PurchaseOrderNumber' : 'PO',
'GiftMessage' : 'Thanks for your purchase',
'Prices' : {
'DisplayOnPackingSlip' : 'Yes',
'CurrencySymbol' : '$',
'TaxCents' : '245',
'ShippingCents' : '450',
'DiscountCents' : '500',
},
},
Cases=[{
'CaseId' : '10001',
'CaseType' : 'iph4bt',
'Quantity' : '1',
'QcImage' : {
'ImageType' : 'jpg',
'Url' : 'http://qcimage.com',
},
'Prices' : {
'CurrencySymbol' : '$',
'RetailCents' : '1000',
'DiscountCents' : '0',
},
}, {
'CaseId' : '10002',
'CaseType' : 'iph4tough',
'Quantity' : '1',
'PrintImage' : {
'ImageType' : 'tiff',
'Url' : 'http://printimage.com',
},
'QcImage' : {
'ImageType' : 'jpg',
'Url' : 'http://qcimage.com',
},
'Prices' : {
'CurrencySymbol' : '$',
'RetailCents' : '1500',
'DiscountCents' : '500',
},
'Comments' : {
'Type' : 'Packaging',
'CommentText' : 'Other Custom Sticker',
}
}]
)
```

### Update shipping info:

```python
s.update(
OrderId='CustomerOrderNumber',
OrderInfo={
'FirstName': 'Bob',
# ...
}
)
```

### Cancel an order:

```python
s.cancel('CustomerOrderNumber')
```

# Conventions

Upper-case keyword arguments are passed directly to the API; lower-case ones
fiddle with the library's configuration. Strings or numbers may be used.
Date objects may be specified for OrderDate, and instead of the two-character
shorthand specified by the API, ShippingMethod may be specified as a more human
readable string.
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Python-Spoke-1.0.0.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Jun 5, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting