[build-system]
requires = ["maturin>=1.3.2"]
build-backend = "maturin"
[project]
name = "polars"
description = "Blazingly fast DataFrame library"
readme = "README.md"
authors = [
{ name = "Ritchie Vink", email = "[email protected]" },
]
license = { file = "LICENSE" }
requires-python = ">=3.9"
keywords = ["dataframe", "arrow", "out-of-core"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://www.pola.rs/"
Documentation = "https://docs.pola.rs/api/python/stable/reference/index.html"
Repository = "https://github.com/pola-rs/polars"
Changelog = "https://github.com/pola-rs/polars/releases"
[project.optional-dependencies]
polars_cloud = ["polars_cloud >= 0.0.1a1"]
numpy = ["numpy >= 1.16.0"]
pandas = ["pandas", "polars[pyarrow]"]
pyarrow = ["pyarrow >= 7.0.0"]
pydantic = ["pydantic"]
calamine = ["fastexcel >= 0.9"]
openpyxl = ["openpyxl >= 3.0.0"]
xlsx2csv = ["xlsx2csv >= 0.8.0"]
xlsxwriter = ["xlsxwriter"]
excel = ["polars[calamine,openpyxl,xlsx2csv,xlsxwriter]"]
adbc = ["adbc-driver-manager[dbapi]", "adbc-driver-sqlite[dbapi]"]
connectorx = ["connectorx >= 0.3.2"]
sqlalchemy = ["sqlalchemy", "polars[pandas]"]
database = ["polars[adbc,connectorx,sqlalchemy]"]
fsspec = ["fsspec"]
deltalake = ["deltalake >= 1.0.0"]
iceberg = ["pyiceberg >= 0.7.1"]
async = ["gevent"]
cloudpickle = ["cloudpickle"]
graph = ["matplotlib"]
plot = ["altair >= 5.4.0"]
style = ["great-tables >= 0.8.0"]
timezone = ["tzdata; platform_system == 'Windows'"]
gpu = ["cudf-polars-cu12"]
all = [
"polars[async,cloudpickle,database,deltalake,excel,fsspec,graph,iceberg,numpy,pandas,plot,pyarrow,pydantic,style,timezone]",
]
[tool.maturin]
include = [{ path = "rust-toolchain.toml", format = "sdist" }]
[tool.mypy]
files = ["polars", "tests"]
strict = true
enable_error_code = [
"redundant-expr",
"truthy-bool",
"ignore-without-code",
]
disable_error_code = [
"empty-body",
]
[[tool.mypy.overrides]]
module = [
"IPython.*",
"adbc_driver_manager.*",
"adbc_driver_sqlite.*",
"altair.*",
"arrow_odbc",
"backports",
"connectorx",
"dateutil.*",
"deltalake.*",
"fsspec.*",
"gevent",
"great_tables",
"jax.*",
"kuzu",
"matplotlib.*",
"moto.server",
"openpyxl",
"polars.polars",
"polars._plr",
"polars_cloud",
"pyarrow.*",
"pydantic",
"pyiceberg.*",
"sqlalchemy.*",
"torch.*",
"xlsx2csv",
"xlsxwriter.*",
"zoneinfo",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"IPython.*",
"matplotlib.*",
]
follow_imports = "skip"
[[tool.mypy.overrides]]
module = ["polars.*"]
warn_return_any = false
[tool.ruff]
line-length = 88
fix = true
[tool.ruff.lint]
select = [
"ANN",
"B",
"C4",
"D",
"E",
"EM",
"F",
"FA",
"FBT001",
"I",
"ICN",
"INT",
"PERF",
"PIE",
"PT",
"PTH",
"PYI",
"RUF",
"SIM",
"TCH",
"TD",
"TID",
"TRY",
"UP",
"W",
]
ignore = [
"D100",
"D104",
"D105",
"ANN401",
"D401",
"E501",
"PT011",
"PYI041",
"RUF022",
"RUF005",
"SIM102",
"SIM108",
"SIM114",
"TD002",
"TD003",
"TRY003",
]
allowed-confusables = ["µ"]
[tool.ruff.lint.per-file-ignores]
"dependencies.py" = ["ICN001"]
"tests/**/*.py" = ["D100", "D102", "D103", "B018", "FBT001"]
[tool.ruff.lint.pycodestyle]
max-doc-length = 88
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-type-checking]
strict = true
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
doctest_optionflags = [
"DONT_ACCEPT_TRUE_FOR_1",
"NORMALIZE_WHITESPACE",
"ELLIPSIS",
]
addopts = [
"--tb=short",
"--strict-config",
"--strict-markers",
"--import-mode=importlib",
"-m not slow and not write_disk and not release and not docs and not hypothesis and not benchmark and not ci_only",
]
markers = [
"ci_only: Tests that should only run on CI by default.",
"benchmark: Tests used to benchmark with.",
"debug: Tests that should be run on a Polars debug build.",
"docs: Documentation code snippets",
"release: Tests that should be run on a Polars release build.",
"slow: Tests with a longer than average runtime.",
"write_disk: Tests that write to disk",
"may_fail_auto_streaming: Test that may fail when automatically using the streaming engine for all lazy queries.",
"may_fail_cloud: Test that may fail when automatically using the cloud distributed engine for all lazy queries.",
]
filterwarnings = [
"error",
"ignore:.*unrecognized arguments.*PyDevIPCompleter:DeprecationWarning",
"ignore:.*is_sparse is deprecated.*:FutureWarning",
"ignore:FigureCanvasAgg is non-interactive:UserWarning",
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*:DeprecationWarning",
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*:DeprecationWarning",
"ignore:.*co_lnotab is deprecated, use co_lines.*:DeprecationWarning",
"ignore:unclosed file.*:ResourceWarning",
"ignore:unclosed database.*:ResourceWarning",
"ignore:Deprecated API features detected.*:DeprecationWarning",
"ignore:.*numpy\\.longdouble.*:UserWarning",
]
xfail_strict = true
[tool.coverage.run]
source = ["polars"]
branch = true
[tool.coverage.report]
fail_under = 85
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"@overload",
"except ImportError",
"if TYPE_CHECKING:",
"from typing_extensions import ",
]
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch" },
]