Skip to main content

Self-hosted computational mathematics engine: offline, private, explainable.

Project description

Calcora โ€” Transparent Computational Mathematics for Learning

Calcora is an open-source educational platform that provides step-by-step explanations for symbolic differentiation, integration, and linear algebra. Built on SymPy and designed for transparency over power, Calcora helps students understand why solutions work, not just what the answer is.

Status: v0.3.0 (Production-Ready Release)
Maturity: Production-ready educational tool โ€” suitable for Calculus I/II coursework and linear algebra

๐Ÿ“š Full Documentation | ๐Ÿ”ง API Reference | ๐Ÿš€ Live Demo | ๐Ÿ“‹ Changelog

Tests Coverage Python PyPI License

Core Philosophy

  1. Pedagogical First: Every operation shows step-by-step reasoning
  2. Transparent Algorithms: Open-source implementation following standard textbooks (Stewart, Thomas, Anton)
  3. Self-Hosted Option: Privacy-conscious educators can run locally (no data collection)
  4. Honest Limitations: We document what we can't do (see Current Limitations below)

๐Ÿ–ฅ๏ธ Desktop App (Available Now - v0.3.0)

Download โ†’ Double-click โ†’ Compute โ€” No installation required!

๐Ÿ“ฅ Download Calcora.exe (37 MB)

๐Ÿ“ฆ PyPI Package (Coming Soon)

pip install calcora

Status: PyPI publishing workflow configured, awaiting v0.3.0 release.

Features:

  • โœ… Single-file executable (Windows 10/11)
  • โœ… Completely offline โ€” no internet connection needed
  • โœ… Auto-opens browser to localhost interface
  • โœ… All your data stays on your computer (100% private)
  • โœ… Custom application icon with professional branding
  • โœ… Graceful shutdown system (no zombie processes)

โš ๏ธ First-Run Security Warning

Windows will show "Windows protected your PC" warning โ€” this is expected for unsigned open-source apps.

Why? Code signing certificates cost ~$200/year. v0.3.0 is unsigned; v0.3.1 will be signed.

Is it safe?

  • โœ… Open source (audit the code on GitHub)
  • โœ… Built with PyInstaller (standard Python packager)
  • โœ… 100% offline, no telemetry
  • โœ… SHA256: 53CE893F6A634043573111D43A8B07E62BCE4A9EC38E39B3D3F1AFF5C386A5EC

To run: Click "More info" โ†’ "Run anyway" (warning only shows once)

More details: See DESKTOP_GUIDE.md and CODE_SIGNING_GUIDE.md

Why desktop? Web version requires internet and external hosting. Desktop version runs entirely on your machine - perfect for classrooms, exams, or offline use.

What Works Well (v0.2)

โœ… Current Capabilities

  • Symbolic Differentiation: Product rule, chain rule, quotient rule, trigonometric functions
  • Integration: 10 core techniques covering ~80% of Calculus II curriculum
    • Power rule, u-substitution, integration by parts (LIATE)
    • Partial fractions, trig identities, inverse trig patterns
    • Hyperbolic functions, exponentials, logarithms
    • Definite integrals with area visualization
  • Linear Algebra: Matrix operations (determinant, inverse, eigenvalues, LU, RREF)
  • Interactive Graphs: Chart.js visualizations for functions and definite integral areas
  • Three Verbosity Modes: Concise / Detailed / Teacher Mode

โš ๏ธ Current Limitations

  • โŒ Advanced Integration: Trig substitution, Weierstrass, reduction formulas (v0.4 planned)
  • โŒ Series & Limits: Not yet implemented (v0.4-0.5 roadmap)
  • โŒ Equation Solving: Symbolic equation solving postponed to v0.4
  • โŒ LaTeX Export: Planned for v0.4
  • โš ๏ธ Performance: Not optimized for >50 term expressions or symbolic matrices >5ร—5
  • โš ๏ธ Accessibility: WCAG 2.1 progress at ~85% (keyboard nav done, screen reader improvements ongoing)

