Skip to main content

Simple Python Whop API Wrapper

Project description

Whop-API-Wrapper

A simple python API wrapper of Whop's API, documentation can be found at: https://dev.whop.com/reference/home

Installation

To install the package, use the following command:

pip install whop-api-wrapper

Usage

Initialize the Client class with your token, use any api call as a method of the client.

from Resources.Client import Client

client = Client("input_token_here")

products = client.list_all_products()
for product in products:
    print(product)  # Product(id=product_id, name=product_name, visibility=visible, created_at=123, experiences=[], plans=[])

customer = client.retrieve_customer("customer_id_here")
print(customer)  # Customer(id=user_id, username=whop_username, email=email, profile_pic_url=url, social_accounts=[{'service': 'discord', 'username': 'discord_name#1234', 'id': '123'}], roles=None),

promo_code = client.create_promo_code(amount_off=25, base_currency="usd", code="25off", promo_type="flat_amount")
print(promo_code)  # PromoCode(id=promo_id, created_at=123, amount_off=100.0, base_currency=usd, code=100off, expiration_datetime=None, new_users_only=True, number_of_intervals=1, plan_ids=[], promo_type=percentage, status=active, stock=6, uses=2)

Feel free open any issues or report them to me on discord, jacobfinn.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whop-api-wrapper-1.0.5.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

whop_api_wrapper-1.0.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file whop-api-wrapper-1.0.5.tar.gz.

File metadata

  • Download URL: whop-api-wrapper-1.0.5.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for whop-api-wrapper-1.0.5.tar.gz
Algorithm Hash digest
SHA256 1677a9f38288d8d0d4b83afc515d87b57380ff617654b5cc2a068b5020e39001
MD5 30fa68fbe3322998457e9484e2ace248
BLAKE2b-256 0e3cb6c28be7da43d77b081f3f4a658ca22751cc7ccfd2ebb02e0e81443af672

See more details on using hashes here.

Provenance

File details

Details for the file whop_api_wrapper-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for whop_api_wrapper-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6b30f515dde18f944f8f41ab9196f89076f31a7d48dcf6aa9ccdc886f7ada049
MD5 26b0883b3d909b59f3df983e21e52738
BLAKE2b-256 ae7f5536510ab1a4b45626617f33fed764e8e53adc73dac2842b617d18989999

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page