Skip to main content

Python SDK for the SignalNet quant signal aggregation platform

Project description

SignalNet Python SDK

Official Python client for the SignalNet quant signal aggregation platform.

Installation

pip install signalnet-sdk

Quick Start

from signalnet import SignalNet
import pandas as pd

# Initialize the client
sn = SignalNet(api_key="sn_your_api_key")

# Get the current round
current = sn.get_current_round()
print(f"Round {current.id} — status: {current.status}")

# Download features and build predictions
features = sn.download_features(round_id=current.id)
# ... your model here ...

# Submit predictions
predictions = pd.DataFrame({
    "stock_id": features["stock_id"],
    "signal": your_model.predict(features),
})
result = sn.submit(round_id=current.id, predictions=predictions, stake=500)
print(f"Submission {result.id}: {result.status}")

Configuration

Parameter Env Variable Default
api_key SIGNALNET_API_KEY
base_url SIGNALNET_API_URL http://localhost:4000/api
# Explicit config
sn = SignalNet(api_key="sn_...", base_url="https://api.signalnet.xyz")

# Or via environment variables
# export SIGNALNET_API_KEY=sn_...
# export SIGNALNET_API_URL=https://api.signalnet.xyz
sn = SignalNet()

Local Data Cache

Downloaded data is automatically cached as Parquet files in ~/.signalnet/data/. Parquet is 5–10× smaller than CSV, preserves dtypes, and loads instantly on subsequent calls.

~/.signalnet/
└── data/
    ├── rounds/
    │   ├── 1/features.parquet
    │   └── 2/features.parquet
    └── training/
        ├── features.parquet
        └── targets.parquet
# First call downloads from API and caches as parquet
features = sn.download_features(round_id=1)
# [SignalNet] Downloading features for round 1... done (12.4 MB → 2.1 MB parquet)

# Second call loads from cache instantly
features = sn.download_features(round_id=1)
# [SignalNet] Using cached features for round 1 (2.1 MB)

# Force re-download
features = sn.download_features(round_id=1, force=True)

# Cache management
print(sn.cache_info())
# {'cache_dir': '/home/user/.signalnet/data', 'total_size': 2148576,
#  'total_size_human': '2.0 MB', 'round_features': [1, 2], 'training_files': ['features']}

sn.clear_cache()

Configure cache location:

sn = SignalNet(api_key="sn_...", cache_dir="/tmp/sn-cache")
# or: export SIGNALNET_CACHE_DIR=/tmp/sn-cache

API Reference

Rounds

get_current_round() → Round

Get the current active round.

get_rounds(limit=None, offset=None, status=None) → list[Round]

List tournament rounds with optional filters.

get_round(round_id) → Round

Get details for a specific round.

get_round_results(round_id) → list[RoundResult]

Get the leaderboard/results for a resolved round.

Tournaments

get_tournaments() → list[Tournament]

List all tournaments.

get_tournament(slug_or_id) → Tournament

Get a tournament by slug (e.g. "genesis") or ID.

Data Downloads

download_features(round_id, *, force=False) → pd.DataFrame

Download feature data for a round. Returns a pandas DataFrame. Cached as Parquet locally.

download_training_data(data_type, *, force=False) → pd.DataFrame

Download training data. data_type must be "features" or "targets". Cached as Parquet locally.

Cache Management

cache_info() → dict

Return cache stats: directory, total size, cached round IDs, and training files.

clear_cache()

Delete all locally cached data files.

Submissions

submit(round_id, predictions, stake=0) → SubmissionResponse

Submit predictions for a round.

  • predictions: a DataFrame with columns stock_id and signal
  • stake: amount to stake (default 0)

get_my_submission(round_id) → dict

Get your submission for a specific round.

User

get_me() → User

Get the authenticated user's profile.

get_my_scores() → list[ScoreEntry]

Get your score history across rounds.

create_api_key(name=None) → ApiKey

Create a new API key.

list_api_keys() → list[ApiKey]

List all your API keys.

Error Handling

All errors inherit from SignalNetError:

from signalnet import SignalNet, SignalNetError
from signalnet.exceptions import AuthenticationError, NotFoundError, RateLimitError

sn = SignalNet(api_key="sn_...")

try:
    r = sn.get_round(999)
except NotFoundError:
    print("Round not found")
except AuthenticationError:
    print("Bad API key")
except RateLimitError:
    print("Slow down!")
except SignalNetError as e:
    print(f"API error {e.status_code}: {e}")
Exception HTTP Status
AuthenticationError 401, 403
NotFoundError 404
ValidationError 400, 422
RateLimitError 429
ServerError 5xx

Models

All response models are Pydantic v2 BaseModel subclasses with extra="allow", so new API fields won't break existing code.

  • Round — tournament round
  • Tournament — tournament info
  • RoundResult — leaderboard entry
  • SubmissionResponse — submission confirmation
  • User — user profile
  • ScoreEntry — score history entry
  • ApiKey — API key info

License

MIT

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

signalnet_sdk-0.1.5.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

signalnet_sdk-0.1.5-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file signalnet_sdk-0.1.5.tar.gz.

File metadata

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

File hashes

Hashes for signalnet_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bba4bb36afe70cffce797f310b8203873e369d06b32a8e9d4b8b8324f8822d03
MD5 a60e35d7389dcb48bf67a9b93070fd12
BLAKE2b-256 b8ff5655bf06d3a0e198dc218e6a0bfab7547ca75440aa327dc2d6d687e16280

See more details on using hashes here.

File details

Details for the file signalnet_sdk-0.1.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for signalnet_sdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 99850dc80b6b7690183ebe71451808301cfae4d46ccb92dc77a9b3a599c93ba0
MD5 17f7d71b776ceb717c43388c26a019f0
BLAKE2b-256 7e6db65f17e99a542f3aac2ff595e12d57a22c8db72658bc9edd761a7870ffb7

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