๐ŸŽฅ Demo Video

https://github.com/user-attachments/assets/bdb41766-a890-436f-9cc3-a4ffd5e603d4

๐Ÿš€ Try the Live Demo

Netlify Status

Interactive Demo โ†’

Test Calcora directly in your browser - no installation required. Try:

  • Differentiation with step-by-step explanations
  • Integration with 8+ techniques and graph visualization
  • Matrix operations (determinant, inverse, RREF, eigenvalues, LU decomposition)
  • Interactive graphs for visualizing functions and definite integrals

๐Ÿ“– Complete Documentation โ†’

Target Audience

โœ… Well-Suited For:

  • Calculus I/II students verifying homework solutions
  • Educators demonstrating integration techniques in lectures
  • Self-learners who want to see algorithmic steps, not just answers
  • Privacy-conscious users wanting local computation

โš ๏ธ Use With Caution:

  • Advanced mathematics beyond Calculus II (results may be incomplete)
  • Grading or assessment (manual verification recommended)
  • Research computations (use SymPy/SageMath/Mathematica directly)

โŒ Not Recommended For:

  • Production scientific computing (performance/precision not optimized)
  • Computer algebra research (SymPy itself is better suited)
  • Mission-critical or peer-reviewed publications (insufficient validation)

What's New in v0.2+

๐Ÿš€ Integration Engine (NEW in v0.2)

Calculora's integration engine covers standard Calculus II curriculum (10 core techniques):

What's Implemented โœ…

  • โœ… Polynomials - Power rule for any degree
  • โœ… Trigonometric - sin, cos, tan, secยฒ and standard identities
  • โœ… Inverse Trig - arcsin, arctan patterns with automatic recognition
  • โœ… Hyperbolic - sinh, cosh and their integrals
  • โœ… Exponential & Logarithmic - e^x, ln(x), and basic products
  • โœ… Rational Functions - Basic partial fraction decomposition
  • โœ… Square Roots - โˆšx and standard radical patterns
  • โœ… Products - Integration by parts automatically applied
  • โœ… Compositions - U-substitution for nested functions
  • โœ… Definite Integrals - With numerical area calculation and visualization

Advanced Graphing ๐Ÿ“Š

Every integration now includes beautiful, interactive graphs:

Indefinite Integrals:

  • ๐Ÿ“ˆ Original function (integrand) f(x) plotted
  • ๐Ÿ“Š Integrated function (antiderivative) F(x) overlaid
  • ๐ŸŽจ Dual plotting for visual comparison

Definite Integrals:

  • ๐Ÿ“ Shaded area under the curve showing the integral value
  • ๐ŸŽฏ Vertical lines marking integration bounds
  • ๐Ÿ”ข Exact area value displayed prominently
  • ๐Ÿ“ˆ Both integrand and antiderivative plotted together
  • ๐ŸŽจ Color-coded regions for positive/negative areas

Intelligent Technique Detection ๐Ÿง 

The engine automatically selects the optimal integration method:

  • Power Rule - For polynomials (instant)
  • Substitution - For composite functions
  • Integration by Parts - For products (LIATE priority)
  • Partial Fractions - For rational functions
  • Trigonometric Identities - For trig combinations
  • Numerical Fallback - For non-elementary integrals

Validation โœ…

  • โœ… 29/29 integration tests passing (100% pass rate on implemented techniques)
  • โœ… Benchmark validation: 25+ problems verified against SymPy (see benchmarks/)
  • โš ๏ธ Scope: Covers ~80% of standard Calculus II textbook problems
  • โŒ Not Implemented: Trig substitution, tabular integration, advanced reduction

See INTEGRATION_FEATURES.md and benchmarks/README.md for validation details.

๐ŸŽฏ Usage Examples

Indefinite Integral:

from calcora.integration_engine import IntegrationEngine

