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

Metadata

Release files for ovos-skill-calculator 0.0.3

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.3
File Size Uploaded Provenance Actions
ovos_skill_calculator-0.0.3.tar.gz 23.5 kB With provenance Details for ovos_skill_calculator-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 49.6 kB

Release files / ovos_skill_calculator-0.0.3.tar.gz

Download URL ovos_skill_calculator-0.0.3.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
03cdf01ab714ff2d6fcad21fe7acacb0b023722a6ea7f990b7a2600e4693e090
BLAKE2b-256 checksum
How to use checksums
105682378bcfd614fb7c5469510a887f40c7a5df7e2ef1c45eea50267e5fdbd2
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 Oct 1, 2026.

Transparency log

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

Download URL ovos_skill_calculator-0.0.3-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9097bbc6d19c176f16385583bde1f3dcd124cc76f1af9e0ef61c328fa120873
BLAKE2b-256 checksum
How to use checksums
1f688fa83bb9337c577f8feed4fe119c9949420bf6725b91e55819747309f730
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 Oct 1, 2026.

Transparency log

Security for ovos-skill-calculator 0.0.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ovos_skill_calculator-0.0.3.tar.gz

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 Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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