A Python API client for interacting with the Gumroad API.
Project description
Gumroad API Client
A Python API client for interacting with the Gumroad API (https://gumroad.com/api). Comments, suggestions, and improvements are always welcome. Be sure to follow @opsdisk on Twitter for the latest updates.
Note that not all of the endpoints and HTTP verbs supported by the Gumroad API have been added.
Installation
pip install pygumroad
virtualenv -p python3.7 .venv # If using a virtual environment.
source .venv/bin/activate # If using a virtual environment.
pip install -r requirements.txt
python setup.py install
Update Credentials
Update the gumroad_secrets.json file with the host and API key.
cp gumroad_secrets_empty.json gumroad_secrets.json
{
"gumroad": {
"host": "api.gumroad.com",
"token": "7a4d...b388",
}
}
Usage
import pygumroad
# Pass a secrets file.
full_path_to_secrets_file_location="/home/user/gumroad_secrets.json"
gumroad_client = pygumroad.GumroadClient(secrets_file_location=full_path_to_secrets_file_location)
# Pass a secrets dictionary.
secrets_dict = {
"gumroad": {
"host": "api.gumroad.com",
"token": "7a4d...b388",
}
}
gumroad_client = pygumroad.GumroadClient(secrets_dict=secrets_dict)
all_products = gumroad_client.retrieve_all_products()
for product in all_products:
print(f"Product Name: {product['name']} - Product ID: {product['id']}")
all_sales = gumroad_client.retrieve_all_sales()
for sale in all_sales:
print(f"Product: {sale['product_name']} was sold on {sale['created_at']}")
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 pygumroad-0.0.1.tar.gz.
File metadata
- Download URL: pygumroad-0.0.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cc071f85632ed197a9a7ffdd8545525671e759b3b89c04a27726c8a9abb17df
|
|
| MD5 |
fe3b9b8a932dd591cdeada2d0775919e
|
|
| BLAKE2b-256 |
ab719d6b59fff283df6df7ff81439bb8a5afa9311066abff04ebb2cde8491997
|
File details
Details for the file pygumroad-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pygumroad-0.0.1-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2be25c7711ab9a7cbe5023acbaedf6773c2d391c805253357910d4b3b03138f4
|
|
| MD5 |
88ec5103ee03b11b6558909c22da0b09
|
|
| BLAKE2b-256 |
6c457644903d1f71085d75899609c6a5306e458f2c780ee121ca7c1c6b5db4f6
|