engine = IntegrationEngine()
result = engine.integrate("x**2", variable="x", generate_graph=True)
# Output: x**3/3 + C
# Graph: Shows parabola f(x) = xยฒ and cubic F(x) = xยณ/3

Definite Integral with Area:

result = engine.integrate("x**2", variable="x", lower_limit=0, upper_limit=1)
# Output: 1/3 โ‰ˆ 0.333333
# Graph: Shows shaded area under parabola from 0 to 1

Complex Expression:

result = engine.integrate("x * exp(x)")
# Output: (x - 1)ยทe^x + C
# Technique: Integration by parts
# Graph: Both functions plotted with clear relationship

Coming Soon

  • Series Expansion: Taylor and Maclaurin series
  • Limits: Symbolic limit computation
  • LaTeX Export: Export results as publication-ready LaTeX
  • Equation Solving: Solve algebraic and transcendental equations

What Calcora is

  • A core engine (deterministic rule application + step DAG)
  • An integration engine (multiple integration techniques with explanations)
  • A CLI (calcora ...)
  • A developer API (Python) and HTTP API (FastAPI)
  • A modern web interface with interactive graphs and step-by-step explanations
  • A static website (GitHub Pages) for docs and demos

Install

Quick Start (Clone & Run)

New to the project? Follow the step-by-step guide: CLONE_AND_RUN.md

Prerequisites: Python 3.10+ and Git

# 1. Clone the repository
git clone https://github.com/Dumbo-programmer/calcora.git
cd calcora

# 2. Create virtual environment
python -m venv .venv

# 3. Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate

# 4. Install Calcora with dependencies
pip install -e ".[engine-sympy,cli,api]"

# 5. Test installation (optional but recommended)
python test_installation.py

# 6. Run the CLI
calcora differentiate "sin(x**2)"

# 7. Or start the web interface
uvicorn calcora.api.main:app --reload
# Then open: http://127.0.0.1:8000/static/index.html

That's it! You now have a fully functional local instance.

Building Standalone Executables (Windows)

Want to share Calcora without requiring Python? Build standalone executables:

# Install PyInstaller
pip install pyinstaller

# Build both CLI and server executables
.\build.ps1 all

# Executables are in dist/
.\dist\calcora.exe differentiate "x**2"
.\dist\calcora-server.exe  # Opens browser automatically

# Create distribution package
.\package.ps1
# Creates: dist/calcora-{version}-windows-x64.zip

See DEPLOYMENT_GUIDE.md for detailed build and distribution instructions.

Self-Hosting the Web UI

Run your own Calcora web server:

# Development mode (auto-reload)
uvicorn calcora.api.main:app --reload --host 0.0.0.0 --port 8000

# Production mode
uvicorn calcora.api.main:app --host 0.0.0.0 --port 8000 --workers 4

Access from any device on your network at http://YOUR-IP:8000/static/index.html

For complete deployment guide (cloud platforms, Docker, systemd, etc.), see DEPLOYMENT_GUIDE.md.

Docker (Coming Soon)

docker compose up

Docker deployment is on the roadmap for v0.2.

Architecture (short)

Calcora represents computation as a directed acyclic graph (DAG) of StepNodes. Each step records:

  • operation name
  • applied rule
  • input expression
  • output expression
  • human-readable explanation
  • dependencies on prior steps

See ARCHITECTURE.md for the formal model.

Supported operations (v0.1)

Differentiation:

  • Constants and identity: d/dx(c) = 0, d/dx(x) = 1
  • Sum rule: d/dx(f+g) = f' + g'
  • Constant multiple: d/dx(cยทf) = cยทf'
  • Product rule: d/dx(fยทg) = fยทg' + gยทf'
  • Power rule: d/dx(x^n) = nยทx^(n-1) (with chain rule)
  • Trigonometric: sin, cos, tan, sec, csc, cot (with chain rule)
  • Exponential and logarithmic: exp(u), log(u) (with chain rule)
  • Inverse trigonometric: asin(u), acos(u), atan(u) (with chain rule)
  • SymPy fallback for complex expressions

