معرفی شرکت ها


bitcoinrpc-0.5.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Lightweight Bitcoin JSON-RPC Python asynchronous client
ویژگی مقدار
سیستم عامل -
نام فایل bitcoinrpc-0.5.0
نام bitcoinrpc
نسخه کتابخانه 0.5.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Libor Martinek
ایمیل نویسنده libasmartinek@protonmail.com
آدرس صفحه اصلی https://github.com/bibajz/bitcoin-python-async-rpc
آدرس اینترنتی https://pypi.org/project/bitcoinrpc/
مجوز MIT
# bitcoin-python-async-rpc Lightweight Bitcoin async JSON-RPC Python client. Serves as a tiny layer between an application and a Bitcoin daemon, its primary usage is querying the current state of Bitcoin blockchain, network stats, transactions... If you want complete Bitcoin experience in Python, consult [python-bitcoinlib](https://github.com/petertodd/python-bitcoinlib). ## Installation ```bash $ pip install bitcoinrpc ``` ## Supported methods Here is a list of supported methods, divided by their categories. Should you need method not implemented, wrap the call in `BitcoinRPC.acall(<your_method>, ...)` coroutine. ### Blockchain | Method | Supported? | |------------|:----------------:| | `getbestblockhash` | ✔ | | `getblock` | ✔ | | `getblockchaininfo` | ✔ | | `getblockcount` | ✔ | | `getblockhash` | ✔ | | `getblockheader` | ✔ | | `getblockstats` | ✔ | | `getchaintips` | ✔ | | `getdifficulty` | ✔ | | `getmempoolinfo` | ✔ | | `getnetworkhashps` | ✔ | ### Mining | Method | Supported? | |------------|:----------------:| | `getmininginfo` | ✔ | ### Network | Method | Supported? | |------------|:----------------:| | `getconnectioncount` | ✔ | | `getnetworkinfo` | ✔ | ### Raw transactions | Method | Supported? | |------------|:----------------:| | `getrawtransaction` | ✔ | ## Usage Minimal illustration (assuming Python 3.8+, where you can run `async` code in console) ``` $ python -m asyncio >>> import asyncio >>> >>> from bitcoinrpc import BitcoinRPC >>> rpc = BitcoinRPC("http://localhost:18443" "rpc_user", "rpc_passwd") >>> await rpc.getconnectioncount() 10 >>> await rpc.aclose() # Clean-up resource ``` You can also use the `BitcoinRPC` as an asynchronous context manager, which does all the resource clean-up automatically, as the following example shows: ``` $ cat btc_rpc_minimal.py import asyncio from bitcoinrpc import BitcoinRPC async def main(): async with BitcoinRPC("http://localhost:18443", "rpc_user", "rpc_password") as rpc: print(await rpc.getconnectioncount()) if __name__ == "__main__": asyncio.run(main()) ``` Running this script yields: ``` $ python btc_rpc_minimal.py 10 ``` ## Changelog - **2021/12/28 - 0.5.0** change the signature of `BitcoinRPC` from `host, port, ...` to `url, ...`, delegating the creation of the node url to the caller. ## License MIT


نیازمندی

مقدار نام
>=3 orjson
<1 httpx
>=3.7.4.3 typing-extensions


زبان مورد نیاز

مقدار نام
>=3.7 Python


نحوه نصب


نصب پکیج whl bitcoinrpc-0.5.0:

    pip install bitcoinrpc-0.5.0.whl


نصب پکیج tar.gz bitcoinrpc-0.5.0:

    pip install bitcoinrpc-0.5.0.tar.gz