https://github.com/mcfunley/pugsql
A HugSQL-inspired database library for Python
https://github.com/mcfunley/pugsql
Last synced: 7 months ago
JSON representation
A HugSQL-inspired database library for Python
- Host: GitHub
- URL: https://github.com/mcfunley/pugsql
- Owner: mcfunley
- License: apache-2.0
- Created: 2019-05-19T16:55:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-20T18:15:16.000Z (7 months ago)
- Last Synced: 2025-03-20T18:40:01.150Z (7 months ago)
- Language: Python
- Homepage: https://pugsql.org
- Size: 4.58 MB
- Stars: 724
- Watchers: 10
- Forks: 25
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
- best-of-python - GitHub - 49% open · ⏱️ 21.10.2025): (Database Clients)
README
# PugSQL
PugSQL is a simple Python interface for using parameterized SQL, in files.
See [pugsql.org](https://pugsql.org) for the documentation.
To install:
pip install pugsql
## Development Setup
To set up a development environment, create a virtual environment. [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
is a good way to do this:
brew install pyenv-virtualenv
pyenv virtualenv 3.8.2 pugsql
pyenv activate pugsql
Development of the library is done with [poetry](https://python-poetry.org/). Install poetry
to your virtualenv:
pip install --upgrade pip
pip install poetry
poetry install
The test suite is largely written against sqlite, and also currently includes some postgresql coverage.
To get postgres on a mac,
brew install postgresql
brew services start postgresql
The postgres tests will use `PGUSER` and a `PGPASS` environment variables to override the default postgres user and
password, when they exist. Postgres should be hosting on 127.0.0.1:5432.
To run the tests and the linter:
poetry run pytest
poetry run flake8