upbit-client


Nameupbit-client JSON
Version 1.3.4.1 PyPI version JSON
download
home_pagehttps://github.com/uJhin/upbit-client
SummaryUpbit OPEN API Client
upload_time2023-05-22 05:28:27
maintainer
docs_urlNone
authorujhin
requires_python>=3.8
licenseMIT License
keywords upbit upbit upbit-client upbit-client upbit_client upbit-api-connector upbit-api-connector upbit_api_connector upbit_api_connector
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://raw.githubusercontent.com/uJhin/upbit-client/main/logo/logo.png
    :align: center

- `Base Repository <https://github.com/uJhin/upbit-client/>`_
- `Python Upbit Client Repository <https://github.com/uJhin/python-upbit-client>`_

Upbit OPEN API Client
######################
- @Author: `uJhin <https://github.com/uJhin>`_
- @GitHub: https://github.com/uJhin/upbit-client/
- @Official Documents: https://ujhin.github.io/upbit-client-docs/

Install
*******
- pip command

.. code:: console

    pip install upbit-client

- git command

.. code:: console

    git clone https://github.com/uJhin/python-upbit-client.git


Quick Start
***************

REST Client
===========

- Check Your API Keys

.. code:: python

    # /v1/api_keys

    from upbit.client import Upbit

    access_key = "Your Access Key"
    secret_key = "Your Secret Key"

    client = Upbit(access_key, secret_key)
    api_keys = client.APIKey.APIKey_info()
    print(api_keys['result'])


- Buy Currency

.. code:: python

    # /v1/orders

    from upbit.client import Upbit

    access_key = "Your Access Key"
    secret_key = "Your Secret Key"

    client = Upbit(access_key, secret_key)
    order = client.Order.Order_new(
        market='KRW-BTC',
        side='bid',
        volume='0.1',
        price='3000000',
        ord_type='limit'
    )
    print(order['result'])


- Sell Currency

.. code:: python

    # /v1/orders

    from upbit.client import Upbit

    access_key = "Your Access Key"
    secret_key = "Your Secret Key"

    client = Upbit(access_key, secret_key)
    order = client.Order.Order_new(
        market='KRW-BTC',
        side='ask',
        volume='0.1',
        price='3000000',
        ord_type='limit'
    )
    print(order['result'])

WebSocket Client
================

- Get Real-Time Ticker

.. code:: python

    # Using WebSocket

    import json
    import asyncio

    from upbit.websocket import UpbitWebSocket


    # Definition async function
    async def ticker(sock, payload):
        async with sock as conn:
            await conn.send(payload)
            while True:
                recv = await conn.recv()
                data = recv.decode('utf8')
                result = json.loads(data)
                print(result)


    sock = UpbitWebSocket()

    currencies = ['KRW-BTC', 'KRW-ETH']
    type_field = sock.generate_type_field(
        type='ticker',
        codes=currencies,
    )
    payload = sock.generate_payload(
        type_fields=[type_field]
    )

    event_loop = asyncio.get_event_loop()
    event_loop.run_until_complete( ticker(sock, payload) )

Donation
*********
.. image:: https://img.shields.io/badge/BTC-3NVw2seiTQddGQwc1apqudKxuTqebpyL3s-blue?style=flat-square&logo=bitcoin
  :alt: uJhin's BTC
