A typed Python API for classifying and extracting structured fields from free-form crypto trading messages. The two-stage pipeline identifies the event type and then extracts details such as symbol, entry, stop loss, and take-profit levels.
Note
This project is an educational extraction library. It does not submit trades and does not provide financial advice.
pip install git+https://github.com/kutpat/signal-classification.gitFor local development:
git clone https://github.com/kutpat/signal-classification.git
cd signal-classification
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e .
Copy-Item .env.example .envSet OPENAI_API_KEY in the local .env file. Do not commit that file.
from signal_classification import EventType, analyze_message
result = analyze_message("Long SOL 181.5, SL 175, TP1 195")
print(result.event_type) # EventType.OPEN
print(result.primary_canonical) # SOLUSDT
if result.event_type is EventType.OPEN and result.is_actionable:
print(result.entry, result.stop_loss, result.take_profits)OPENAI_API_KEY— required for model-backed analysis.SIGCLF_LOW_MODEL— defaults togpt-4o-mini.SIGCLF_HIGH_MODEL— defaults togpt-5.
pytest -qThis is a portfolio and educational project. Treat extracted output as untrusted data and validate it before using it in downstream systems.