Restocks.net client for Python.
Project description
Installation
pip install restocks-client
Introduction
You can search for products without being logged in, however, there are some client methods which require you to be logged in to your Restocks.net account to be used.
You can either use the client with or without proxies. Proxies will rotate for each client call for those methods which do not require login. The same proxy will be used for all the client calls after you log in if you decide to do so.
| Method | Description | Login |
|---|---|---|
search_products |
Searches for products. | NO |
get_product |
Gets all the data of an specific product. | NO |
get_size_lowest_price |
Gets the lowest price of a product size. | YES |
get_sales_history |
Gets the account sold products. | YES |
get_listings_history |
Gets the account current product listings. | YES |
list_product |
Lists a product for sale. | YES |
edit_listing |
Edits a product listing. | YES |
delete_listing |
Deletes a product listing. | YES |
Example
from restocks.client import Client
from restocks.filters import SellMethod, ListingDuration
proxy = {"https": "https://username:password@ip:port"}
# or optionally
proxy = [{"https": "https://username:password@ip:port"}, {"https": "https://username:password@ip:port"}]
client = Client(proxy=proxy)
# ---- Get product data ---------------------- #
product = client.get_product("DD1391-100")
print(product.name, product.sku)
# -------------------------------------------- #
# ---- Log in to your Restocks.net account --- #
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"
client.login(username, password)
# -------------------------------------------- #
# ---- Get the account sales ----------------- #
sales = client.get_sales_history()
for sale in sales:
print(sale.name, sale.price, sale.date)
# -------------------------------------------- #
# ---- List a product for sale --------------- #
listed = client.list_product(
product=product, # DD1391-100
store_price=3000,
size="42",
sell_method=SellMethod.Resell,
duration=ListingDuration.Days60
)
print(listed)
# -------------------------------------------- #
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file restocks-client-0.1.3.tar.gz.
File metadata
- Download URL: restocks-client-0.1.3.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bd430f84431077a58deada10f21624d887945fe8dbeb39a1e1c2d00dbb27659
|
|
| MD5 |
a01ff35f660941b99f5bbf150de066b8
|
|
| BLAKE2b-256 |
9df7e6a97d386a20a09268433dc356f1db8f5bc372284d9325d59f29e9a1b45c
|
File details
Details for the file restocks_client-0.1.3-py3-none-any.whl.
File metadata
- Download URL: restocks_client-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f125bf7ead5f4962f3083f46baf23ef9768632db10fcdc6ceded92e0e29e9f9
|
|
| MD5 |
8eeb5125999cb4307e97c3d1a2b065b5
|
|
| BLAKE2b-256 |
0e8766f6a34bd95e346c5208b4fb60cb9ab3eefa5e0db7207f977644c83951d5
|