django-mathfilters
A set of simple math filters for Django
Decision gist · record as of 2026-08-14
Yes, if you are on Django 1.11–3.x with Python 3.5–3.7 and need simple math filters in templates. No, if you are using modern Django or Python versions—the package is abandoned and has not been updated since 2020, so compatibility with current releases is uncertain. Consider writing a custom template tag or moving calculations to your view layer if you need active maintenance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django to be installed and configured; the package itself has no runtime dependencies but is a Django app extension.
- Installation is straightforward with no runtime dependencies.
- However, the package is abandoned—last commit was 2020-10-13 and no releases since 2020-02-10—so it will not receive bug fixes or updates for modern Django or Python versions.
License · maintenance · safety
MIT (permissive) — MIT License is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2020-02-10 (2377 days) · last repo commit 2020-10-13 · 169 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 636,814 downloads/mo, #5,621 on PyPI
Alternatives
Verify before relying
pip install django-mathfilters
Then add 'mathfilters' to INSTALLED_APPS in settings.py.
In a template:
{% load mathfilters %}
{{ 13|sub:17 }}
{{ 42|mul:0.5 }}
{{ 12|div:3 }}- Whether the package works with Django versions released after 2020 without issues.
- Current compatibility with Python 3.8+ given the last release predates those versions.
- Whether float/Decimal arithmetic in filters handles edge cases (NaN, infinity, precision loss).
What it is and what it does
django-mathfilters extends Django's template language with arithmetic filters for use in templates. Django provides an `add` filter but omits subtraction, multiplication, division, and other basic math operations; this package fills that gap by offering `sub`, `mul`, `div`, `intdiv`, `abs`, `mod`, and an enhanced `addition` filter that handles float and Decimal types in addition to integers.
The package is a simple, zero-dependency Django app that you install via pip and register in INSTALLED_APPS. Once loaded in a template with `{% load mathfilters %}`, you can apply arithmetic operations inline—for example, `{{ 13|sub:17 }}` or `{{ answer|mul:0.5 }}`—without writing custom template tags or view logic.
Use it for
- Display calculated values in Django templates without writing custom template tags—e.g., show discounted prices or percentage calculations.
- Perform simple arithmetic on template variables for display purposes, such as dividing totals by counts to show averages.
- Handle float and Decimal arithmetic in templates where Django's built-in `add` filter would not suffice.
- Reduce boilerplate by avoiding custom template tag definitions for straightforward math operations.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are on Django 1.11–3.x with Python 3.5–3.7 and need simple math filters in templates.
No, if you are using modern Django or Python versions—the package is abandoned and has not been updated since 2020, so compatibility with current releases is uncertain. Consider writing a custom template tag or moving calculations to your view layer if you need active maintenance.
Install
django-mathfilters on PyPI
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last commit was 2020-10-13 and no releases since 2020-02-10—so it will not receive bug fixes or updates for modern Django or Python versions.
Requires Django to be installed and configured; the package itself has no runtime dependencies but is a Django app extension.
License in practice
MIT License is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install django-mathfilters
Then add 'mathfilters' to INSTALLED_APPS in settings.py.
In a template:
{% load mathfilters %}
{{ 13|sub:17 }}
{{ 42|mul:0.5 }}
{{ 12|div:3 }}
Verify before relying
- Whether the package works with Django versions released after 2020 without issues.
- Current compatibility with Python 3.8+ given the last release predates those versions.
- Whether float/Decimal arithmetic in filters handles edge cases (NaN, infinity, precision loss).
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 2,377 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 636,814 / month, #5,621 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules |
Evidence: django_mathfilters-1.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django template math filters”
- django-mathfiltersProvides Django template filters for basic arithmetic…
- django-widget-tweaksCustomize Django form field HTML and CSS in templates using template…
- django-bootstrap4Provides Django template tags and filters to render Bootstrap 4 HTML…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also py-money · django-more-admin-filters · django-markdownify · django-filter · bitmath · lightecc · django-typer · latex2sympy2 · django-widget-tweaks · django-admin-rangefilter