8000 Release for 0.8.0 by GriceTurrble · Pull Request #42 · python-amazon-mws/python-amazon-mws · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Conversation

@GriceTurrble
Copy link
Member

Main feature additions

  • adds Finances API
  • adds InboundShipments API (initial release)
  • streamlined ...ByNextToken request calls
  • code style clean-up across the project

Adds Finances API (#27)

Thanks to all the contributors who clamored for this API to be added, mostly by adding their own implementations to use in their apps. One of the earliest open PRs with the relevant changes was selected and incorporated, and is now finally part of the official-unofficial package.

Adds InboundShipments API (initial release) (#33)

Not every method is available at this time. The following are covered in this release:

  • estimate_transport_request
  • get_bill_of_lading
  • get_package_labels
  • get_prep_instructions_for_asin
  • get_prep_instructions_for_sku
  • get_transport_content
  • list_inbound_shipment_items
  • list_inbound_shipments
  • void_transport_request

A later release will incorporate the remaining methods from this API, such as confirm_preorder, get_inbound_guidance_for_asin, get_pallet_labels, etc.

Streamlined ...ByNextToken request calls (#33)

All existing request methods with names ending in ...by_next_token have been deprecated. These methods will be removed during an eventual 1.0.0 release.

All existing methods that relate to a ByNextToken-style action can be called using an optional next_token argument, which will run the appropriate operation.

Example

Suppose you have run the following request:

inbound = InboundShipments('access_key', 'secret_key', 'account_id')
response = inbound.list_inbound_shipments(...)

...and the response contains a NextToken key, indicating you should call ListInboundShipmentsByNextToken with this token:

next_token = response.parsed.NextToken

You can then re-call list_inbound_shipments using only the next_token argument to run the next request in sequence:

new_response = inbound.list_inbound_shipments(next_token=next_token)

This will automatically call the ListInboundShipmentsByNextToken operation using your next_token to get the next "page" of response data.

With this, you can use a code pattern like the following to get all pages of the response data in succession:

next_token = None
while True:
    if not next_token:
        request_args = {...}
    else:
        request_args = {'next_token': next_token}
    response = inbound.list_inbound_shipments(**request_args)

    # Get our next_token, if one is present
    next_token = response.parsed.get('NextToken', {}).get('value')

    # Process response data here...

    # At the end, test the next_token to break the loop
    if next_token is None:
        # no NextToken was present in the response, so we just processed the last page of data.
        break

Note the "double-get" used above when looking for the NextToken. This is a workaround for how the package currently handles the .get method within ObjectDict, which is a subclass of dict. See here for details (under header "Optional: Accessing Values As Dict Keys").

Next steps

Post-0.8, we'll be looking to flesh out API coverage so that we have all request methods available in Amazon MWS covered. These include:

  • OutboundShipments API (a stub is in the current release, but no methods are available).
  • MerchantFulfillment API
  • Subscriptions API
  • missing methods in InboundShipments API (see above)
  • missing methods in Reports API: cancel_report_requests, manage_report_schedule, and update_report_acknowledgements
  • missing method in Products API: get_my_fees_estimate

Further, I am speccing more test coverage for the request methods, which are all missed by our test suite (with the exception of get_service_status via the Orders API). Independent testing from several sources confirms that these methods seem to work in production environments (as of this writing), but the package remains "as-is" with no guarantee that everything works as intended.

Finally, we would love to see this fork of the project become the primary version of python-amazon-mws. The upstream version has not been updated in years, though it has been forked dozens of times by users who have then edited it in order to fit their production needs. If we can bring the right functionality to this package, I'm hoping we can meet the needs of all users moving forward.

To that end - and to anyone reading this and using this package in their own applications - please feel free to submit new Issues, contribute Pull Requests, and provide feedback as you see fit.

Josh-Dwernychuk and others added 29 commits September 12, 2017 17:44
So that it can be tested more easily, and refactored
…s. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator
Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.
We are testing in 3.6 in Travis anyway. May as well include the note.
Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).
No substantial code changes, comment changes only. Also ensured all docstrings follow same format.
Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.
@GriceTurrble GriceTurrble added this to the 0.8.0 milestone Jan 29, 2018
@codecov-io
Copy link
codecov-io commented Jan 29, 2018

Codecov Report

Merging #42 into master will decrease coverage by 2.17%.
The diff coverage is 40.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
- Coverage   48.85%   46.67%   -2.18%     
==========================================
  Files           4        4              
  Lines         393      632     +239     
  Branches       22       64      +42     
==========================================
+ Hits          192      295     +103     
- Misses        192      324     +132     
- Partials        9       13       +4
Impacted Files Coverage Δ
mws/mws.py 44.6% <31.73%> (-7.39%) ⬇️
mws/utils.py 71.84% <73.52%> (+9.58%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7fdc94...bffeb2f. Read the comment docs.

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!
class object_dict(dict):
"""object view of dict, you can
>>> a = object_dict()
class ObjectDict(dict):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitated on changing the unconventional naming in case it broke API compatibility with people who are using these classes directly in their projects - although now thinking about it, maybe it can be worked around by making aliases (object_dict = ObjectDict)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that being an issue for some backwards compatibility, yes. Will add that line and plan it for deprecation and removal later.

@jameshiew
Copy link
Contributor

Big update! I'm not able to focus on reviewing code right now, but don't want to cause a hold up on releasing this, if it is good to go.

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.
@GriceTurrble GriceTurrble merged commit a46eb43 into master Feb 4, 2018
GriceTurrble added a commit that referenced this pull request Feb 6, 2018
* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `e
6D40
numerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.
GriceTurrble added a commit that referenced this pull request Feb 6, 2018
* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.
GriceTurrble added a commit that referenced this pull request Feb 6, 2018
* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.
GriceTurrble pushed a commit that referenced this pull request Mar 10, 2018
* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.

* Build new dict keyed param

* Initialized Merchant Fulfillment feature

* Merchant Fulfillment API methods

* Corrections for flake8 build errors

* Iterate over XML elements updated

* Fix item list format in MerchantFulfillment methods
GriceTurrble pushed a commit that referenced this pull request Mar 10, 2018
* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.

* Build new dict keyed param

* Initialized Merchant Fulfillment feature

* Merchant Fulfillment API methods

* Corrections for flake8 build errors

* Iterate over XML elements updated

* Fix item list format in MerchantFulfillment methods

* Update unsafe parameters for new merchant services

https://docs.python.org/3/tutorial/controlflow.html#default-argument-values

* pylint tidy

* fix flake8 issues on CI
GriceTurrble added a commit that referenced this pull request Mar 10, 2018
* Merge recent changes in master to develop branch (#45) (#47)

* Release for 0.8.0 (#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include th
9E88
e note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.

* Refactor timestamp method.

* Naming cleanups

* Single-source package version for use in agent string.

* MWS refactored, split into different modules.

* Version bump for feature

* Move and incorporate new MerchantFulfillment API

* merge artifacts removed [broken]

* Methods from PR #22 added.

* Changes from PR #53 merged
Bobspadger added a commit to Bobspadger/python-amazon-mws that referenced this pull request Mar 7, 2019
* Release for 0.8.0 (python-amazon-mws#42)

* Added Finances API Feature

* .setup.py: bump version to 0.7.5-dev0

* Split out request_description building from make_request()

So that it can be tested more easily, and refactored

* Split out building the initial params dict from make_request()

So that it can be tested more easily

* Add fake MWS credentials pytest fixture

* test_service_status() should use the pytest fake credentials fixture

* Add more pytest fixtures (access_key, secret_key, account_id, timestamp)

* Add test for calc_request_description()

* Split out calc_request_description() into more statements

So that it is easier to debug

* Fix calc_request_description - don't include leading ampersand

* Don't do automated deployments via Travis (for the moment)

* Update README.md badges

* InboundShipments, next_token_action decorator, and some style cleanups. (python-amazon-mws#33)

* Testing out git commits from VS Code

* Reverting the test commit

* Adding VS Code settings to gitignore.

* Style fixes

* MWS.enumerate_param deprecated: now using utils.enumerate_param and utils.enumerate_params

* InboundShipments fleshed out; added `utils.next_token_action` decorator; deprecated separate methods for `...by_next_token()`

* Bugfix, rename `_enumerate_param` to `enumerate_param` (no need for private)

* Fix for next_token issues.

* TravisCI flake8 complaining, fixes.

* Minor flake8 complaint.

* Hack to get flake8 to stop complaining.

* Strip pylint disables to clear line length issue.

* Correction to keyed params, now tests every item in values sequence to ensure all are dicts.

* Add tests for param methods in utils.

* Add test for next token decorator.

* Adding 'InboundShipments' to `__all__`

* Assigning response a default in __init__ for DictWrapper and DataWrapper

* Unneeded line breaks removed + docstring formatting

* Comment corrected. They're tuples, not sets.

* Finances methods updated to use next_token_action decorator

* Create .travis.yaml

* Update .gitignore

* Removing deploy code from local travis

* Delete .travis.yaml

* Pushed to 0.8.0-dev0

Recently added functionality to InboundShipments, as well as Finances API. These constitute feature additions with backwards compatibility, which calls for a minor version update.

* Adding Python 3.6 category

We are testing in 3.6 in Travis anyway. May as well include the note.

* Specified master and develop branches for badges

Ensured the badges for Travis and Codecov are pointing to the appropriate branches (used to be pointing to default, which was master in both cases).

* Updated comments throughout module

No substantial code changes, comment changes only. Also ensured all docstrings follow same format.

* Fixed docstring formatting

Also made slight update to docstring for ObjectDict to more clearly note what it does, vs what the original code did.

* Fix for flake8 (trailing whitespace)

* Fix for flake8 (trailing whitespace)

* Bump to 0.8.0 (drop dev tag) for release

* Bug: Incorrect use of `super` for back-compat

Using the old-style `super` syntax to comply with Python 2.7 compatibility. Not revealed in tests, because current tests don't touch the APIs. Whoops!

* Added back old object names in case needed

Old names `object_dict` and `xml2dict` added back in case the old objects are being used directly by some users.

To be removed in 1.0.0 release down the road.

* Version bump for agent string.

* Hi, howyadoin?

* Format request url with str.format

Remove old-style string formatting for sake of clarity.

* BUG: GetReportList missing from next token ops

Added in with a hotfix.

* Version push

* version push

* version bump (corrects wrong version from before)

* Bugfix inbound constructor (0.8.3 release) (python-amazon-mws#57)

* version bump

* No from_address assignment needed in Inbound init

Similar fix as commit on `develop`, which will come in with 1.0 release.

Also, version bump for new bugfix release.

* Remove import for ExpatError

We do not support Python < 2.7, in which ParseError is available; import for ExpatError is not necessary.

* Comments added for later work.

* Added '.' at end of some params to test

Params ought to pass through `enumerate_keyed_param` whether they end with '.' or not.

* Added test for dict_keyed_params

* Added test for enumerate_keyed_param

Also fix the existing one (wrong info used)

* Convert test methods to testcase class

* Create example_response.txt

File contains an example response from MWS, taken directly from MWS documentation. To be used for testing utilities.

* Change test methods to test case classes

* Add `download_url` to setup.py

* Fix issue python-amazon-mws#60 (python-amazon-mws#61)

* Fix issue#1

Always return an interable list.

Stolen from https://github.com/bloodywing Thanks!

* Fix issue python-amazon-mws#60

We must sort the params before encoding and concatenating or we will fail our calls.

This is a nice hybrid between the old version and a nicer more pythonic way of doing things with .join and not just appending to strings and then hacking the last ampersand off.

* Sorting of dict keys instead of the dict object

Essentially the same output, slightly more explicit for an easier time reading it later.

* Feeds example. (python-amazon-mws#64)

* Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)

* Feeds example.

* Feeds example. Use of ".parsed" changed.

* Subscriptions api (python-amazon-mws#67)

* Fix issue#1

Always return an interable list.

Stolen from https://github.com/bloodywing Thanks!

* Fix issue python-amazon-mws
6D38
#60

We must sort the params before encoding and concatenating or we will fail our calls.

This is a nice hybrid between the old version and a nicer more pythonic way of doing things with .join and not just appending to strings and then hacking the last ampersand off.

* Sorting of dict keys instead of the dict object

Essentially the same output, slightly more explicit for an easier time reading it later.

* Start working on the subscriptions API

* More updates to subscription to test.

* missed off Subscription

* remove subscription, example appears to not require this?

* subscription required for subscription calls, not on destination,

* flake8

make creation of call consistent accross this file.

* indentation error.

* Subscriptions (#9)

* Fix delete subscription

* Fix delete subscription

* Subscriptions (#10)

* Fix delete subscription

* Fix delete subscription

* _type -> notification_type

* small doc update

* Subscriptions (#11)

* Fix delete subscription

* Fix delete subscription

* _type -> notification_type

* small doc update

* change subscriptions attributes_list to be attributes (dictionary) then map the key and value into the correct style for enumeration

* Subscriptions (#12)

* Fix delete subscription

* Fix delete subscription

* _type -> notification_type

* small doc update

* change subscriptions attributes_list to be attributes (dictionary) then map the key and value into the correct style for enumeration

* flake8 after merge issues

* Subscriptions (#13)

* Fix delete subscription

* Fix delete subscription

* _type -> notification_type

* small doc update

* change subscriptions attributes_list to be attributes (dictionary) then map the key and value into the correct style for enumeration

* flake8 after merge issues

* missed off subscriptions in updated params

* flake8

* fix get_subscription

* move delivery_channel to the end of the params so it can be a default

* clean method (python-amazon-mws#65)

* clean input parameter

* Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)

* Feeds example.

* Feeds example. Use of ".parsed" changed.

* see conversation pull request

* modified tests to fit new clean method

* revert start in subapi

* git ignore

* d

* r

* travis bugfix

* call clean method for params too

* reuse modifiers for request params

also it's helpful to understand how we modify params

* param test for wrong datatype exception

* clean all parameters at once

see idea from GriceTurrble in this pull request

* remove dt_iso_or_none

no need for this

* Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)

* Feeds example.

* Feeds example. Use of ".parsed" changed.

* Revert "Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)"

This reverts commit ba0f363.

* Revert "Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)"

This reverts commit e87012b.

* Revert "Feeds example. Use of ".parsed" changed. (python-amazon-mws#66)"

This reverts commit 77d3ea7.

* Revert "Feeds example. (python-amazon-mws#64)"

This reverts commit 2a18583.

* Added support for zip files.

* ignore files

* Zip files downloaded to current directory.

* Added unzip() function in DataWrapper object.

* Minor updates, correcting my own mistakes from recent merge

* Remove "assert_no_token". Not used except in a single test.

* Fallback to _response_dict if _rootkey is not present in response dict (python-amazon-mws#72)

This is the case while fetching some of the reports. I particularly found this
in '_GET_XML_RETURNS_DATA_BY_RETURN_DATE_'. In this case the data is returned
but not in rootkey. This will at least let the user parse the data on there own

* Move flake8 checking after pytest calls

A current PR is using `enum`, which was added in Py3.4. That should have produced an error for a missing module in Py2.7 testing, but `flake8` loads `enum34` as a dependency into the environment first. This contaminates the test suite prior to running tests, hiding what should be an error.

* report enum and get_reportid (python-amazon-mws#74)

* report enum and get_reportid

* removed tuples since we do now handle the decoding better

* removed get_request id

and lets see if the test now fails

* Move flake8 checking after pytest calls

A current PR is using `enum`, which was added in Py3.4. That should have produced an error for a missing module in Py2.7 testing, but `flake8` loads `enum34` as a dependency into the environment first. This contaminates the test suite prior to running tests, hiding what should be an error.

* extra require python2.7 enum34

* Streamline package requirements for enum34

* Bugfix, my mistake. Import setuptools needed

* ... and sys

* Push dev version num

We've gone several versions up, technically, without changing the version num to match. May as well start somewhere.

* Dev version num push (match setup)

* Call to requests.request needs explicit timeout (python-amazon-mws#87)

* Call to requests.request needs explicit timeout

Call to requests.request doesn't explicitly mention timeout, without which could lead to zombie processes as default timeout is infinity (None).

* Add marketplace ID enums #19 (python-amazon-mws#84)

* enum marketplaces

* typos

* removed domain parameter, pls use region now, see MARKETPLACES

* very basic tests

* python-amazon-mws#91 add BR and AU and sort alphabetical

* single quotes

* better name for variable

* idiomatic names, thanks to jameshiew

* Changed excludeme default to be xsd1.1 compatible (python-amazon-mws#97)

Occasionally, the MWS API for Products will throw an error, citing a
non-xsd1.1 boolean as an example. Making the default value for the
keyword argument excludeme into "false" fixes this.

* Revert "Merge branch 'develop' into develop"

This reverts commit 1a15914, reversing
changes made to a7886c7.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0