Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
amazon-sp-api-clients
Advanced tools
This is a package generated from amazon selling partner open api models.
The package is tested in many situations, with fully type hint supported. Enjoy it!
V1.0.0 changes many api, compared with v0.x.x!
注意!V1.0.0相较于v0.x.x更改了大量的API!
pip install amazon-sp-api-clients
For technical support, please contact panhaoyu.china@outlook.com.
Previously this lib is only open access but not open source, and now it's time to make it public to serve more developers.
If there's any bug, please fell free to open an issue or send a pr.
For saving time, I just paste part of my test code here as a demo.
For better understanding, all the fields are the same length of actual fields, and some readable information are kept.
from datetime import datetime
import amazon_sp_api_clients
endpoint = "https://sellingpartnerapi-eu.amazon.com"
marketplace_id = "XXXXXXXXXXXXXX"
refresh_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
role_arn = "arn:aws:iam::123456789012:role/xxxxxx"
aws_access_key = 'XXXXXXXXXXXXXXXXXXXX'
aws_secret_key = "XXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client_id = 'amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
client_config = dict(
role_arn=role_arn,
endpoint=endpoint,
marketplace_id=marketplace_id,
refresh_token=refresh_token,
aws_access_key=aws_access_key,
aws_secret_key=aws_secret_key,
lwa_client_key=client_id,
lwa_client_secret=client_secret,
)
clients = amazon_sp_api_clients.AmazonSpApiClients(**client_config)
orders = clients.orders_v0.getOrders(
MarketplaceIds=[marketplace_id],
CreatedAfter=datetime(2000, 1, 1).isoformat()
).payload.Orders
for order in orders:
print(order.AmazonOrderId, order.LastUpdateDate)
The client configuration can be set both at the initiation and as environment variables.
The client is generated in the following steps:
The main script of generation is the test_main
python file.
When convert open api to py clients, I separated the process into 6 steps, which are defined in
the swager_client_generator.stages
module.
If my build is not suitable for your demand, or amazon api model updates but my build do not follow, you can clone this
repo, modify the api.pyt
template and build it by yourself, and please push a PR, thanks!
The auth method is partially from python-amazon-sp-api.
If this library helps you, please give me a star, thanks!
如果这个库对您有用,请为我点亮Star,谢谢!
FAQs
Amazon selling partner api clients.
We found that amazon-sp-api-clients demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.