pyTONPublicAPI


NamepyTONPublicAPI JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/Badiboy/pyTONPublicAPI
SummaryPython TON.sh Public API
upload_time2023-03-28 17:23:10
maintainer
docs_urlNone
authorBadiboy
requires_python
licenseMIT license
keywords ton open network api
VCS
bugtrack_url
requirements requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPi Package Version](https://img.shields.io/pypi/v/pyTONPublicAPI.svg)](https://pypi.python.org/pypi/pyTONPublicAPI)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pyTONPublicAPI.svg)](https://pypi.python.org/pypi/pyTONPublicAPI)
[![PyPi downloads](https://img.shields.io/pypi/dm/pyTONPublicAPI.svg)](https://pypi.org/project/pyTONPublicAPI/)

# <p align="center">pyTONPublicAPI</p>
Python implementation of TON Public API for The Open Network (TON).

# Supported API servers
* [TON.sh](https://ton.sh/api/) - full
* [TON Center](https://toncenter.com/api/v2/) - partial, will be extended
* [TON Center Testnet](https://testnet.toncenter.com/api/v2/) - partial, will be extended
* [TON API](https://tonapi.io/v1/) - partial, will be extended
* [TON API Testnet](https://testnet.tonapi.io/v1/) - partial, will be extended

# Installation
Installation using pip (a Python package manager):
```
$ pip install pyTONPublicAPI
```

# Usage
Everything is as simple as the API itself.
1. Create pyTONPublicAPI instance
2. Access API methods in pythonic notation (getAddressInformation -> get_address_information)
```
from pyTONPublicAPI import pyTONPublicAPI
client = pyTONPublicAPI()
print(client.get_address_balance(address = "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"))
```
If you want to work with a single address - you can pre-set it on init and avoid in functions.
```
from pyTONPublicAPI import pyTONPublicAPI
client = pyTONPublicAPI(address = "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N")
print(client.get_address_balance())
print(client.get_transactions())
```
You can also check tests.py.

# Exceptions
Exceptions are rised using pyTONException class.


# API servers
By default all calls are sent to TON.sh server. To select API server you should:
1. Create server object
2. Pass it to pyTONPublicAPI constructor via api_server parameter
```
from pyTONPublicAPI import pyTONPublicAPI, pyTONAPIServerTonCenter
api_server=pyTONAPIServerTonCenter()
client = pyTONPublicAPI(api_server=api_server)
```

## Ton.sh
Class
* pyTONAPIServerTonSh

Additional constructor paramters:
* blockchain_id - Identifier of target blockchain ID, either "mainnet" or "test". Default is "None", so default begaviour is up to API server.

## Ton Center
Class
* pyTONAPIServerTonCenter

Additional constructor paramters:
* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is "None", so API is used without API key.

## Ton Center Testnet
Class
* pyTONAPIServerTonCenterTest

Additional constructor paramters:
* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is "None", so API is used without API key.

## TON API
Class
* pyTONAPIServerTonAPI

Additional constructor paramters:
* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is "None", so API is used without API key.

## TON API Testnet
Class
* pyTONAPIServerTonAPITest

Additional constructor paramters:
* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is "None", so API is used without API key.

# Notes
1. API servers support different subset of commands. Check correspondent API specification before use.   
2. API servers have different reply formats! Currently it's up to you to deal with it. May be once there will be a reply parser for unification.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Badiboy/pyTONPublicAPI",
    "name": "pyTONPublicAPI",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "TON Open Network API",
    "author": "Badiboy",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/17/ba/b2cd6a60e85561a98700b3b29042196022d23a01e1bfa969dedf60c0cd51/pyTONPublicAPI-0.2.1.tar.gz",
    "platform": null,
    "description": "[![PyPi Package Version](https://img.shields.io/pypi/v/pyTONPublicAPI.svg)](https://pypi.python.org/pypi/pyTONPublicAPI)\r\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/pyTONPublicAPI.svg)](https://pypi.python.org/pypi/pyTONPublicAPI)\r\n[![PyPi downloads](https://img.shields.io/pypi/dm/pyTONPublicAPI.svg)](https://pypi.org/project/pyTONPublicAPI/)\r\n\r\n# <p align=\"center\">pyTONPublicAPI</p>\r\nPython implementation of TON Public API for The Open Network (TON).\r\n\r\n# Supported API servers\r\n* [TON.sh](https://ton.sh/api/) - full\r\n* [TON Center](https://toncenter.com/api/v2/) - partial, will be extended\r\n* [TON Center Testnet](https://testnet.toncenter.com/api/v2/) - partial, will be extended\r\n* [TON API](https://tonapi.io/v1/) - partial, will be extended\r\n* [TON API Testnet](https://testnet.tonapi.io/v1/) - partial, will be extended\r\n\r\n# Installation\r\nInstallation using pip (a Python package manager):\r\n```\r\n$ pip install pyTONPublicAPI\r\n```\r\n\r\n# Usage\r\nEverything is as simple as the API itself.\r\n1. Create pyTONPublicAPI instance\r\n2. Access API methods in pythonic notation (getAddressInformation -> get_address_information)\r\n```\r\nfrom pyTONPublicAPI import pyTONPublicAPI\r\nclient = pyTONPublicAPI()\r\nprint(client.get_address_balance(address = \"EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N\"))\r\n```\r\nIf you want to work with a single address - you can pre-set it on init and avoid in functions.\r\n```\r\nfrom pyTONPublicAPI import pyTONPublicAPI\r\nclient = pyTONPublicAPI(address = \"EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N\")\r\nprint(client.get_address_balance())\r\nprint(client.get_transactions())\r\n```\r\nYou can also check tests.py.\r\n\r\n# Exceptions\r\nExceptions are rised using pyTONException class.\r\n\r\n\r\n# API servers\r\nBy default all calls are sent to TON.sh server. To select API server you should:\r\n1. Create server object\r\n2. Pass it to pyTONPublicAPI constructor via api_server parameter\r\n```\r\nfrom pyTONPublicAPI import pyTONPublicAPI, pyTONAPIServerTonCenter\r\napi_server=pyTONAPIServerTonCenter()\r\nclient = pyTONPublicAPI(api_server=api_server)\r\n```\r\n\r\n## Ton.sh\r\nClass\r\n* pyTONAPIServerTonSh\r\n\r\nAdditional constructor paramters:\r\n* blockchain_id - Identifier of target blockchain ID, either \"mainnet\" or \"test\". Default is \"None\", so default begaviour is up to API server.\r\n\r\n## Ton Center\r\nClass\r\n* pyTONAPIServerTonCenter\r\n\r\nAdditional constructor paramters:\r\n* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is \"None\", so API is used without API key.\r\n\r\n## Ton Center Testnet\r\nClass\r\n* pyTONAPIServerTonCenterTest\r\n\r\nAdditional constructor paramters:\r\n* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is \"None\", so API is used without API key.\r\n\r\n## TON API\r\nClass\r\n* pyTONAPIServerTonAPI\r\n\r\nAdditional constructor paramters:\r\n* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is \"None\", so API is used without API key.\r\n\r\n## TON API Testnet\r\nClass\r\n* pyTONAPIServerTonAPITest\r\n\r\nAdditional constructor paramters:\r\n* api_key - Authentication key. Using API without API key is limited to 1 request per second. Default is \"None\", so API is used without API key.\r\n\r\n# Notes\r\n1. API servers support different subset of commands. Check correspondent API specification before use.   \r\n2. API servers have different reply formats! Currently it's up to you to deal with it. May be once there will be a reply parser for unification.\r\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Python TON.sh Public API",
    "version": "0.2.1",
    "split_keywords": [
        "ton",
        "open",
        "network",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17bab2cd6a60e85561a98700b3b29042196022d23a01e1bfa969dedf60c0cd51",
                "md5": "1728a31b904d61718fb0fe994138b050",
                "sha256": "797806f61747e354465ca286b0101289b67c4759e5039df9e981207b72c269ab"
            },
            "downloads": -1,
            "filename": "pyTONPublicAPI-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1728a31b904d61718fb0fe994138b050",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9125,
            "upload_time": "2023-03-28T17:23:10",
            "upload_time_iso_8601": "2023-03-28T17:23:10.351573Z",
            "url": "https://files.pythonhosted.org/packages/17/ba/b2cd6a60e85561a98700b3b29042196022d23a01e1bfa969dedf60c0cd51/pyTONPublicAPI-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-28 17:23:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Badiboy",
    "github_project": "pyTONPublicAPI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "pytonpublicapi"
}
        
Elapsed time: 0.05925s