Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Pola rs Polars API Reference Links

From Leeroopedia


Knowledge Sources
Domains Documentation, API_Reference
Last Updated 2026-02-09 09:00 GMT

Overview

Concrete tool for mapping API names to their documentation URLs across Python and Rust Polars libraries provided by the documentation build system.

Description

API_REFERENCE_LINKS.yml is a YAML configuration file used by the Polars documentation site (docs.pola.rs) to generate cross-referenced API links in code examples. It defines two top-level sections: python and rust, each mapping ~190 API identifiers to their canonical documentation URLs. Entries can be simple (name to URL string) or structured (with name, link, and optional feature_flags fields). The file covers the complete Polars API surface including DataFrame operations, expression methods, I/O functions, SQL interface, namespace accessors (str, dt, list, arr, struct, name), selectors, cloud APIs, and data types. The documentation macros plugin uses this file to generate tabbed code blocks with clickable API reference links.

Usage

This file is consumed by the macro.py MkDocs plugin during documentation builds. When documentation authors use API name references in code examples, the plugin looks up the corresponding URL from this file and generates hyperlinked API references. Developers update this file when adding new public APIs or changing documentation URLs.

Code Reference

Source Location

Signature

python:
  agg: https://docs.pola.rs/.../GroupBy.agg.html
  col: https://docs.pola.rs/.../col.html
  collect: https://docs.pola.rs/.../LazyFrame.collect.html
  # ... ~190 entries
  dt.convert_time_zone:
    name: dt.convert_time_zone
    link: https://docs.pola.rs/.../convert_time_zone.html
    feature_flags: [timezone]

rust:
  agg: https://docs.rs/polars/.../LazyGroupBy.html#method.agg
  col: https://docs.pola.rs/.../fn.col.html
  # ... ~190 entries

Import

# Used by docs/source/_build/scripts/macro.py
# No direct import; consumed by MkDocs build pipeline

I/O Contract

Inputs

Name Type Required Description
API identifier string Yes Short name of the API (e.g., "collect", "scan_parquet")

Outputs

Name Type Description
URL string Canonical documentation URL for the API
name string Display name (for structured entries)
feature_flags list[string] Required Cargo/pip features (for structured entries)

Usage Examples

Simple Entry

python:
  collect: https://docs.pola.rs/api/python/stable/reference/lazyframe/api/polars.LazyFrame.collect.html

Structured Entry with Feature Flags

rust:
  group_by_dynamic:
    name: group_by_dynamic
    link: https://docs.pola.rs/api/rust/dev/polars_lazy/frame/struct.LazyFrame.html#method.group_by_dynamic
    feature_flags: [dynamic_group_by]

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment