Calc is a versatile math interpreter designed to assist with various mathematical calculations and homework. It offers both a command-line interface (CLI) and an HTTP API, making it suitable for diverse use cases, including local usage, professional integration, and educational purposes.
App Requires: Python 3.10+ [Recommended, 3.12.x]
You can install Calc in three ways:
- Install Locally
- Install Containerized (using Docker): [Recommended for professional use]
- Install Pythonically (using pip): Supports only CLI app [Recommended for aspiring developers]
Requirements: Python (3.10+) & Git
-
Verify Git installation.
git --version
-
Clone the repository locally.
git clone https://github.com/JeelDobariya38/Calc.git
-
Navigate to the cloned directory.
cd Calc
-
Verify Python installation.
python --version
-
Install dependencies.
pip install -r requirements.txt
-
Run the REPL of Calc:
python main.py
-
Optionally, run Calc from the browser.
uvicorn api.app:app --port 8000
Requirements: Docker Desktop
-
Verify Git and Docker installation.
git --version docker --version
-
Clone the repository.
git clone https://github.com/JeelDobariya38/Calc.git
-
Navigate to the Calc directory.
cd Calc
-
Build the Docker images. You can build either or both images according to your needs.
-
Building backend image
docker build -t jeeldobariya2325/calc:latest-backend -f Dockerfile.backend .
-
Building CLI image
docker build -t jeeldobariya2325/calc:latest-cli -f Dockerfile.cli .
-
-
Run a container from the newly built image.
-
Running the API
docker run -p 8080:80 --env "HOST=0.0.0.0" --env "PORT=80" -d jeeldobariya2325/calc:latest-backend
-
Running CLI
docker run -it jeeldobariya2325/calc:latest-cli
-
-
Running the API
docker run -p 8080:80 --env "HOST=0.0.0.0" --env "PORT=80" -d jeeldobariya2325/calc:latest-backend
-
Running CLI tools
docker run -it jeeldobariya2325/calc:latest-cli
Requirements: Python (3.10+), pip & Git
-
Verify Python and Git installation.
git --version python --version pip --version
-
Install the package from the Git repository:
pip install git+https://github.com/JeelDobariya38/Calc.git
-
Run the CLI tool from the terminal:
calc
-
Local Installation:
python main.py
-
Docker:
docker run -it jeeldobariya2325/calc:latest-cli
-
Local Installation:
uvicorn api.app:app --port 8000
Access the API at
http://localhost:8000
. -
Docker:
docker run -p 8080:80 --env "HOST=0.0.0.0" --env "PORT=80" -d jeeldobariya2325/calc:latest-backend
Access the API at
http://localhost:8080
.
If you encounter any bugs or have any questions related to Calc, feel free to create an issue on our GitHub repository.
For feature requests or contributions, you are welcome to create an issue or a pull request.
This project is licensed under the MIT License.