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
Core Philosophy
- Pedagogical First: Every operation shows step-by-step reasoning
- Transparent Algorithms: Open-source implementation following standard textbooks (Stewart, Thomas, Anton)
- Self-Hosted Option: Privacy-conscious educators can run locally (no data collection)
- 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
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
- ๐ User Guide - Complete guide with examples
- ๐ง API Documentation - REST API reference and Python SDK
- ๐ Self-Hosting - Deploy your own instance
- ๐จ Building from Source - Desktop app and custom builds
- ๐ Getting Started - Quick setup guide
For Developers
- ๐๏ธ Architecture - Technical design and DAG model
- ๐ Plugins - Creating custom rules and solvers
- ๐ค Contributing - Development guidelines
Release Documentation
- ๐ Release Notes v0.2.0 - Security & Robustness release details
- ๐ Changelog - Complete version history
- ๐ฏ Release Summary v0.2.0 - Release completion and metrics
- ๐ Architecture Verification - Pre-release validation audit
- ๐บ๏ธ Roadmap - Feature timeline v0.1 โ v0.5
Policies
- ๐ก๏ธ Security Policy - Reporting vulnerabilities
- ๐ Code of Conduct - Community guidelines
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:
- SymPy - Meurer, A., et al. (2017). "SymPy: symbolic computing in Python." PeerJ Computer Science, 3, e103. https://doi.org/10.7717/peerj-cs.103
- NumPy - Harris, C.R., et al. (2020). "Array programming with NumPy." Nature, 585, 357-362. https://doi.org/10.1038/s41586-020-2649-2
- FastAPI - Modern Python web framework for building APIs with automatic documentation
Integration Techniques Implemented
Based on standard calculus curriculum (Calculus II level):
- Power Rule: โซ xโฟ dx = xโฟโบยน/(n+1) + C
- U-Substitution: โซ f(g(x))ยทg'(x) dx = F(g(x)) + C
- Integration by Parts: โซ u dv = uv - โซ v du (LIATE priority)
- Partial Fractions: Decomposition for rational functions
- Trigonometric Integrals: Standard identities and substitutions
- Inverse Trig: arctan, arcsin, arcsec patterns
- Hyperbolic Functions: sinh, cosh, tanh and inverses
- Exponential/Logarithmic: Natural base and general base handling
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d981ff7388f7d4d5211a06af43280e5ed67979995ee52c110a325af4d6b1fbb8
|
|
| MD5 |
f666af23cfbeb3173f8e03d5d5bf8a4e
|
|
| BLAKE2b-256 |
d05af9cd6a83a86c267f83ae5c6f6d68a554bdaad915ab245252b4aaa5cfb6de
|
Provenance
The following attestation bundles were made for calcora-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on Dumbo-programmer/Calcora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calcora-0.3.0.tar.gz -
Subject digest:
d981ff7388f7d4d5211a06af43280e5ed67979995ee52c110a325af4d6b1fbb8 - Sigstore transparency entry: 1029391564
- Sigstore integration time:
-
Permalink:
Dumbo-programmer/Calcora@9b5b6f84628e529d8b09530dce3902a335d87080 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dumbo-programmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@9b5b6f84628e529d8b09530dce3902a335d87080 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3645106858d88fd5d6a1240df0b57f2ca0b135f8a85c6ccb2f14d26ef4e873
|
|
| MD5 |
800dbd7395554b3d5daebe6649d43967
|
|
| BLAKE2b-256 |
bb2fb0fb78b62c334f432d6d1761164c287250bd5ec7d6ba7214228516ce3981
|
Provenance
The following attestation bundles were made for calcora-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Dumbo-programmer/Calcora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calcora-0.3.0-py3-none-any.whl -
Subject digest:
bf3645106858d88fd5d6a1240df0b57f2ca0b135f8a85c6ccb2f14d26ef4e873 - Sigstore transparency entry: 1029391682
- Sigstore integration time:
-
Permalink:
Dumbo-programmer/Calcora@9b5b6f84628e529d8b09530dce3902a335d87080 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dumbo-programmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@9b5b6f84628e529d8b09530dce3902a335d87080 -
Trigger Event:
workflow_dispatch
-
Statement type: