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.4.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

crypto_alpine-0.1.4-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crypto_alpine-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 6e9e0db45c9d6976b320d8bd4ee28c3b50f0d64de954302dd7ffb84849344429
MD5 0a7724d6165d423956f8ee9ef9089d36
BLAKE2b-256 714c299cd686aea7c095c3d7af52d06c9d35f8f1ba0ba86b2618fa7de4e60d57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crypto_alpine-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e42526c74ac769e736a03973983cea7383e374405674f787dd70134fa03db79b
MD5 fcfc4fac3b6e4c72205c9730f5fad15e
BLAKE2b-256 2cca9b209e8ea0c54f0ce72a17d2564d7c80edba8633099249b2b87d9fa07875

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