This guide helps AI-based development tools like Gemini understand and interact with this project effectively.
This project is implemented in Python.
This project uses uv to manage Python package dependencies and create virtual environments. uv is an extremely fast tool compatible with pip and venv.
Installing uv:
If you don't have uv installed, you can install it as follows:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Setup Steps:
-
Create a virtual environment: Use
uvto create a virtual environment.uv venv
-
Activate the virtual environment:
- macOS/Linux:
source .venv/bin/activate - Windows:
.venv\Scripts\activate
(Note:
uvcreates a directory named.venvby default.) - macOS/Linux:
-
Install dependencies: Use
uvto install the dependencies listed in therequirements.txtfile.uv pip install -r requirements.txt
If you are using
pyproject.toml, you can use a command likeuv pip install -e ..
With the virtual environment activated, you can run the command below or use uv run.
Example (Flask):
# After activating the virtual environment
flask run
# Or using uv
uv run flask runExample (Standard Python Script):
# After activating the virtual environment
python3 main.py
# Or using uv
uv run python3 main.pyUse uv to run pytest in the virtual environment.
uv run pytestTo maintain code consistency and readability, run the linter and formatter through uv. This ensures that the tools installed in the virtual environment are used.
-
Code Formatting (Black):
uv run black . -
Linting (Ruff): Astral, the developers of
uv, also developruff, so it's recommended to use them together.uv run ruff check .
main.py/app.py: The main entry point of the application.src/orapp/: The directory where the core source code is located.tests/: Contains all test code.requirements.txtorpyproject.toml: Defines Python package dependencies..venv/: The virtual environment directory created byuv.Dockerfile: Configuration file for container builds..env.example: Template file for environment variable settings.
This project follows the Google Python Style Guide and enforces code style through pylint and a pylintrc configuration file.
- Indentation: 2 spaces
- Line Length: Maximum 80 characters
- Naming Conventions:
- Functions, Variables:
snake_case - Classes:
PascalCase - Constants:
UPPERCASE_SNAKE_CASE
- Functions, Variables:
- Docstrings: Required for all public modules, functions, classes, and methods.
- Imports: Group and sort related imports.
- Error Handling: Handle specific exceptions instead of broad ones like
Exception. - Adheres to the PEP 8 style guide by default.