- ./Software Engineering
- andornaut@github /python-cli-app
- Documentation
- PyPI - The Python Package Index
- Python on macOS via Homebrew
- Effective Python
- Fluent Python (2nd edition)
- Learn Python 3 the Hard Way
- Programming Python
- Two Scoops of Django 3.x
- Pycoder's Weekly - Stay Up-to-Date With Your Weekly Dose Of Python
- Install python3 using ansible-ctrl/roles/dev
- Link
pythontopython3sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
| Name | Description |
|---|---|
| Beautiful Soup | Parser, scraper |
| DevPi | Python PyPi staging server and packaging, testing, release tool |
| Django | High-level web framework |
| FastAPI | A modern, fast, web framework for building APIs. Based on Python type hints. |
| Flask | Micro framework for building web applications |
| NumPy | Scientific computing library |
| Pillow | Open and manipulate many image file formats |
| pytest | A framework that makes it easy to write small, readable tests |
| records | A library for making raw SQL queries to most relational databases |
| requests | A simple, yet elegant, HTTP library |
| SQLAlchemy | SQL toolkit and Object Relational Mapper |
| Typer | Build great CLIs. Easy to code. Based on Python type hints. Built on top of Click. |
| Name | Description |
|---|---|
| Black Formatter for VS Code | Support the black formatter (use ruff instead) |
| Flake8 for VS Code | Support for the flake8 linter (use ruff instead) |
| Pipenv | Dev workflows for humans (use Poetry instead) |
| Pipx | |
| Poe | A task runner that works well with poetry |
| Poetry | Python packaging and dependency management made easy |
| pre-commit | A framework for managing multi-language pre-commit hooks |
| Python for VS Code | Support intelliSense, linting, debugging, code navigation, code formatting, etc |
| ruff |
- Install pipx
- Install poetry
pipx install poetry - Run
poetry init - Update
pyproject.toml
- Linux
~/.config/pypoetry - macOS
~/Library/Application\ Support/pypoetry/config.toml
# Configure Poetry to install venvs in the project directory, so that VSCode can enable them automatically
poetry config virtualenvs.in-project true
# Set PYPI access token
poetry config pypi-token.pypi ${token}
Add an .env file to the project root:
PYTHONPATH=.
Pipenv and
Add a pytest.ini file to the project root:
[pytest]
pythonpath = .
Add the following line to .vscode/launch.json configurations:
"envFile": "${workspaceFolder}/.env",
Example:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: File with env",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true,
"envFile": "${workspaceFolder}/.env",
}
]
}This only occurs when starting VS Code from a terminal that already has an active virtualenv (eg. after running pipenv shell).
- CTRL+Shift+P
- Select "Python: Select Interpreter"
- Select the correct interpreter
- Open "Text Explorer"