planship


Nameplanship JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://planship.io
SummaryPlanship API client
upload_time2024-02-27 08:20:42
maintainer
docs_urlNone
authorPawel Wojnarowicz
requires_python>=3.7
license
keywords planship
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # planship-python

Welcome to the Python client for the [Planship API](https://docs.planship.io/integration). [Planship](https://planship.io) enables developers to build subscription logic for product pricing based on any combination of features, seats, and usage.


## Installation and basic usage

Install `planship` with pip, or another package manager of your choice like Poetry

``` console
pip install planship
# or
poetry add planship
```

Import and instantiate the `Planship` class, and start making calls to the Planship API

```python
from planship import Planship

planship = Planship(
    "clicker-demo",                         # Planship product slug
    "273N1SQ3GQFZ8JSFKIOK",                 # Planship API client ID
    "GDSfzPD2NEM5PEzIl1JoXFRJNZm3uAhX"      # Planship API client secret
)

# List product plans
plans = planship.list_plans()

# Create a customer with a name and email
customer = planship.create_customer({
    "name": "Darth Vader",
    "email:": "vader@empire.gov"
})

# Subscribe the customer to a plan with the slug "medium"
subscription = planship.create_subscription(customer.id, "medium")

# Retrieve entitlements for the customer
entitlements = planship.get_entitlements(customer.id)

# Report 11 units of usage for the "api-call" metering ID for the customer
planship.report_usage(customer.id, "api-call", 11)
```

The complete reference for the `Planship` class can be found [here](https://github.com/planship/planship-python/blob/master/docs/content/planship-class.md).

## Links

- [Planship documentation](https://docs.planship.io)
- [Sign up for Planship](https://app.planship.io/auth/sign-up)
- [Planship Python client class reference](https://github.com/planship/planship-python/blob/master/docs/content/planship-class.md)
- [Planship Python client at PyPI](https://pypi.org/project/planship/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://planship.io",
    "name": "planship",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Planship",
    "author": "Pawel Wojnarowicz",
    "author_email": "pawel@planship.io",
    "download_url": "https://files.pythonhosted.org/packages/e1/5a/6135455a9cfe7e656c6988c60449da9c34504525209d8164e49c98b336a0/planship-0.2.1.tar.gz",
    "platform": null,
    "description": "# planship-python\n\nWelcome to the Python client for the [Planship API](https://docs.planship.io/integration). [Planship](https://planship.io) enables developers to build subscription logic for product pricing based on any combination of features, seats, and usage.\n\n\n## Installation and basic usage\n\nInstall `planship` with pip, or another package manager of your choice like Poetry\n\n``` console\npip install planship\n# or\npoetry add planship\n```\n\nImport and instantiate the `Planship` class, and start making calls to the Planship API\n\n```python\nfrom planship import Planship\n\nplanship = Planship(\n    \"clicker-demo\",                         # Planship product slug\n    \"273N1SQ3GQFZ8JSFKIOK\",                 # Planship API client ID\n    \"GDSfzPD2NEM5PEzIl1JoXFRJNZm3uAhX\"      # Planship API client secret\n)\n\n# List product plans\nplans = planship.list_plans()\n\n# Create a customer with a name and email\ncustomer = planship.create_customer({\n    \"name\": \"Darth Vader\",\n    \"email:\": \"vader@empire.gov\"\n})\n\n# Subscribe the customer to a plan with the slug \"medium\"\nsubscription = planship.create_subscription(customer.id, \"medium\")\n\n# Retrieve entitlements for the customer\nentitlements = planship.get_entitlements(customer.id)\n\n# Report 11 units of usage for the \"api-call\" metering ID for the customer\nplanship.report_usage(customer.id, \"api-call\", 11)\n```\n\nThe complete reference for the `Planship` class can be found [here](https://github.com/planship/planship-python/blob/master/docs/content/planship-class.md).\n\n## Links\n\n- [Planship documentation](https://docs.planship.io)\n- [Sign up for Planship](https://app.planship.io/auth/sign-up)\n- [Planship Python client class reference](https://github.com/planship/planship-python/blob/master/docs/content/planship-class.md)\n- [Planship Python client at PyPI](https://pypi.org/project/planship/)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Planship API client",
    "version": "0.2.1",
    "project_urls": {
        "Class Reference": "https://github.com/planship/planship-python/blob/master/docs/content/planship-class.md",
        "Homepage": "https://planship.io",
        "Planship Docs": "https://docs.planship.io",
        "Repository": "https://github.com/planship/planship-python"
    },
    "split_keywords": [
        "planship"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49cf560b1d0518c7dd4486712e8dc6a94389e27fbdf5fda535e7f4053d7990c8",
                "md5": "944b246f16d23a1ab4a5545b7014f4b9",
                "sha256": "770e757962ee6d5f45e3740d4bd43a63f440b5ea4ae56812a8dee276d8c9cf3e"
            },
            "downloads": -1,
            "filename": "planship-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "944b246f16d23a1ab4a5545b7014f4b9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6746,
            "upload_time": "2024-02-27T08:20:41",
            "upload_time_iso_8601": "2024-02-27T08:20:41.026908Z",
            "url": "https://files.pythonhosted.org/packages/49/cf/560b1d0518c7dd4486712e8dc6a94389e27fbdf5fda535e7f4053d7990c8/planship-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e15a6135455a9cfe7e656c6988c60449da9c34504525209d8164e49c98b336a0",
                "md5": "ce9cdec05b820a6981e9802e98081d08",
                "sha256": "9980e1db9a0396581d396b98b6a79a6561c1e4ba7ea5673af36f49f604ad6fb9"
            },
            "downloads": -1,
            "filename": "planship-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ce9cdec05b820a6981e9802e98081d08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6824,
            "upload_time": "2024-02-27T08:20:42",
            "upload_time_iso_8601": "2024-02-27T08:20:42.839405Z",
            "url": "https://files.pythonhosted.org/packages/e1/5a/6135455a9cfe7e656c6988c60449da9c34504525209d8164e49c98b336a0/planship-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-27 08:20:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "planship",
    "github_project": "planship-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "planship"
}
        
Elapsed time: 0.22745s