Skip to main content

Small convenience wrapper for Bybit spot market orders.

Project description

ezbybit

A small Python wrapper around pybit for simple Bybit spot BTC/ETH market orders.

Installation

Install from PyPI once the first release is published:

pip install ezbybit

For local development:

python -m pip install -e .

Usage

from ezbybit import BybitClient

client = BybitClient(
    api_key="YOUR_BYBIT_API_KEY",
    api_secret="YOUR_BYBIT_API_SECRET",
    testnet=True,
)

print(client.get_available_budget_usdt())

Place a market buy order using 80% of available USDT:

response = client.buy("BTC")
print(response)

response = client.buy("ETH")
print(response)

Sell available BTC or ETH:

response = client.sell("BTC")
print(response)

response = client.sell("ETH")
print(response)

By default, buy() uses 80% of available USDT. Pass a different ratio with Decimal:

from decimal import Decimal

response = client.buy("ETH", Decimal("0.5"))

You can also run the local example with environment variables:

export BYBIT_API_KEY="YOUR_BYBIT_API_KEY"
export BYBIT_API_SECRET="YOUR_BYBIT_API_SECRET"
python examples/basic.py

The package also installs a small CLI:

ezbybit --version

Build

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*

Publish

Publish to TestPyPI first:

python -m twine upload --repository testpypi dist/*

Then publish to PyPI:

python -m twine upload dist/*

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

ezbybit-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezbybit-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file ezbybit-0.1.1.tar.gz.

File metadata

  • Download URL: ezbybit-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ezbybit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6647851c791ac5e2a0353e99cce254c4b7c730806b72363eae25688dd3bf9d7d
MD5 fad7fab6442753095c23956528cd4b19
BLAKE2b-256 23cbcd07cf549e5b5a5598bffa41d7f68d991bf6a892819ffaf653c7bf9a6979

See more details on using hashes here.

File details

Details for the file ezbybit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ezbybit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ezbybit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21c68069edd16f2ce1dc06c95a8771f6211fbd02e62f8b9aac4cf9232b98d51f
MD5 8129019abfea1f0af5286fe704eaac46
BLAKE2b-256 0e2c8fe23772a7b38181e1f7ce7425abc025c3a515f12eb13cb2d34b7be6fc31

See more details on using hashes here.

Supported by

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