FinancePype is a Python library for trading on centralized and decentralized exchanges.
Project description
Finance Pypeline
A Python framework for managing and executing trading operations across multiple platforms with a focus on reliability and consistency.
Overview
financepype is a modular trading framework designed to:
- Handle multi-platform trading operations
- Manage trading pairs and balances
- Track operations and their states
- Enforce trading rules and validations
- Support both spot and perpetual trading
It is inspired by some of the concepts used in hummingbot, but with a focus on simplicity and flexibility.
Features
- Multi-Platform Support: Seamlessly integrate with both centralized and decentralized exchanges
- Advanced Order Management:
- Support for various order types (Market, Limit)
- Order modifiers (Post-Only, Reduce-Only, IOC, FOK)
- Position management for derivatives trading
- Asset Management:
- Spot trading support
- Perpetual futures trading
- Options trading support
- Blockchain asset integration
- Balance Tracking:
- Real-time balance updates
- Multi-currency support
- PnL tracking
- Trading Rules Engine:
- Customizable trading rules
- Risk management constraints
- Position sizing rules
- Operation Tracking:
- Order state management
- Transaction tracking
- Fee calculation and tracking
Installation
The package requires Python 3.13 or later. You can install it using Poetry:
poetry add financepype
Or with pip:
pip install financepype
Quick Start
Here's a simple example of how to use financepype:
from financepype.assets.factory import AssetFactory
from financepype.platforms.platform import Platform
from financepype.markets.trading_pair import TradingPair
# Initialize platform
platform = Platform(identifier="binance")
# Get assets
btc = AssetFactory.get_asset(platform, "BTC")
usdt = AssetFactory.get_asset(platform, "USDT")
# Create trading pair
trading_pair = TradingPair(name="BTC-USDT")
Development
Setup
- Clone the repository:
git clone https://github.com/gianlucapagliara/financepype.git
cd financepype
- Install dependencies with Poetry:
poetry install
- Set up pre-commit hooks:
poetry run pre-commit install
Testing
Run the test suite:
poetry run pytest
Code Quality
The project uses several tools to maintain code quality:
- Black for code formatting
- isort for import sorting
- mypy for static type checking
- ruff for linting
- pre-commit hooks for automated checks
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file financepype-0.3.4.tar.gz.
File metadata
- Download URL: financepype-0.3.4.tar.gz
- Upload date:
- Size: 262.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9417fd769849f20b47d69b1e4e5dac6b1078d40723af9382da8aa60b930c729
|
|
| MD5 |
e36e863bc71f32192ad3cfa3a3ba812f
|
|
| BLAKE2b-256 |
44b4b22bc1e2334cda7ddd1f7836857508840a7f196b4e9fbe6de90db1235586
|
File details
Details for the file financepype-0.3.4-py3-none-any.whl.
File metadata
- Download URL: financepype-0.3.4-py3-none-any.whl
- Upload date:
- Size: 133.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa8fde0618dfd8118abefd8bcef00931b0e8365079be1ad59ca44eec24ba370
|
|
| MD5 |
770cbc9402180111e46690e74f843999
|
|
| BLAKE2b-256 |
494d940c05e8a005fe75e10ed81632cdfab36498b31ec4296f5a4a6b15ec30a5
|