.. image:: https://img.shields.io/badge/ETH-0x60dd373f59862d9df776596889b997e24bee42eb-blue?style=flat-square&logo=ethereum
  :alt: uJhin's ETH

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/uJhin/upbit-client",
    "name": "upbit-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Upbit,upbit,upbit-client,Upbit-Client,Upbit_client,Upbit-api-connector,upbit-api-connector,Upbit_api_connector,upbit_api_connector",
    "author": "ujhin",
    "author_email": "ujhin942@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1c/12/d672175b65326fe5e777f624be0393849fe4f0e52b3cb31dcdbc1bc9084e/upbit-client-1.3.4.1.tar.gz",
    "platform": null,
    "description": ".. image:: https://raw.githubusercontent.com/uJhin/upbit-client/main/logo/logo.png\n    :align: center\n\n- `Base Repository <https://github.com/uJhin/upbit-client/>`_\n- `Python Upbit Client Repository <https://github.com/uJhin/python-upbit-client>`_\n\nUpbit OPEN API Client\n######################\n- @Author: `uJhin <https://github.com/uJhin>`_\n- @GitHub: https://github.com/uJhin/upbit-client/\n- @Official Documents: https://ujhin.github.io/upbit-client-docs/\n\nInstall\n*******\n- pip command\n\n.. code:: console\n\n    pip install upbit-client\n\n- git command\n\n.. code:: console\n\n    git clone https://github.com/uJhin/python-upbit-client.git\n\n\nQuick Start\n***************\n\nREST Client\n===========\n\n- Check Your API Keys\n\n.. code:: python\n\n    # /v1/api_keys\n\n    from upbit.client import Upbit\n\n    access_key = \"Your Access Key\"\n    secret_key = \"Your Secret Key\"\n\n    client = Upbit(access_key, secret_key)\n    api_keys = client.APIKey.APIKey_info()\n    print(api_keys['result'])\n\n\n- Buy Currency\n\n.. code:: python\n\n    # /v1/orders\n\n    from upbit.client import Upbit\n\n    access_key = \"Your Access Key\"\n    secret_key = \"Your Secret Key\"\n\n    client = Upbit(access_key, secret_key)\n    order = client.Order.Order_new(\n        market='KRW-BTC',\n        side='bid',\n        volume='0.1',\n        price='3000000',\n        ord_type='limit'\n    )\n    print(order['result'])\n\n\n- Sell Currency\n\n.. code:: python\n\n    # /v1/orders\n\n    from upbit.client import Upbit\n\n    access_key = \"Your Access Key\"\n    secret_key = \"Your Secret Key\"\n\n    client = Upbit(access_key, secret_key)\n    order = client.Order.Order_new(\n        market='KRW-BTC',\n        side='ask',\n        volume='0.1',\n        price='3000000',\n        ord_type='limit'\n    )\n    print(order['result'])\n\nWebSocket Client\n================\n\n- Get Real-Time Ticker\n\n.. code:: python\n\n    # Using WebSocket\n\n    import json\n    import asyncio\n\n    from upbit.websocket import UpbitWebSocket\n\n\n    # Definition async function\n    async def ticker(sock, payload):\n        async with sock as conn:\n            await conn.send(payload)\n            while True:\n                recv = await conn.recv()\n                data = recv.decode('utf8')\n                result = json.loads(data)\n                print(result)\n\n\n    sock = UpbitWebSocket()\n\n    currencies = ['KRW-BTC', 'KRW-ETH']\n    type_field = sock.generate_type_field(\n        type='ticker',\n        codes=currencies,\n    )\n    payload = sock.generate_payload(\n        type_fields=[type_field]\n    )\n\n    event_loop = asyncio.get_event_loop()\n    event_loop.run_until_complete( ticker(sock, payload) )\n\nDonation\n*********\n.. image:: https://img.shields.io/badge/BTC-3NVw2seiTQddGQwc1apqudKxuTqebpyL3s-blue?style=flat-square&logo=bitcoin\n  :alt: uJhin's BTC\n.. image:: https://img.shields.io/badge/ETH-0x60dd373f59862d9df776596889b997e24bee42eb-blue?style=flat-square&logo=ethereum\n  :alt: uJhin's ETH\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Upbit OPEN API Client",
    "version": "1.3.4.1",
    "project_urls": {
        "Download": "https://github.com/uJhin/upbit-client/releases",
        "Homepage": "https://github.com/uJhin/upbit-client"
    },
    "split_keywords": [
        "upbit",
        "upbit",
        "upbit-client",
        "upbit-client",
        "upbit_client",
        "upbit-api-connector",
        "upbit-api-connector",
        "upbit_api_connector",
        "upbit_api_connector"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e88b861f97b05b4995b01881506476b5cab207f1bcf64720a57d937387793731",
                "md5": "7b2cd9cb7e768aec4e50808efd1c0f08",
                "sha256": "8660727f05a62022cce313a23e50aac09817a1319bb8ba755a6178726118eed4"
            },
            "downloads": -1,
            "filename": "upbit_client-1.3.4.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b2cd9cb7e768aec4e50808efd1c0f08",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 14357,
            "upload_time": "2023-05-22T05:28:25",
            "upload_time_iso_8601": "2023-05-22T05:28:25.418128Z",
            "url": "https://files.pythonhosted.org/packages/e8/8b/861f97b05b4995b01881506476b5cab207f1bcf64720a57d937387793731/upbit_client-1.3.4.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c12d672175b65326fe5e777f624be0393849fe4f0e52b3cb31dcdbc1bc9084e",
                "md5": "121fdd2a4263428ece9a67e2e8cf117d",
                "sha256": "af097d59934d7508cea3b3fdfcdddea248a1ef6d2f675b1e593529a5d9901335"
            },
            "downloads": -1,
            "filename": "upbit-client-1.3.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "121fdd2a4263428ece9a67e2e8cf117d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13588,
            "upload_time": "2023-05-22T05:28:27",
            "upload_time_iso_8601": "2023-05-22T05:28:27.117385Z",
            "url": "https://files.pythonhosted.org/packages/1c/12/d672175b65326fe5e777f624be0393849fe4f0e52b3cb31dcdbc1bc9084e/upbit-client-1.3.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-22 05:28:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "uJhin",
    "github_project": "upbit-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "upbit-client"
}
        
Elapsed time: 0.08717s