pygumroad


Namepygumroad JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/opsdisk/pygumroad
SummaryA Python API client for interacting with the Gumroad API.
upload_time2023-10-29 21:57:04
maintainer
docs_urlNone
authorBrennon Thomas
requires_python>=3.6
licenseGNU General Public License v3.0
keywords python gumroad api client
VCS
bugtrack_url
requirements requests requests-toolbelt
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://twitter.com/opsdisk) on Twitter for the latest
updates.

```none
Note that not all of the endpoints and HTTP verbs supported by the Gumroad API have been added.
```

## Installation

```bash
pip install pygumroad
```

```bash
git clone https://github.com/opsdisk/pygumroad.git
cd 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

If using a secrets file, create/update the `gumroad_secrets.json` file with the host and API key.  See the usage section
on how to pass a secrets dictionary.

```bash
cp gumroad_secrets_empty.json gumroad_secrets.json
```

```json
{
    "gumroad": {
        "host": "api.gumroad.com",
        "token": "7a4d...b388",
    }
}
```

## Usage

```python
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']}")

```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/opsdisk/pygumroad",
    "name": "pygumroad",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "python gumroad api client",
    "author": "Brennon Thomas",
    "author_email": "info@opsdisk.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/28/89fdf5286fca43b0acc2bc565efe26bbccbfa73b9ab617b36423fe2009ed/pygumroad-0.0.3.tar.gz",
    "platform": null,
    "description": "# Gumroad API Client\n\nA Python API client for interacting with the Gumroad API (<https://gumroad.com/api>).  Comments, suggestions, and\nimprovements are always welcome. Be sure to follow [@opsdisk](https://twitter.com/opsdisk) on Twitter for the latest\nupdates.\n\n```none\nNote that not all of the endpoints and HTTP verbs supported by the Gumroad API have been added.\n```\n\n## Installation\n\n```bash\npip install pygumroad\n```\n\n```bash\ngit clone https://github.com/opsdisk/pygumroad.git\ncd pygumroad\nvirtualenv -p python3.7 .venv  # If using a virtual environment.\nsource .venv/bin/activate  # If using a virtual environment.\npip install -r requirements.txt\npython setup.py install\n```\n\n## Update Credentials\n\nIf using a secrets file, create/update the `gumroad_secrets.json` file with the host and API key.  See the usage section\non how to pass a secrets dictionary.\n\n```bash\ncp gumroad_secrets_empty.json gumroad_secrets.json\n```\n\n```json\n{\n    \"gumroad\": {\n        \"host\": \"api.gumroad.com\",\n        \"token\": \"7a4d...b388\",\n    }\n}\n```\n\n## Usage\n\n```python\nimport pygumroad\n\n# Pass a secrets file.\nfull_path_to_secrets_file_location=\"/home/user/gumroad_secrets.json\"\ngumroad_client = pygumroad.GumroadClient(secrets_file_location=full_path_to_secrets_file_location)\n\n# Pass a secrets dictionary.\nsecrets_dict = {\n    \"gumroad\": {\n        \"host\": \"api.gumroad.com\",\n        \"token\": \"7a4d...b388\",\n    }\n}\n\ngumroad_client = pygumroad.GumroadClient(secrets_dict=secrets_dict)\nall_products = gumroad_client.retrieve_all_products()\n\nfor product in all_products:\n    print(f\"Product Name: {product['name']} - Product ID: {product['id']}\")\n\n\nall_sales = gumroad_client.retrieve_all_sales()\n\nfor sale in all_sales:\n    print(f\"Product: {sale['product_name']} was sold on {sale['created_at']}\")\n\n```\n\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3.0",
    "summary": "A Python API client for interacting with the Gumroad API.",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/opsdisk/pygumroad"
    },
    "split_keywords": [
        "python",
        "gumroad",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "684084b1ff4b8c48f39e34d34a51da31767365db4d05db48796c11e24f71f78c",
                "md5": "8ba934fa89faca65226baed08d6c886b",
                "sha256": "4ea0bda92c317035af005bc55a109db9fe4834f9a53b5dfd84204e4b18a91c0f"
            },
            "downloads": -1,
            "filename": "pygumroad-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ba934fa89faca65226baed08d6c886b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 23259,
            "upload_time": "2023-10-29T21:57:03",
            "upload_time_iso_8601": "2023-10-29T21:57:03.307884Z",
            "url": "https://files.pythonhosted.org/packages/68/40/84b1ff4b8c48f39e34d34a51da31767365db4d05db48796c11e24f71f78c/pygumroad-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb2889fdf5286fca43b0acc2bc565efe26bbccbfa73b9ab617b36423fe2009ed",
                "md5": "b7085421b94bf419f924632964617db7",
                "sha256": "d9638e1e17468b02abe9ee3dae65d7e7a89798e6d5390517a52f7f5f0950a03f"
            },
            "downloads": -1,
            "filename": "pygumroad-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b7085421b94bf419f924632964617db7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18415,
            "upload_time": "2023-10-29T21:57:04",
            "upload_time_iso_8601": "2023-10-29T21:57:04.849130Z",
            "url": "https://files.pythonhosted.org/packages/bb/28/89fdf5286fca43b0acc2bc565efe26bbccbfa73b9ab617b36423fe2009ed/pygumroad-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-29 21:57:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opsdisk",
    "github_project": "pygumroad",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        }
    ],
    "lcname": "pygumroad"
}
        
Elapsed time: 0.13934s