# Installation
* pip install --upgrade lbank-connector-python -i https://pypi.org/simple
## Contract Call
* You need to apply for the corresponding api_key and api_secret
* The api_key and sign parameters will be encapsulated and added to the request parameters internally, users do not need to worry about it.
* API example
```python
from lbank.old_api import BlockHttpClient
import logging
api_key = ""
api_secret = ""
# service address
base_url = "https://api.lbkex.com/"
# Encryption method
sign_method = "RSA"
client = BlockHttpClient(
sign_method=sign_method,
api_key=api_key,
api_secret=api_secret,
base_url=base_url,
log_level=logging.DEBUG,
)
# Pairs api
api_url = "v2/currencyPairs.do"
res = client.http_request("get", api_url)
print(res)
# withdrawConfigs api
api_url = "v2/withdrawConfigs.do"
payload = {
"assetCode": "btc"
}
res = client.http_request("get", api_url, payload=payload)
print(res)
payload = {}
response = client.http_request("post", "v2/user_info.do", payload=payload)
print(response)
```
* Websocket example
```python
from lbank.websocket.websocket_client import LbankWebsocketClient
def sub_deep_data():
ws_client = LbankWebsocketClient(
base_url="",
on_message=on_message,
)
subscribe_msg = {
}
ws_client.send(subscribe_msg)
def on_message(ws_client, msg):
print(f"msg:{msg}")
if __name__ == '__main__':
sub_deep_data()
````
Raw data
{
"_id": null,
"home_page": null,
"name": "lbank-connector-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "LBANK, Public API, python, connector",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ed/cb/a4f92539a11dabdffcbe2e1acdb45c70e374bd31b278e533fb4e9ed6b192/lbank-connector-python-1.0.136.tar.gz",
"platform": null,
"description": "# Installation\n* pip install --upgrade lbank-connector-python -i https://pypi.org/simple\n## Contract Call\n* You need to apply for the corresponding api_key and api_secret\n* The api_key and sign parameters will be encapsulated and added to the request parameters internally, users do not need to worry about it.\n* API example\n```python\nfrom lbank.old_api import BlockHttpClient\nimport logging\napi_key = \"\"\napi_secret = \"\"\n# service address\nbase_url = \"https://api.lbkex.com/\"\n# Encryption method\nsign_method = \"RSA\"\nclient = BlockHttpClient(\n sign_method=sign_method,\n api_key=api_key,\n api_secret=api_secret,\n base_url=base_url,\n log_level=logging.DEBUG,\n)\n# Pairs api\napi_url = \"v2/currencyPairs.do\"\nres = client.http_request(\"get\", api_url)\nprint(res)\n# withdrawConfigs api\napi_url = \"v2/withdrawConfigs.do\"\npayload = {\n \"assetCode\": \"btc\"\n}\nres = client.http_request(\"get\", api_url, payload=payload)\nprint(res)\npayload = {}\nresponse = client.http_request(\"post\", \"v2/user_info.do\", payload=payload)\nprint(response)\n```\n* Websocket example\n```python\nfrom lbank.websocket.websocket_client import LbankWebsocketClient\ndef sub_deep_data():\n ws_client = LbankWebsocketClient(\n base_url=\"\",\n on_message=on_message,\n )\n subscribe_msg = {\n }\n ws_client.send(subscribe_msg)\n\n\ndef on_message(ws_client, msg):\n print(f\"msg:{msg}\")\n\n\nif __name__ == '__main__':\n sub_deep_data()\n````\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LBANK connector for the public API, private API, and websockets.",
"version": "1.0.136",
"project_urls": null,
"split_keywords": [
"lbank",
" public api",
" python",
" connector"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "03014117c5ce55f2d5f5f2a8cba9b8c14084598596756b6ce2f4223352a57fed",
"md5": "93af1c07a4693cd55ca5086936a9738c",
"sha256": "a8685e143f18dded115278ce8ad1f796f649bd8fc45cf5d018f98734a2e475a9"
},
"downloads": -1,
"filename": "lbank_connector_python-1.0.136-py3-none-any.whl",
"has_sig": false,
"md5_digest": "93af1c07a4693cd55ca5086936a9738c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16714,
"upload_time": "2024-07-17T07:32:36",
"upload_time_iso_8601": "2024-07-17T07:32:36.809862Z",
"url": "https://files.pythonhosted.org/packages/03/01/4117c5ce55f2d5f5f2a8cba9b8c14084598596756b6ce2f4223352a57fed/lbank_connector_python-1.0.136-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "edcba4f92539a11dabdffcbe2e1acdb45c70e374bd31b278e533fb4e9ed6b192",
"md5": "b7c0d67474adc40f4fa1a8c280453f0e",
"sha256": "440297292c22e339df4f76e0dbcad2195808c70242065cda4d3285284080a871"
},
"downloads": -1,
"filename": "lbank-connector-python-1.0.136.tar.gz",
"has_sig": false,
"md5_digest": "b7c0d67474adc40f4fa1a8c280453f0e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12318,
"upload_time": "2024-07-17T07:32:39",
"upload_time_iso_8601": "2024-07-17T07:32:39.148898Z",
"url": "https://files.pythonhosted.org/packages/ed/cb/a4f92539a11dabdffcbe2e1acdb45c70e374bd31b278e533fb4e9ed6b192/lbank-connector-python-1.0.136.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-17 07:32:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lbank-connector-python"
}