# 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/c5/7f/0a1a35c0da3c12098394fd143ff091d670053481729a021e147ea45c1ae2/lbank-connector-python-1.0.133.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.133",
"project_urls": null,
"split_keywords": [
"lbank",
" public api",
" python",
" connector"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2e29fb368ad7de165706b6d165b0f934cad81fe79fabfa41143dea209662d0c4",
"md5": "93c8b716fa5b2bd44f79893be55604ea",
"sha256": "daba2a0cf9509be0a4eca28f3580f2320a6bde2263f6f77fda3a37bb7ac09b0b"
},
"downloads": -1,
"filename": "lbank_connector_python-1.0.133-py3-none-any.whl",
"has_sig": false,
"md5_digest": "93c8b716fa5b2bd44f79893be55604ea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16688,
"upload_time": "2024-04-18T03:07:54",
"upload_time_iso_8601": "2024-04-18T03:07:54.604310Z",
"url": "https://files.pythonhosted.org/packages/2e/29/fb368ad7de165706b6d165b0f934cad81fe79fabfa41143dea209662d0c4/lbank_connector_python-1.0.133-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c57f0a1a35c0da3c12098394fd143ff091d670053481729a021e147ea45c1ae2",
"md5": "86188c4080659c783dd096f95d82a78a",
"sha256": "120951796226b54c89491756be8e4cf0c2c2dc20d0fa83c99d0febda02df9113"
},
"downloads": -1,
"filename": "lbank-connector-python-1.0.133.tar.gz",
"has_sig": false,
"md5_digest": "86188c4080659c783dd096f95d82a78a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12286,
"upload_time": "2024-04-18T03:07:56",
"upload_time_iso_8601": "2024-04-18T03:07:56.009429Z",
"url": "https://files.pythonhosted.org/packages/c5/7f/0a1a35c0da3c12098394fd143ff091d670053481729a021e147ea45c1ae2/lbank-connector-python-1.0.133.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-18 03:07:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lbank-connector-python"
}