Linear Algebra:

  • Matrix multiplication
  • Determinants (2ร—2, 3ร—3, general nร—n)
  • Matrix inverse (with step-by-step Gauss-Jordan)
  • Row Reduced Echelon Form (RREF)
  • Eigenvalues and eigenvectors (with characteristic polynomial)
  • LU decomposition with partial pivoting (PA = LU)
  • Matrix rank
  • Symbolic matrices: Variables as entries (e.g., [["a","b"],["c","d"]])

All operations include step-by-step explanations with multiple verbosity levels.

๐Ÿ“– Full API Documentation โ†’

Plugins

Calcora supports three plugin types:

  • Rule plugins: symbolic transformations that emit StepNodes
  • Solver plugins: algorithmic / numeric solvers (root finding, etc.)
  • Renderer plugins: text, LaTeX, JSON, and future visualization

See docs/PLUGINS.md.

Documentation

For Users

For Developers

  • ๐Ÿ—๏ธ Architecture - Technical design and DAG model
  • ๐Ÿ”Œ Plugins - Creating custom rules and solvers
  • ๐Ÿค Contributing - Development guidelines

Release Documentation

Policies

References & Validation

Academic Foundation

Calcora's algorithms are based on standard calculus textbooks and peer-reviewed libraries:

Mathematical References:

  • Stewart, J. (2015). Calculus: Early Transcendentals (8th ed.). Cengage Learning.
  • Thomas, G. B., Weir, M. D., & Hass, J. (2018). Thomas' Calculus (14th ed.). Pearson.
  • Anton, H., Bivens, I., & Davis, S. (2021). Calculus: Early Transcendentals (12th ed.). Wiley.

Software & Libraries:

Integration Techniques Implemented

Based on standard calculus curriculum (Calculus II level):

  1. Power Rule: โˆซ xโฟ dx = xโฟโบยน/(n+1) + C
  2. U-Substitution: โˆซ f(g(x))ยทg'(x) dx = F(g(x)) + C
  3. Integration by Parts: โˆซ u dv = uv - โˆซ v du (LIATE priority)
  4. Partial Fractions: Decomposition for rational functions
  5. Trigonometric Integrals: Standard identities and substitutions
  6. Inverse Trig: arctan, arcsin, arcsec patterns
  7. Hyperbolic Functions: sinh, cosh, tanh and inverses
  8. Exponential/Logarithmic: Natural base and general base handling
  9. Numerical Integration: Simpson's rule fallback for non-elementary

Test Coverage & Accuracy

Current Status (v0.3.0):

  • โœ… 73/73 automated tests passing (100% pass rate across all features)
  • โœ… 52% overall code coverage (differentiation: 89%, integration: 73%, matrices: 69%)
  • โœ… CI/CD: GitHub Actions runs tests on 9 platform combinations (3 OS ร— 3 Python versions)
  • โœ… Edge case handling: Complex numbers, infinite limits, domain errors

Validation Methods:

  • Cross-verification with SymPy symbolic results
  • Numerical comparison for definite integrals
  • Manual verification against textbook solutions
  • Edge case testing (discontinuities, undefined points, complex compositions)

Known Limitations:

  • Alpha software: Active development, breaking changes possible
  • Missing techniques: Trigonometric substitution, advanced partial fractions
  • Performance: Not optimized for extremely complex expressions (>100 terms)
  • Accessibility: WCAG compliance in progress (keyboard nav implemented, screen reader testing pending)
  • Browser support: Modern browsers only (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)

Comparison with Alternatives

