Shadab Jamadar Logo
Back to all products
TRADING SYSTEMS

Filoos - Unified Python SDK.

Unified Python SDK for Programmatic Trading

A unified, type-safe Python SDK for programmatic trading on Indian stock exchanges. It abstracts broker-specific APIs behind a clean, domain-driven interface.

Launch Specifications

StatusProduction
LaunchedJan 2026
Active UsersN/A (Research)
ScaleTRADING

Product Overview

Filoos is a standalone, PyPI-installable Python package that provides a single interface to trade across multiple Indian stockbrokers. It eliminates cryptic symbol strings and broker-specific idiosyncrasies by introducing strict Domain Objects and Type-Safe Enums.

  • Broker-agnostic interface across Zerodha and Angel One.
  • Type-safe Python Enums for transaction and order types.
  • Auto-provisioned SQLite master contract database for O(1) resolution.
  • Memory-efficient domain objects using dataclasses with slots.

What Filoos - Unified Python SDK Can Generate

Type Safety

Python enums prevent cryptic string errors.

Broker Agnostic

Switch brokers by changing a single line of code.

Local Resolver

SQLite database for O(1) contract resolution.

Shim Architecture

Safely ports upstream code without dependencies.

40%
RAM Saved via Slots
O(1)
Token Lookup Latency
100K+
Instruments Indexed
0
Server Dependencies

The Problem

Programmatic trading in India requires wrestling with poorly documented, inconsistent APIs across different brokers. Developers waste time writing boilerplate authentication, tracking cryptic contract tokens, and managing broker-specific JSON responses.

Our Solution

A unified, type-safe interface that wraps broker APIs. Users trade using intuitive Domain Objects (Equity, Future, Option) while the library handles token resolution, request formatting, and canonical responses.

Technical Architecture

The SDK uses a 'Shim' pattern to port battle-tested execution logic from OpenAlgo, decoupling it from Flask dependencies. A local SQLite database acts as a master contract resolver, mapping domain objects to broker-specific tokens instantly.

Shim & Execution Architecture

USER CODEDomain ObjectsEquity, Future, Option
ADAPTERBroker WrapperResolves Contract Tokens
CORE SHIMPorted LogicDependency Injection Context
EXECUTIONBroker APIRaw Network Calls

Tech Stack

PythonSQLiteDataclassesType Hints

Dashboard View Simulation

main.py - filoos
from filoos.brokers import Zerodha
from filoos.instruments import Equity
from filoos.constants import TransactionType

# Initialize broker safely without leaking API strings
broker = Zerodha(api_key, access_token)

# Place order using strict Domain Objects
order_res = broker.place_order(
Equity("RELIANCE"),
TransactionType.BUY,
quantity=10
)

print(f"Order placed: {order_res.order_id}")
TERMINAL
$ python main.py
[INFO] SQLite Resolver: Loaded 112,450 instruments
[INFO] Resolving token for Equity(symbol='RELIANCE') -> 738561
Order placed: 24012500194833

Key Engineering Challenges

  • Porting complex broker execution logic without bringing over heavy web framework dependencies.
  • Resolving ambiguous options contracts safely across millions of available strikes.
  • Keeping broker logic automatically synced with upstream open-source releases.

Key Lessons Learned

  • Using the __init_subclass__ pattern allows zero-boilerplate registration for new broker adapters.
  • Setting frozen=True and slots=True on Dataclasses reduces RAM consumption by ~40% for 100K+ instruments.
  • A flat SQLite table structure provides the absolute fastest O(1) token resolution for algorithmic latency.

Development Roadmap

Phase 1Completed

Core SDK & Zerodha

Domain objects and type-safe enums.

Phase 2Completed

Angel One Integration

Extending adapter interface to new brokers.

Phase 3Planned

WebSocket Streaming

Real-time tick data via callbacks.

Related Products

Every product is built with a focus on solving real problems.

Interested in engineering collaboration, specialized quantitative models, or custom educational AI solutions? Let's connect.

Let's Connect