anypay


Nameanypay JSON
Version 1.1.4 PyPI version JSON
download
home_pagehttps://github.com/nikitalm8/anypay
SummaryAsynchronous AnyPay API wrapper
upload_time2023-06-19 21:28:04
maintainer
docs_urlNone
authorNikita Minaev
requires_python
license
keywords python anypay payments anypay-api async asyncio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<div align="left">
    <h1>AnyPayAPI <img src="https://anypay.io/template/img/main/logo-start.svg" width=30 height=30></h1>
    <p align="left" >
        <a href="https://pypi.org/project/anypay/">
            <img src="https://img.shields.io/pypi/v/anypay?style=flat-square" alt="PyPI">
        </a>
        <a href="https://pypi.org/project/anypay/">
            <img src="https://img.shields.io/pypi/dm/anypay?style=flat-square" alt="PyPI">
        </a>
    </p>
</div>

A simple, yet powerful library for AnyPay [API](https://anypay.io/doc/api)


## Usage

With ``AnyPayAPI`` you can easily create and retrieve payment and payout info, get informaition about your account's balance and commissions, etc.

## Documentation

Official docs can be found on the [API's webpage](https://anypay.io/doc/api)

## Installation

```bash
pip install anypay
```

## Requirements

 - ``Python 3.7+``
 - ``httpx``
 - ``pydantic``

## Features

 - ``Asynchronous``
 - ``Exception handling``
 - ``Pydantic return model``
 - ``LightWeight``

## Basic example

```python
import asyncio

from anypay import AnyPayAPI, AnyPayAPIError


api = AnyPayAPI(
    'api_id', 'api_key', check=False,  # you can disable credentials check
) 


async def main():

    try:

        await api.get_balance()

    except AnyPayAPIError as exc:

        print(exc)

    payments = await api.get_payments(project_id=1) # project_id can be provided in __init__
    print(payments[0].id, payments[0].status)

    bill = await api.create_payment(
        pay_id=1234,
        project_id=1,
        method='qiwi',
        email='test@mail.ru',
        amount=100, 
        currency='RUB', 
        description='Test payment', 
    )
    print(bill.id, bill.url)

    bill = await api.create_bill( # easier way to create payment via SCI
        pay_id=1234,
        amount=100,
        project_id=1,
        project_secret='abcd',
    )
    print(bill.id, bill.url)

    #get balance via property (sync)
    print(api.balance)


asyncio.run(main())
```

Developed by Nikita Minaev (c) 2023

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nikitalm8/anypay",
    "name": "anypay",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,anypay,payments,anypay-api,async,asyncio",
    "author": "Nikita Minaev",
    "author_email": "<nikita@minaev.su>",
    "download_url": "https://files.pythonhosted.org/packages/35/4d/a567cc6440b60c6279f68e657255d3db72b6c19aec5421e847435ff3d6cd/anypay-1.1.4.tar.gz",
    "platform": null,
    "description": "\n<div align=\"left\">\n    <h1>AnyPayAPI <img src=\"https://anypay.io/template/img/main/logo-start.svg\" width=30 height=30></h1>\n    <p align=\"left\" >\n        <a href=\"https://pypi.org/project/anypay/\">\n            <img src=\"https://img.shields.io/pypi/v/anypay?style=flat-square\" alt=\"PyPI\">\n        </a>\n        <a href=\"https://pypi.org/project/anypay/\">\n            <img src=\"https://img.shields.io/pypi/dm/anypay?style=flat-square\" alt=\"PyPI\">\n        </a>\n    </p>\n</div>\n\nA simple, yet powerful library for AnyPay [API](https://anypay.io/doc/api)\n\n\n## Usage\n\nWith ``AnyPayAPI`` you can easily create and retrieve payment and payout info, get informaition about your account's balance and commissions, etc.\n\n## Documentation\n\nOfficial docs can be found on the [API's webpage](https://anypay.io/doc/api)\n\n## Installation\n\n```bash\npip install anypay\n```\n\n## Requirements\n\n - ``Python 3.7+``\n - ``httpx``\n - ``pydantic``\n\n## Features\n\n - ``Asynchronous``\n - ``Exception handling``\n - ``Pydantic return model``\n - ``LightWeight``\n\n## Basic example\n\n```python\nimport asyncio\n\nfrom anypay import AnyPayAPI, AnyPayAPIError\n\n\napi = AnyPayAPI(\n    'api_id', 'api_key', check=False,  # you can disable credentials check\n) \n\n\nasync def main():\n\n    try:\n\n        await api.get_balance()\n\n    except AnyPayAPIError as exc:\n\n        print(exc)\n\n    payments = await api.get_payments(project_id=1) # project_id can be provided in __init__\n    print(payments[0].id, payments[0].status)\n\n    bill = await api.create_payment(\n        pay_id=1234,\n        project_id=1,\n        method='qiwi',\n        email='test@mail.ru',\n        amount=100, \n        currency='RUB', \n        description='Test payment', \n    )\n    print(bill.id, bill.url)\n\n    bill = await api.create_bill( # easier way to create payment via SCI\n        pay_id=1234,\n        amount=100,\n        project_id=1,\n        project_secret='abcd',\n    )\n    print(bill.id, bill.url)\n\n    #get balance via property (sync)\n    print(api.balance)\n\n\nasyncio.run(main())\n```\n\nDeveloped by Nikita Minaev (c) 2023\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Asynchronous AnyPay API wrapper",
    "version": "1.1.4",
    "project_urls": {
        "API Docs": "https://anypay.io/doc/api",
        "Bug Tracker": "https://github.com/nikitalm8/anypay/issues",
        "Homepage": "https://github.com/nikitalm8/anypay"
    },
    "split_keywords": [
        "python",
        "anypay",
        "payments",
        "anypay-api",
        "async",
        "asyncio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87d68ee8cc0cda2f9ef3d4004954254dba94541b02426e47b2d444c25916ec93",
                "md5": "e6fb520eb00daca3527ac3e2d6152e64",
                "sha256": "1822eef2fed2dcf18753c588a220573dafe5bb09178eb2744755de587e88e389"
            },
            "downloads": -1,
            "filename": "anypay-1.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6fb520eb00daca3527ac3e2d6152e64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8768,
            "upload_time": "2023-06-19T21:28:02",
            "upload_time_iso_8601": "2023-06-19T21:28:02.106511Z",
            "url": "https://files.pythonhosted.org/packages/87/d6/8ee8cc0cda2f9ef3d4004954254dba94541b02426e47b2d444c25916ec93/anypay-1.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "354da567cc6440b60c6279f68e657255d3db72b6c19aec5421e847435ff3d6cd",
                "md5": "74efed797eba1b542f6077b5c98cb08f",
                "sha256": "b1316372eb3f6c9e00fed4634c37624299e8afcf9ce5a120eba2b6b4eff65c9f"
            },
            "downloads": -1,
            "filename": "anypay-1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "74efed797eba1b542f6077b5c98cb08f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8190,
            "upload_time": "2023-06-19T21:28:04",
            "upload_time_iso_8601": "2023-06-19T21:28:04.335337Z",
            "url": "https://files.pythonhosted.org/packages/35/4d/a567cc6440b60c6279f68e657255d3db72b6c19aec5421e847435ff3d6cd/anypay-1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-19 21:28:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nikitalm8",
    "github_project": "anypay",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "anypay"
}
        
Elapsed time: 0.07751s