pax_global_header 0000666 0000000 0000000 00000000064 14507063506 0014520 g ustar 00root root 0000000 0000000 52 comment=9bc5a1ec81ef15595645012e9493c26fd96333a9
PyGreSQL-PyGreSQL-166b135/ 0000775 0000000 0000000 00000000000 14507063506 0015003 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/.clang-format 0000664 0000000 0000000 00000001234 14507063506 0017356 0 ustar 00root root 0000000 0000000 # A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
#
# Based on Paul Ganssle's version at
# https://gist.github.com/pganssle/0e3a5f828b4d07d79447f6ced8e7e4db
BasedOnStyle: Google
AlwaysBreakAfterReturnType: All
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: Align
AlignTrailingComments: true
BreakBeforeBraces: Stroustrup
ColumnLimit: 79
DerivePointerAlignment: false
IndentWidth: 4
Language: Cpp
PointerAlignment: Right
ReflowComments: true
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
TabWidth: 4
UseCRLF: false
UseTab: Never
StatementMacros:
- Py_BEGIN_ALLOW_THREADS
- Py_END_ALLOW_THREADS PyGreSQL-PyGreSQL-166b135/.devcontainer/ 0000775 0000000 0000000 00000000000 14507063506 0017542 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/.devcontainer/dev.env 0000664 0000000 0000000 00000000244 14507063506 0021032 0 ustar 00root root 0000000 0000000 PGHOST=pg15
PGPORT=5432
PGDATABASE=test
PGUSER=test
PGPASSWORD=test
PYGRESQL_DB=test
PYGRESQL_HOST=pg15
PYGRESQL_PORT=5432
PYGRESQL_USER=test
PYGRESQL_PASSWD=test
PyGreSQL-PyGreSQL-166b135/.devcontainer/devcontainer.json 0000664 0000000 0000000 00000004047 14507063506 0023123 0 ustar 00root root 0000000 0000000 // For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "PyGreSQL",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerComposeFile": "docker-compose.yml",
"service": "dev",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"sqltools.connections": [
{
"name": "Container database",
"driver": "PostgreSQL",
"previewLimit": 50,
"server": "pg15",
"port": 5432,
"database": "test",
"username": "test",
"password": "test"
}
],
"python.pythonPath": "/usr/local/bin/python",
"python.analysis.typeCheckingMode": "basic",
"python.testing.unittestEnabled": true,
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.rulers": [
79
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-vscode.cpptools",
"mtxr.sqltools",
"njpwerner.autodocstring",
"redhat.vscode-yaml",
"eamodio.gitlens",
"charliermarsh.ruff",
"streetsidesoftware.code-spell-checker",
"lextudio.restructuredtext"
]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash /workspace/.devcontainer/provision.sh"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
} PyGreSQL-PyGreSQL-166b135/.devcontainer/provision.sh 0000664 0000000 0000000 00000005404 14507063506 0022131 0 ustar 00root root 0000000 0000000 #!/usr/bin/bash
# install development environment for PyGreSQL
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get -y upgrade
# install base utilities and configure time zone
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
sudo apt-get install -y apt-utils software-properties-common
sudo apt-get install -y tzdata
sudo dpkg-reconfigure --frontend noninteractive tzdata
sudo apt-get install -y rpm wget zip
# install all supported Python versions
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.7 python3.7-dev python3.7-distutils
sudo apt-get install -y python3.8 python3.8-dev python3.8-distutils
sudo apt-get install -y python3.9 python3.9-dev python3.9-distutils
sudo apt-get install -y python3.10 python3.10-dev python3.10-distutils
sudo apt-get install -y python3.11 python3.11-dev python3.11-distutils
sudo apt-get install -y python3.12 python3.12-dev python3.12-distutils
# install build and testing tool
python3.7 -m pip install -U pip setuptools wheel build
python3.8 -m pip install -U pip setuptools wheel build
python3.9 -m pip install -U pip setuptools wheel build
python3.10 -m pip install -U pip setuptools wheel build
python3.11 -m pip install -U pip setuptools wheel build
pip install ruff
sudo apt-get install -y tox clang-format
pip install -U tox
# install PostgreSQL client tools
sudo apt-get install -y postgresql libpq-dev
for pghost in pg10 pg12 pg14 pg15 pg16
do
export PGHOST=$pghost
export PGDATABASE=postgres
export PGUSER=postgres
export PGPASSWORD=postgres
createdb -E UTF8 -T template0 test
createdb -E SQL_ASCII -T template0 test_ascii
createdb -E LATIN1 -l C -T template0 test_latin1
createdb -E LATIN9 -l C -T template0 test_latin9
createdb -E ISO_8859_5 -l C -T template0 test_cyrillic
psql -c "create user test with password 'test'"
psql -c "grant create on database test to test"
psql -c "grant create on database test_ascii to test"
psql -c "grant create on database test_latin1 to test"
psql -c "grant create on database test_latin9 to test"
psql -c "grant create on database test_cyrillic to test"
psql -c "grant create on schema public to test" test
psql -c "grant create on schema public to test" test_ascii
psql -c "grant create on schema public to test" test_latin1
psql -c "grant create on schema public to test" test_latin9
psql -c "grant create on schema public to test" test_cyrillic
psql -c "create extension hstore" test
psql -c "create extension hstore" test_ascii
psql -c "create extension hstore" test_latin1
psql -c "create extension hstore" test_latin9
psql -c "create extension hstore" test_cyrillic
done
export PGDATABASE=test
export PGUSER=test
export PGPASSWORD=test
PyGreSQL-PyGreSQL-166b135/.gitattributes 0000664 0000000 0000000 00000000475 14507063506 0017704 0 ustar 00root root 0000000 0000000 * text=auto eol=lf
*.bat text eol=crlf
*.css text eol=lf
*.html text eol=lf
*.ini text eol=lf
*.py text eol=lf
*.raw text eol=lf
*.rst text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.yml text eol=lf
*.gif binary
*.ico binary
*.jpg binary
*.png binary
*.exe binary
*.so binary
*.pdf binary
*.gz binary
*.zip binary
PyGreSQL-PyGreSQL-166b135/.github/ 0000775 0000000 0000000 00000000000 14507063506 0016343 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/.github/workflows/ 0000775 0000000 0000000 00000000000 14507063506 0020400 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/.github/workflows/docs.yml 0000664 0000000 0000000 00000001626 14507063506 0022060 0 ustar 00root root 0000000 0000000 name: Publish PyGreSQL documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: CHeck out repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
sudo apt install libpq-dev
python -m pip install --upgrade pip
pip install .
pip install "sphinx>=7,<8"
- name: Create docs with Sphinx
run: |
cd docs
make html
- name: Deploy docs to GitHub pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/_build/html
cname: pygresql.org
enable_jekyll: false
force_orphan: true
PyGreSQL-PyGreSQL-166b135/.github/workflows/lint.yml 0000664 0000000 0000000 00000001012 14507063506 0022063 0 ustar 00root root 0000000 0000000 name: Run PyGreSQL quality checks
on:
push:
pull_request:
jobs:
checks:
name: Quality checks run
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install tox
run: pip install tox
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Run quality checks
run: tox -e ruff,mypy,cformat,docs
timeout-minutes: 5
PyGreSQL-PyGreSQL-166b135/.github/workflows/tests.yml 0000664 0000000 0000000 00000003630 14507063506 0022267 0 ustar 00root root 0000000 0000000 name: Run PyGreSQL test matrix
# this has been shamelessly copied from Psycopg
on:
push:
pull_request:
jobs:
tests:
name: Unit tests run
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- { python: "3.7", postgres: "11" }
- { python: "3.8", postgres: "12" }
- { python: "3.9", postgres: "13" }
- { python: "3.10", postgres: "14" }
- { python: "3.11", postgres: "15" }
- { python: "3.12", postgres: "16" }
# Opposite extremes of the supported Py/PG range, other architecture
- { python: "3.7", postgres: "16", architecture: "x86" }
- { python: "3.8", postgres: "15", architecture: "x86" }
- { python: "3.9", postgres: "14", architecture: "x86" }
- { python: "3.10", postgres: "13", architecture: "x86" }
- { python: "3.11", postgres: "12", architecture: "x86" }
- { python: "3.12", postgres: "11", architecture: "x86" }
env:
PYGRESQL_DB: test
PYGRESQL_HOST: 127.0.0.1
PYGRESQL_USER: test
PYGRESQL_PASSWD: test
services:
postgresql:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install tox
run: pip install tox
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Run tests
env:
MATRIX_PYTHON: ${{ matrix.python }}
run: tox -e py${MATRIX_PYTHON/./}
timeout-minutes: 5
PyGreSQL-PyGreSQL-166b135/.gitignore 0000664 0000000 0000000 00000000464 14507063506 0016777 0 ustar 00root root 0000000 0000000 *~
*.bak
*.cache
*.dll
*.egg-info
*.log
*.patch
*.pid
*.pstats
*.py[co]
*.so
*.swp
__pycache__/
build/
dist/
_build/
_build_doctrees/
/local/
/tests/LOCAL_*.py
docker-compose.yml
Dockerfile
Vagrantfile
Vagrantfile-*
.coverage
.tox/
.venv/
.vagrant/
.vagrant-*/
Thumbs.db
.DS_Store
.idea/
.vs/
.vscode/
PyGreSQL-PyGreSQL-166b135/.readthedocs.yaml 0000664 0000000 0000000 00000001073 14507063506 0020233 0 ustar 00root root 0000000 0000000 # .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
PyGreSQL-PyGreSQL-166b135/LICENSE.txt 0000664 0000000 0000000 00000002572 14507063506 0016634 0 ustar 00root root 0000000 0000000 Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
Based heavily on code written by Pascal Andre (andre@chimay.via.ecp.fr)
Copyright (c) 1995, Pascal Andre
Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
Further modifications copyright (c) 2009-2023 by the PyGreSQL Development Team
PyGreSQL is released under the PostgreSQL License, a liberal Open Source
license, similar to the BSD or MIT licenses:
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies. In
this license the term "AUTHORS" refers to anyone who has contributed code
to PyGreSQL.
IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE
AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.
PyGreSQL-PyGreSQL-166b135/MANIFEST.in 0000664 0000000 0000000 00000001011 14507063506 0016532 0 ustar 00root root 0000000 0000000
include setup.py
recursive-include pg *.py *.pyi py.typed
recursive-include pgdb *.py py.typed
recursive-include tests *.py
include ext/*.c
include ext/*.h
include README.rst
include LICENSE.txt
include tox.ini
include pyproject.toml
include docs/Makefile
include docs/make.bat
include docs/*.py
include docs/*.rst
include docs/*.txt
exclude docs/index.rst
recursive-include docs/community *.rst
recursive-include docs/contents *.rst
recursive-include docs/download *.rst
recursive-include docs/_static *.ico *.png
PyGreSQL-PyGreSQL-166b135/README.rst 0000664 0000000 0000000 00000002667 14507063506 0016505 0 ustar 00root root 0000000 0000000 PyGreSQL - Python interface for PostgreSQL
==========================================
PyGreSQL is a Python module that interfaces to a PostgreSQL database.
It wraps the lower level C API library libpq to allow easy use of the
powerful PostgreSQL features from Python.
PyGreSQL should run on most platforms where PostgreSQL and Python is running.
It is based on the PyGres95 code written by Pascal Andre.
D'Arcy J. M. Cain renamed it to PyGreSQL starting with version 2.0
and serves as the "BDFL" of PyGreSQL.
Christoph Zwerschke volunteered as another maintainer and has been the main
contributor since version 3.7 of PyGreSQL.
The following Python versions are supported:
* PyGreSQL 4.x and earlier: Python 2 only
* PyGreSQL 5.x: Python 2 and Python 3
* PyGreSQL 6.x and newer: Python 3 only
The current version of PyGreSQL supports Python versions 3.7 to 3.12
and PostgreSQL versions 10 to 16 on the server.
Installation
------------
The simplest way to install PyGreSQL is to type::
$ pip install PyGreSQL
For other ways of installing PyGreSQL and requirements,
see the documentation.
Note that PyGreSQL also requires the libpq shared library to be
installed and accessible on the client machine.
Documentation
-------------
The documentation is available at
`pygresql.github.io/ `_ and at
`pygresql.readthedocs.io `_,
where you can also find the documentation for older versions.
PyGreSQL-PyGreSQL-166b135/docs/ 0000775 0000000 0000000 00000000000 14507063506 0015733 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/docs/Makefile 0000664 0000000 0000000 00000001172 14507063506 0017374 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
PyGreSQL-PyGreSQL-166b135/docs/_static/ 0000775 0000000 0000000 00000000000 14507063506 0017361 5 ustar 00root root 0000000 0000000 PyGreSQL-PyGreSQL-166b135/docs/_static/favicon.ico 0000664 0000000 0000000 00000022156 14507063506 0021510 0 ustar 00root root 0000000 0000000 h 6 @@ ( F ( 5 6 9 : ; <