Giter Club home page Giter Club logo

binance-trading-api-wrapper's Introduction

Binance Trading API Wrapper

GitHub Workflow Status

About

This project is for futures trading on Binance by api call such as tradingview strategy alert. For this, I used python-binance. Detailed information related to the package can be found through this document page.

Usage

Clone this project

git clone https://github.com/Jeonghun-Ban/binance-trading-api-wrapper.git

Install dependency packages

pip install -r requirements.txt

Configuration

1. config files

Configuration files using YAML format are in /configs.

cp example.toml production.toml
cp example.toml development.toml
cp example.toml testing.toml

You can easily create config files by copying example.toml.

2. Environment variable

Register api key, secret key in environment variable for accessing binance network before running on the server.

  • BINANCE_TESTNET_API_KEY
  • BINANCE_TESTNET_SECRET_KEY
  • BINANCE_MAINNET_API_KEY
  • BINANCE_MAINNET_SECRET_KEY

The environment variable name is set as above.

if you only access mainnet, you don't need to register testnet keys.

Start launcher

python launcher [-h][-a][-p][-e] # help, address, port, environment
python launcher -e development # run server with development env
python launcher -e testing # run server with testing env

launcher.py runs with address=0.0.0.0, port=5000, environment=production if there are no arguments.

The testing environment connects to the Binance testnet. Therefore, you need to set api_key, api_secret as environment variable before executing server.

Build apidocs pages

python apidocs.py > openapi.yaml
redoc-cli bundle openapi.yaml -o ./publish/index.html

This requires a redoc-cli installation.

Components

.
├── api
│   ├── route
│   │   └── __init__.py
│   │   └── account.py
│   │   └── default.py
│   │   └── market.py
│   │   └── trade.py
│   ├── schema
│   │   └── __init__.py
│   │   └── base.py
│   │   └── account.py
│   │   └── default.py
│   │   └── market.py
│   │   └── trade.py
│   ├── utils
│   │   ├── __init__.py
│   │   └── convert_case.py
│   ├── __init__.py
│   ├── client.py
│   └── enum.py
│   └── spec.py
├── configs
│   └── development.toml
│   └── example.toml
│   └── production.toml
│   └── testing.toml
├── .gitignore
├── .pre-commit-config.yaml
├── apidocs.py
├── launcher.py
├── README.md
├── requirements.txt
└── setup.cfg

binance-trading-api-wrapper's People

Contributors

dependabot[bot] avatar junghoon-vans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

binance-trading-api-wrapper's Issues

bug: raise type_error from api call

TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.