Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sammchardy/python-binance into me…
Browse files Browse the repository at this point in the history
…dvi/master
  • Loading branch information
carlosmiei committed Oct 21, 2024
2 parents 847f763 + 1db369d commit f0c120e
Show file tree
Hide file tree
Showing 11 changed files with 428 additions and 52 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
env:
PROXY: "http://51.83.140.52:16301"
steps:
- name: Checking env
run: env
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
46 changes: 16 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Updated 11th Aug 2023
.. image:: https://img.shields.io/pypi/l/python-binance.svg
:target: https://pypi.python.org/pypi/python-binance

.. image:: https://img.shields.io/travis/sammchardy/python-binance.svg
:target: https://travis-ci.org/sammchardy/python-binance

.. image:: https://img.shields.io/coveralls/sammchardy/python-binance.svg
:target: https://coveralls.io/github/sammchardy/python-binance

Expand All @@ -22,24 +19,29 @@ Updated 11th Aug 2023
.. image:: https://img.shields.io/pypi/pyversions/python-binance.svg
:target: https://pypi.python.org/pypi/python-binance

.. image:: https://img.shields.io/badge/Telegram-Join%20Us-blue?logo=Telegram
:target: https://t.me/python_binance


This is an unofficial Python wrapper for the `Binance exchange REST API v3 <https://binance-docs.github.io/apidocs/spot/en>`_. I am in no way affiliated with Binance, use at your own risk.

If you came here looking for the `Binance exchange <https://www.binance.com/?ref=10099792>`_ to purchase cryptocurrencies, then `go here <https://www.binance.com/?ref=10099792>`_.
If you came here looking for the `Binance exchange <https://accounts.binance.com/en/register?ref=D7YA7CLY>`_ to purchase cryptocurrencies, then `go here <https://accounts.binance.com/en/register?ref=D7YA7CLY>`_.
If you want to automate interactions with Binance stick around.

If you're interested in Binance's new DEX Binance Chain see my `python-binance-chain library <https://github.com/sammchardy/python-binance-chain>`_

Source code
https://github.com/sammchardy/python-binance

Documentation
https://python-binance.readthedocs.io/en/latest/

Binance API Telegram
https://t.me/binance_api_english
Community Telegram Chat
https://t.me/python_binance

Announcements Channel
https://t.me/python_binance_announcements

Blog with examples including async
https://sammchardy.github.io
Examples including async
https://github.com/sammchardy/python-binance/tree/master/examples

- `Async basics for Binance <https://sammchardy.github.io/binance/2021/05/01/async-binance-basics.html>`_
- `Understanding Binance Order Filters <https://sammchardy.github.io/binance/2021/05/03/binance-order-filters.html>`_
Expand Down Expand Up @@ -79,7 +81,7 @@ converted to use Asynchronous Context Managers. See examples in the Async sectio
Quick Start
-----------

`Register an account with Binance <https://accounts.binance.com/en/register?ref=10099792>`_.
`Register an account with Binance <https://accounts.binance.com/en/register?ref=D7YA7CLY>`_.

`Generate an API Key <https://www.binance.com/en/my/settings/api-management>`_ and assign relevant permissions.

Expand Down Expand Up @@ -171,7 +173,7 @@ pass `testnet=True` when creating the client.
dcm.start_depth_cache(callback=handle_dcm_message, symbol='ETHBTC')
# replace with a current options symbol
options_symbol = 'BTC-210430-36000-C'
options_symbol = 'BTC-241227-41000-C'
dcm.start_options_depth_cache(callback=handle_dcm_message, symbol=options_symbol)
# join the threaded managers to the main thread
Expand Down Expand Up @@ -239,7 +241,7 @@ for more information.
print(depth_cache.get_bids()[:5])
# Vanilla options Depth Cache works the same, update the symbol to a current one
options_symbol = 'BTC-210430-36000-C'
options_symbol = 'BTC-241227-41000-C'
async with OptionsDepthCacheManager(client, symbol=options_symbol) as dcm_socket:
for _ in range(5):
depth_cache = await dcm_socket.recv()
Expand All @@ -258,23 +260,7 @@ for more information.
loop.run_until_complete(main())
Donate
------

If this library helped you out feel free to donate.

- ETH: 0xD7a7fDdCfA687073d7cC93E9E51829a727f9fE70
- LTC: LPC5vw9ajR1YndE1hYVeo3kJ9LdHjcRCUZ
- NEO: AVJB4ZgN7VgSUtArCt94y7ZYT6d5NDfpBo
- BTC: 1Dknp6L6oRZrHDECRedihPzx2sSfmvEBys

Other Exchanges
---------------

If you use `Binance Chain <https://testnet.binance.org/>`_ check out my `python-binance-chain <https://github.com/sammchardy/python-binance-chain>`_ library.

If you use `Kucoin <https://www.kucoin.com/?rcode=E42cWB>`_ check out my `python-kucoin <https://github.com/sammchardy/python-kucoin>`_ library.

If you use `IDEX <https://idex.market>`_ check out my `python-idex <https://github.com/sammchardy/python-idex>`_ library.

.. image:: https://ga-beacon.appspot.com/UA-111417213-1/github/python-binance?pixel&useReferer
If you use `Kucoin <https://www.kucoin.com/ucenter/signup?rcode=E5wkqe>`_ check out my `python-kucoin <https://github.com/sammchardy/python-kucoin>`_ library.
Loading

0 comments on commit f0c120e

Please sign in to comment.