https://github.com/mwmdev/py-starter
https://github.com/mwmdev/py-starter
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mwmdev/py-starter
- Owner: mwmdev
- License: mit
- Created: 2025-06-19T16:32:43.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T20:04:09.000Z (10 months ago)
- Last Synced: 2025-06-29T21:19:16.553Z (10 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# My Package
[](https://badge.fury.io/py/my-package)
[](https://pypi.org/project/my-package/)
[](https://github.com/yourusername/my-package/blob/main/LICENSE)
[](https://github.com/yourusername/my-package/actions/workflows/tests.yml)
[](https://codecov.io/gh/yourusername/my-package)
A professional Python package template ready for PyPI publication.
## Features
- Modern Python packaging with `pyproject.toml`
- Comprehensive test suite with pytest
- Code quality tools (ruff, mypy, pre-commit)
- Type hints throughout
- CLI interface
- GitHub Actions for CI/CD
- Ready for PyPI publication
## Installation
### From PyPI
```bash
pip install my-package
```
### From Source
```bash
git clone https://github.com/yourusername/my-package.git
cd my-package
pip install -e ".[dev]"
```
## Usage
### As a Library
```python
from my_package import hello_world
# Basic usage
message = hello_world()
print(message) # Output: Hello, World!
# Custom greeting
message = hello_world("Alice")
print(message) # Output: Hello, Alice!
```
### Command Line Interface
```bash
# Default greeting
my-package
# Custom greeting
my-package Alice
# Show version
my-package --version
```
## Development
### Setup Development Environment
This project uses Nix for reproducible development environments:
```bash
# With direnv (automatic)
cd my-package
# Environment activates automatically
# Without direnv
nix-shell
```
### Install Development Dependencies
```bash
pip install -e ".[dev]"
pre-commit install
```
### Running Tests
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov
# Run specific test file
pytest tests/test_core.py
```
### Code Quality
```bash
# Format code
ruff format
# Lint code
ruff check --fix
# Type checking
mypy src
# Run all pre-commit hooks
pre-commit run --all-files
```
### Building and Publishing
```bash
# Build the package
python -m build
# Upload to TestPyPI
python -m twine upload --repository testpypi dist/*
# Upload to PyPI
python -m twine upload dist/*
```
## Project Structure
```
my-package/
├── src/
│ └── my_package/
│ ├── __init__.py
│ ├── core.py
│ └── cli.py
├── tests/
│ ├── __init__.py
│ ├── test_core.py
│ └── test_cli.py
├── docs/
├── .github/
│ └── workflows/
│ └── tests.yml
├── pyproject.toml
├── README.md
├── LICENSE
├── CHANGELOG.md
├── shell.nix
└── .gitignore
```
## Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- Built with modern Python packaging standards
- Uses best practices for Python development
- Ready for immediate use and customization