-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from timotheus/enhanced-response
Enhanced response work
- Loading branch information
Showing
28 changed files
with
1,704 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
timebay.yaml | ||
build/ | ||
dist/ | ||
tkebay.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,94 @@ | ||
Welcome to the ebaysdk for Python | ||
================================= | ||
Welcome to the python ebaysdk | ||
============================= | ||
|
||
Welcome to the eBay SDK for Python. This SDK cuts development time and simplifies tasks like error handling and enables you to make Finding, Shopping, Merchandising, and Trading API calls. In Addition, the SDK comes with RSS and HTML back-end libraries. | ||
This SDK is a programmatic interface into the eBay APIs. It simplifies development and cuts development time by standardizing calls, response processing, error handling, and debugging across the Finding, Shopping, Merchandising & Trading APIs. | ||
|
||
In order to use eBay aspects of this utility you must first register with eBay to get your `eBay Developer Site`_ (see the ebay.yaml for a way to easily tie eBay credentials to the SDK) Finding Services. | ||
Quick Start:: | ||
import datetime | ||
from lxml.etree import _Element | ||
from ebaysdk.finding import Connection | ||
|
||
Example:: | ||
try: | ||
api = Connection(appid='YOUR_APPID_HERE') | ||
response = api.execute('findItemsAdvanced', {'keywords': 'legos'}) | ||
|
||
from ebaysdk import getNodeText | ||
from ebaysdk.finding import Connection as finding | ||
assert(response.reply.ack == 'Success') | ||
assert(type(response.reply.timestamp) == datetime.datetime) | ||
assert(type(response.reply.searchResult.item) == list) | ||
item = response.reply.searchResult.item[0] | ||
assert(type(item.listingInfo.endTime) == datetime.datetime) | ||
assert(type(response.dict()) == dict) | ||
assert(type(response.dom() == _Element) | ||
|
||
f = finding() | ||
f.execute('findItemsAdvanced', {'keywords': 'shoes'}) | ||
except ConnectionError as e: | ||
raise e | ||
|
||
dom = f.response_dom() | ||
mydict = f.response_dict() | ||
|
||
# shortcut to response data | ||
print f.v('itemSearchURL') | ||
Migrating from v1 to v2 | ||
----------------------- | ||
|
||
# process the response via DOM | ||
items = dom.getElementsByTagName('item') | ||
After lots of planning and beating my head against the wall, version 2 of this SDK has come to contain a few changes that break backward compatibility. These changes were necessary to optimize this project and help keep it moving forward. Below I’ll highlight the changes and point out code changes that you may need to make. | ||
|
||
for item in items: | ||
print getNodeText(item.getElementsByTagName('title')[0]) | ||
Changes | ||
|
||
* Import: Modified package structure | ||
* execute(): Modified return value | ||
* Switched to lxml.etree | ||
* Added a new response class (response.reply, response.dom(), response.dict(), response.json()) | ||
* Added ebaysdk exception classes | ||
* Modified utils.py (dict2xml, xml2dict) | ||
|
||
Please read the full doc on `Migrating from ebaysdk v1 to v2`_ | ||
|
||
Getting Started | ||
--------------- | ||
|
||
SDK Classes | ||
|
||
* `Trading API Class`_ - secure, authenticated access to private eBay data. | ||
* `Finding API Class`_ - access eBay's next generation search capabilities. | ||
* `Shopping API Class`_ - performance-optimized, lightweight APIs for accessing public eBay data. | ||
* `Merchandising API Class`_ - find items and products on eBay that provide good value or are otherwise popular with eBay buyers. | ||
* `HTML Class`_ - generic back-end class the enbles and standardized way to make API calls. | ||
* `Parallel Class`_ - SDK support for concurrent API calls. | ||
|
||
SDK Configuration | ||
|
||
* `YAML Configuration`_ | ||
* `Understanding eBay Credentials`_ | ||
|
||
|
||
Support | ||
------- | ||
|
||
For developer support regarding the SDK code base please use this project's `Github issue tracking`_. | ||
|
||
For developer support regarding the eBay APIs please use the `eBay Developer Forums`_. | ||
|
||
Install | ||
------- | ||
|
||
Installation instructions for *nix and windows can be found in the `INSTALL file`_. | ||
License | ||
------- | ||
|
||
`COMMON DEVELOPMENT AND DISTRIBUTION LICENSE`_ Version 1.0 (CDDL-1.0) | ||
|
||
|
||
.. _INSTALL file: https://github.com/timotheus/ebaysdk-python/blob/master/INSTALL | ||
.. _COMMON DEVELOPMENT AND DISTRIBUTION LICENSE: http://opensource.org/licenses/CDDL-1.0 | ||
.. _Understanding eBay Credentials: https://github.com/timotheus/ebaysdk-python/wiki/eBay-Credentials | ||
.. _eBay Developer Site: http://developer.ebay.com/ | ||
.. _YAML Configuration: https://github.com/timotheus/ebaysdk-python/wiki/YAML-Configuration | ||
.. _Trading API Class: https://github.com/timotheus/ebaysdk-python/wiki/Trading-API-Class | ||
.. _Finding API Class: https://github.com/timotheus/ebaysdk-python/wiki/Finding-API-Class | ||
.. _Shopping API Class: https://github.com/timotheus/ebaysdk-python/wiki/Shopping-API-Class | ||
.. _Merchandising API Class: https://github.com/timotheus/ebaysdk-python/wiki/Merchandising-API-Class | ||
.. _HTML Class: https://github.com/timotheus/ebaysdk-python/wiki/HTML-Class | ||
.. _Parallel Class: https://github.com/timotheus/ebaysdk-python/wiki/Parallel-Class | ||
.. _eBay Developer Forums: https://www.x.com/developers/ebay/forums | ||
.. _Github issue tracking: https://github.com/timotheus/ebaysdk-python/issues | ||
.. _Migrating from ebaysdk v1 to v2: https://github.com/timotheus/ebaysdk-python/wiki/Migrating-from-v1-to-v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.