Skip to content
@trail-language

trail-language

Trail

Trail

A small, declarative language for computing financial indicators, scoring, and screening over panels of securities.


Trail (Tabular Ratios, Analytics & Indicator Language) computes financial ratios, factors, and scores across panels of companies over time, then ranks and screens them. Programs are data, written and validated by both humans and AI agents, and compile to vectorized columnar operations.

model quality on us_main period annual {
    operating_margin = income.operating_income / income.revenue
    score om_score weight 7 {
        2 if operating_margin > 0.12
        1 if operating_margin > 0.05
        else 0
    }
    export composite = weighted_score()
}

The language is tiny at its core; the large function library is written in Trail itself.

Repositories

  • spec is the versioned language specification: EBNF grammar, reference, and standard library.
  • trail-py is the reference implementation (Python).

Install

pip install trail-lang        # the library and the `trail` CLI
pipx install trail-lang       # just the CLI, isolated

License

MIT.

Popular repositories Loading

  1. trail-lang trail-lang Public

    Reference implementation of the Trail expression language (Python)

    Python 2

  2. spec spec Public

    Trail language specification: EBNF grammar, reference, and standard library

    Python

  3. .github .github Public

    Organization profile for trail-language

  4. trail-edgar trail-edgar Public

    SEC EDGAR data source for Trail: normalized 10-K financial statements via edgartools

    Python

  5. trail-gmd trail-gmd Public

    Global Macro Database source for Trail: country-by-year macro indicators (non-commercial data)

    Python

  6. trail-fmp trail-fmp Public

    Financial Modeling Prep data source for the Trail language (via aiofmp)

    Python

Repositories

Showing 6 of 6 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…