Skip to main content

Python library for cryptocurrency trading

Project description

crypto-alpine

Python library for cryptocurrency trading using the most common exchanges.

How to install

pip install -U crypto-alpine

Documentation

  1. Set environment variables (optional)
export API_SECRET_KEY=xxx
export API_ACCESS_KEY=yyy
export API_PASSPHRASE=zzz
  1. Initialize
from alpine.exchanges import Wrapper

w = Wrapper('bitget')

Note that if you don't want to use enviroment variables (if you wish to use the library within your code), you can define them during the initialization:

from alpine.exchanges import Wrapper

w = Wrapper('bitget', <access_key>, <secret_key>, <passphrase>)
  1. Set a leverage
w.set_leverage(leverage, position, symbol, margin_coin)
# Example: w.set_leverage(10, "long", "FETUSDT", "usdt")
  1. Create an order
w.create_order(position, symbol, price, amount, margin_coin, take_profit, stop_loss)
# Example: w.create_order("long", "FETUSDT", 2.5, 100, "usdt", 3, 2)
  1. Get order detail
w.get_order_detail(symbol, order_id)
# Example: w.get_order_detail("FETUSDT", "123456")
  1. Get current position detail
w.get_current_position(symbol, margin_coin)
# Example: w.get_current_position("FETUSDT", "usdt")
  1. Get historical position detail
w.get_historical_position(symbol, margin_coin)
# Example: w.get_historical_position("FETUSDT", "usdt")

Current supported cryptocurrency exchanges

  • bitget

Need help

Please create an issue if you need a feature/exchange to be implemented.

Support

If you wish to support the project:

  • Ethereum: 0xf11B49666d3386C96Af1A496bFA5688c83B25E8e
  • Solana: C7USpoN4kxEm81w3mpK7FuNQ7zcMWY9fqyuacPafRqnk
  • Bitcoin (segwit): bc1qcq7fdn4khlsc5ldmlf0ezks8p9r5q2hn04lyy5

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crypto_alpine-0.1.2.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

crypto_alpine-0.1.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file crypto_alpine-0.1.2.tar.gz.

File metadata

  • Download URL: crypto_alpine-0.1.2.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.2.0

File hashes

Hashes for crypto_alpine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d45ed8123907e5c0e1e2003296de8f5adc2b756c3af6c47352ef2ec08c243ca0
MD5 1cd7f7e4787caf00813116e0f30556b3
BLAKE2b-256 bf4308a6c925c0af4cf58b0aea7451d63ecaa754944cdb9fa1aceef4e8c4563f

See more details on using hashes here.

File details

Details for the file crypto_alpine-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: crypto_alpine-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.2.0

File hashes

Hashes for crypto_alpine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6b68779cdae871fadaa9824004752801328108178d88ee4df817d683ff7dd8d
MD5 1e6413e1bfcaa4498212a14fd11451f9
BLAKE2b-256 10aea237ccef66b574ed5e7b345f8442284bdda64ef740acbfbeae0cfdf8e78d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page