Skip to main content

Calculator

A basic calculator for OVOS - "what is 15 times 23", "what is the square root of 144", "what is 20 percent of 150". Fully offline, pure arithmetic, no external dependencies beyond number parsing.

Tests PyPI version

Usage

"what is 5 plus 3"
"what is 15 times 23"
"what is 100 divided by 4"
"what is 20 percent of 150"
"what is 9 squared"
"what is the square root of 144"
"hvad er 5 plus 3"                (Danish)
"hvad er kvadratroden af 144"     (Danish)

Why one intent file per operation

A single intent like "what is {a} {operator} {b}", with the operator word captured as a wildcard, does not work reliably in padatious: with three consecutive wildcards and no literal anchor word between {a}, {operator}, and {b}, the matcher can't tell where one wildcard ends and the next begins. Each operation gets its own intent file instead, with the operator as literal text - the same anchor-word pattern every other intent in this project family uses (e.g. ovos-skill-convert's "convert {value} {from_unit} to {to_unit}").

A rough edge fixed here (tracked as an issue elsewhere)

ovos-skill-convert has an open issue for a cosmetic rough edge: whole-number results spoken with a trailing ".0" (e.g. "10.0" instead of "10"), because Python's default float formatting was used as-is. This skill avoids the problem from the start with a small _format_number() helper - a whole-number float speaks as a plain integer, a genuine fraction rounds to 4 decimal places. Worth porting the same helper over when that issue is picked up.

Common Query safety net

"what is 5 times 6" is structurally identical to the "what is X" questions confirmed to sometimes get intercepted by a platform-level semantic router (ovos-m2v-pipeline-high) before this skill's own Padatious intents get a chance - see ovos-skill-geometry's DEVELOPMENT.md for the full live-tested finding. handle_common_query() reuses the exact literal anchor words each intent file already has (plus/minus/times/...) as regex patterns, so it's not a second implementation of the arithmetic parsing, just a fallback entry point into it.

Install

pip install ovos-skill-calculator

Development

See DEVELOPMENT.md.

Category

Utility

Tags

#calculator #math #arithmetic

Release files for ovos-skill-calculator 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-skill-calculator 0.0.2
File Size Uploaded
ovos_skill_calculator-0.0.2.tar.gz 23.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-skill-calculator 0.0.2
File Interpreter ABI Platform
ovos_skill_calculator-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 49.6 kB

Release files / ovos_skill_calculator-0.0.2.tar.gz

Download URL ovos_skill_calculator-0.0.2.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3dea0ef505ea48fab9b8c9d1413f6d39d114734eb281dfa6c59370658a6bf5c5
BLAKE2b-256 checksum
How to use checksums
4a712b30721443959fd38960d8afa961a238e844d435863c60516dc46c754c0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / ovos_skill_calculator-0.0.2-py3-none-any.whl

Download URL ovos_skill_calculator-0.0.2-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33963b7944a932f436b1c4e964064d483140ab8a21aabb509e073bc51905fcd9
BLAKE2b-256 checksum
How to use checksums
b6af4c61c7f261ba61c728224e21aa0ba05ce8df38c8bbb68107d94e58fdb62a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page