This is a FastAPI-based web application providing three main functionalities:
- Password Generation
- Password Security Check
- Currency Conversion
- Password Generation: Create secure passwords of customizable length, optionally including a specific word.
- Password Security Check: Evaluate the security of a given password based on length, character variety, and other criteria.
- Currency Conversion: Convert amounts between currencies using real-time exchange rates.
- Python 3.9 or later installed on your system.
- A virtual environment (optional but recommended).
- Required Python libraries installed (
FastAPI,Jinja2,freecurrencyapi,python-dotenv, anduvicorn).
git clone <repository-url>
cd <repository-folder>Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateInstall the required libraries:
pip install fastapi jinja2 freecurrencyapi python-dotenv uvicornCreate .env file:
Add the following to a .env file in the root directory:
CONVERSION_API=fca_live_YourAPIKeyHereRun the Application
uvicorn main:app --reloadThe app will be available at http://127.0.0.1:8000/generate-password
This feature generates secure passwords with customizable length and an optional specific word.
Endpoints
- GET /generate-password: Displays the password generation form.
- POST /generate-password: Accepts form data to generate a password.
The form and results are rendered via index.html
Checks the security of a given password based on:
Minimum length of 12 characters. Inclusion of uppercase, lowercase, digits, and special characters. Avoiding common patterns or weak passwords.
Endpoints:
- GET /check-password: Displays the password security check form.
- POST /check-password: Evaluates the security of the provided password.
The form and results are rendered via checkPassword.html
Converts an amount from one currency to another using live exchange rates.
Endpoints
- GET /get-conversion: Displays the currency conversion form.
- POST /get-conversion: Performs the conversion and displays the results.
The form and results are rendered via currency.html
FastAPI: Web framework. Jinja2: Templating engine. freecurrencyapi: Currency conversion API. python-dotenv: Environment variable management. uvicorn: ASGI server.
pip install fastapi jinja2 freecurrencyapi python-dotenv uvicornPS: I added apiKey for conversion in .env file.
Go to http://127.0.0.1:8000/docs Swagger UI