Feature Calcora WolframAlpha SymPy (direct) Photomath
Cost Free (MIT) Free (limited) / $5-7/mo Free (open source) Free (limited) / $10/mo
Step-by-step โœ… Full detail โš ๏ธ Pro only โŒ No explanations โœ… Yes
Transparency โœ… Open source โŒ Proprietary โœ… Open source โŒ Proprietary
Integration โœ… 10+ techniques โœ… Comprehensive โœ… Symbolic only โš ๏ธ Basic
Differentiation โœ… All standard rules โœ… Comprehensive โœ… Symbolic only โœ… Standard
Graphs โœ… Interactive (Chart.js) โœ… Static images โŒ Matplotlib required โš ๏ธ Limited
Self-hosted โœ… Yes โŒ Cloud only โœ… Local Python โŒ Cloud only
Privacy โœ… Complete control โŒ Data collected โœ… Local compute โŒ Data collected
Verbosity levels โœ… 3 modes โš ๏ธ Fixed N/A โš ๏ธ Fixed
Citable โœ… Open algorithms โŒ Black box โœ… Published papers โŒ Proprietary
LaTeX export ๐Ÿ”„ Coming v0.3 โœ… Available โœ… Built-in โŒ No
API access โœ… Free, unlimited โš ๏ธ Paid tiers โœ… Python library โŒ No public API
Educational focus โœ… Primary goal โš ๏ธ Secondary โŒ Research tool โœ… Primary goal
Offline mode โœ… Full functionality โŒ Internet required โœ… Local install โŒ Internet required
Target audience Students, educators General public Researchers, devs High school students

Key Differentiators:

  • Transparency: Only open-source tool with full step-by-step explanations
  • Privacy: Self-hosted option means zero data collection
  • Cost: Free forever, no paywalls or premium tiers
  • Educational: Designed for learning, not just getting answers
  • Citable: Algorithms are documented and reproducible

Usage Recommendations

Best for:

  • โœ… Calculus I/II students learning techniques
  • โœ… Educators demonstrating step-by-step solutions
  • โœ… Researchers needing reproducible symbolic computation
  • โœ… Privacy-conscious users (FERPA/GDPR compliance)
  • โœ… Offline computation (air-gapped environments)

Not ideal for:

  • โŒ Extremely advanced mathematics (topology, abstract algebra)
  • โŒ Production-critical scientific computing (use SymPy/SageMath directly)
  • โŒ Non-technical users (WolframAlpha has better NLP)
  • โŒ Mobile-first experience (responsive but not optimized)

When to use alternatives:

  • WolframAlpha: Natural language queries, broader math coverage
  • SymPy: Research-grade symbolic computation, performance critical
  • Photomath: Handwriting recognition, mobile scanning
  • Mathematica: Professional research, publication-quality outputs

Contributing

See CONTRIBUTING.md for development guidelines.

We follow a Code of Conduct to ensure a welcoming community.

License

Calcora is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calcora-0.3.0.tar.gz (33.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calcora-0.3.0-py3-none-any.whl (81.7 kB view details)

Uploaded Python 3

File details

Details for the file calcora-0.3.0.tar.gz.

File metadata

  • Download URL: calcora-0.3.0.tar.gz
  • Upload date:
  • Size: 33.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for calcora-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d981ff7388f7d4d5211a06af43280e5ed67979995ee52c110a325af4d6b1fbb8
MD5 f666af23cfbeb3173f8e03d5d5bf8a4e
BLAKE2b-256 d05af9cd6a83a86c267f83ae5c6f6d68a554bdaad915ab245252b4aaa5cfb6de

See more details on using hashes here.

Provenance

The following attestation bundles were made for calcora-0.3.0.tar.gz:

Publisher: publish-pypi.yml on Dumbo-programmer/Calcora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calcora-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: calcora-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 81.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for calcora-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf3645106858d88fd5d6a1240df0b57f2ca0b135f8a85c6ccb2f14d26ef4e873
MD5 800dbd7395554b3d5daebe6649d43967
BLAKE2b-256 bb2fb0fb78b62c334f432d6d1761164c287250bd5ec7d6ba7214228516ce3981

See more details on using hashes here.

Provenance

The following attestation bundles were made for calcora-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Dumbo-programmer/Calcora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page