A simple calculator package with UI capabilities built using Python.
[! IMPORTANT] The code is generated using AI (DeepSeek) and may contain errors. To see the prompts used, please refer to Prompts.md.
- Basic arithmetic operations (addition, subtraction, multiplication, division, power)
- Expression evaluation
- Streamlit-based web UI
- Dash-based web UI
- Comprehensive test suite
- CI/CD with GitHub Actions
pip install git+https://github.com/fortune9/python-calculator.gitpip install --index-url https://test.pypi.org/simple/ --no-deps python-calculator-fortune9# For Streamlit UI
pip install "python-calculator[streamlit]"
# For Dash UI
pip install "python-calculator[dash]"
# For all features
pip install "python-calculator[all]"
# For development
pip install "python-calculator[dev]"from python_calculator import Calculator
calc = Calculator()
result = calc.calculate("2 + 3 * 4") # Returns 14.0
result = calc.calculate("2 ^ 3") # Returns 8.0 (power operator)pip install "python-calculator[streamlit]"
python -c "from python_calculator.ui import StreamlitUI; import streamlit as st; ui = StreamlitUI(); ui.render()"pip install "python-calculator[dash]"
python -c "from python_calculator.ui import DashUI; ui = DashUI(); ui.run()"pip install "python-calculator[dev]"
pytestpip install "python-calculator[dev]"
pytest --cov=python_calculator tests/MIT License