Skip to content

aniketmaurya/python-project-template

Repository files navigation

Python Project Template 🐍

A template to kick-start your open-source Python project.

Tests codecov black license

Open in GitHub Codespaces

Features

  • πŸš€ Modern Python project structure
  • πŸ“¦ Pre-configured pyproject.toml
  • πŸ€– ML server template with LitServe
  • πŸ§ͺ Testing setup with pytest
  • πŸ‘· CI/CD with GitHub Actions
  • πŸ“ Auto-generated documentation
  • 🎯 Type hints and static type checking
  • πŸ” Code formatting with ruff and isort
  • πŸ› Linting with ruff

Project Structure

python-project-template/
β”œβ”€β”€ .github/
β”‚   └── workflows/          # GitHub Actions workflows
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ src/                    # Source code
β”‚   └── python_project_template/
β”œβ”€β”€ tests/                  # Test files
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ pyproject.toml         # Project metadata and dependencies
└── setup.py              # Package installation

Installation

From Source

git clone https://github.com/aniketmaurya/python-project-template.git
cd python-project-template
pip install .

Development Installation

git clone https://github.com/aniketmaurya/python-project-template.git
cd python-project-template
pip install -e ".[dev]"

Usage

from python_project_template import do_something_awesome

print(do_something_awesome())

Development

  1. Clone the repository
git clone https://github.com/aniketmaurya/python-project-template.git
cd python-project-template
  1. Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. Install development dependencies
pip install -e ".[dev]"

Running Tests

pytest tests/

Contributing

Contributions are always welcome! Here's how you can help:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Please make sure to update tests as appropriate and follow the existing coding style.

License

MIT - Feel free to use this template for your projects!