Skip to main content

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

  1. Clone the repository:
git clone https://github.com/gianlucapagliara/financepype.git
cd financepype
  1. Install dependencies with Poetry:
poetry install
  1. 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


Download files

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

Source Distribution

financepype-0.1.3.tar.gz (86.3 kB view details)

Uploaded Source

Built Distribution

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

financepype-0.1.3-py3-none-any.whl (120.5 kB view details)

Uploaded Python 3

File details

Details for the file financepype-0.1.3.tar.gz.

File metadata

  • Download URL: financepype-0.1.3.tar.gz
  • Upload date:
  • Size: 86.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.0.0

File hashes

Hashes for financepype-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1cc81726dc59c51380ee4da0a68983fd1ba06507f7c5ee815946a148ef1e5abc
MD5 ca4e4395555b66c9fc4a16bbbf1934cc
BLAKE2b-256 21405750190631c98e5e004ab5daa48915ed5161a5eac54f7605399a399631ed

See more details on using hashes here.

File details

Details for the file financepype-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: financepype-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 120.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.0.0

File hashes

Hashes for financepype-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad2c1b26bb09e8c497c199464c9c0fd56e381f72c97ca93721e4e153baae4cb
MD5 3118e8a8028bf583093931304197a9f5
BLAKE2b-256 a695413262c58f0b5b8b8f476271ab81b4682b1f28a00468a975a30201cb18bf

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