Skip to main content

Senatus: a trading and market analisys lib

Project description

Senatus

PyPI version Python License: MIT

A WIP Python library for building trading bots and performing market analysis. Senatus wraps the Binance API (spot and futures) and provides utilities for retrieving market data, computing technical indicators, and visualizing results — so you can focus on strategy logic instead of boilerplate.


Features

  • Binance integration — spot and futures market data via binance-connector and binance-futures-connector
  • Data handling — market data returned as pandas DataFrames, ready for analysis
  • Numerical analysisnumpy-based computations for signal processing and indicator math
  • Visualization — interactive charts via plotly for exploring price action and indicators
  • (WIP)Bot-ready — designed as a foundation for automated trading strategies

Installation

pip install senatus

Virtual environment (recommended)

python3 -m venv .venv
source .venv/bin/activate   # On Windows: .venv\Scripts\activate
pip install senatus

Quickstart

# Example: fetch OHLCV data and compute a simple moving average
# (full API reference coming soon — see the senatus/ source directory)

from senatus.api.binanceAPI import (getPastCandlesTimeSeries)
from senatus.indicators.indicators import (getMAV, getEMA, getWRSI, find_top)
from senatus.plot import Plot
from senatus.test_trader import TestTrader
from senatus.strategies import RSI_Margins_Strategy, BoolIndicatorStrategy

# Define your parameters
pair = 'bnbusdt'
timeframe = '1h'


# Get past data
priceSeries = getPastCandlesTimeSeries(pair, timeframe)


# Plot data
my_plot = Plot(priceSeries)

my_plot.plot_asset_chart()

wrsi = getWRSI(priceSeries, 8)

my_plot.plot_indicator_dif_chart(wrsi)

is_top = find_top(priceSeries, 25, 0)

tt = TestTrader(priceSeries, 1000)

# Test bot
tt.operate_strategy(is_top, BoolIndicatorStrategy(), my_plot)
tt.operate_strategy(wrsi, RSI_Margins_Strategy(15, 80), my_plot)

my_plot.apply_custom().show()

Full quickstart examples are in progress. See the senatus/ package directory for available modules and the test/ directory for usage patterns.


Dependencies

Package Purpose
numpy >= 2.2.3 Numerical computation
pandas >= 2.2.3 Market data as DataFrames
plotly >= 5.24.0 Interactive charting
binance-connector >= 3.12.0 Binance Spot API
binance-futures-connector >= 4.1.0 Binance Futures API

Project Structure

senatus/
├── senatus/        # Core library package
├── test/           # Tests and usage examples
├── pyproject.toml  # Package metadata and dependencies
└── LICENSE.txt

Roadmap

  • Initial technical indicator library (RSI, MACD, Bollinger Bands, etc.)
  • Complete quickstart documentation with code examples
  • Backtesting utilities
  • Strategy base class for building trading bots

License

MIT — see LICENSE.txt for details.


Author

Marco PenaforteLinkedIn · Portfolio

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

senatus-0.0.7.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

senatus-0.0.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file senatus-0.0.7.tar.gz.

File metadata

  • Download URL: senatus-0.0.7.tar.gz
  • Upload date:
  • Size: 10.3 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":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for senatus-0.0.7.tar.gz
Algorithm Hash digest
SHA256 94ce750f718046d46ca88c2b37bdbed3dd9a315a5c0f267cfe597bff5faeb67e
MD5 f696edfa780e6bf49020e5f6ebc24344
BLAKE2b-256 a746caf2be911ab11f9a58afeea4fd5ff890d4370993ff66b488f8918aea6d8c

See more details on using hashes here.

File details

Details for the file senatus-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: senatus-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for senatus-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7d805d3aae1cc410fce4cb86f1ed5551f2675150881439960853af87d4523acb
MD5 812996f1dd3ea07ebdfa1679457618e7
BLAKE2b-256 1cbb9e1d083f00553cfd6c94a0e459dae4156612d7f12dbfd668ed6bca1dd75a

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