Skip to main content

Instackup

PyPI Python versions CI License: MIT

This Python library is an open source way to standardize and simplify connections with cloud-based tools, databases and commonly used tools in data manipulation and analysis. It can help BI teams by having a unified source code for local development and testing as well as remote production (automated scheduled run) environments.

Index

Current release

Version 0.4.0 (beta): a modernization release with support for Python 3.11–3.15, current versions of every dependency, production-ready credentials (environment variables, secret managers and cloud platform identities), type hints and a full test suite. See what changed, including the breaking changes.

Installation

Instackup needs Python 3.11 or newer. Install it with the extras for the services you use:

pip install 'instackup[gcp,postgresql]'
Extra Modules
gcp bigquery_tools, gcloudstorage_tools (and GCP Secret Manager credentials)
gsheets gsheets_tools
aws s3_tools (and AWS Secrets Manager credentials)
redshift redshift_tools
postgresql sql_tools.PostgreSQLTool
mysql sql_tools.MySQLTool
all Everything above

sql_tools.SQLiteTool, general_tools and heroku_tools work without extras.

Quick start

from instackup import BigQueryTool, PostgreSQLTool, S3Tool

# Databases: credentials come from environment variables, a secret manager or a credentials file
with PostgreSQLTool() as pg:
    orders = pg.query("SELECT * FROM orders WHERE created_at >= %s", params=("2026-01-01",))

# Cloud services: with nothing configured, the platform's own identity is used
bq = BigQueryTool()
bq.upload(orders, dataset="analytics", table="orders", if_exists="replace")

s3 = S3Tool(uri="s3://my-bucket/exports/")
s3.upload_file("report.csv")

The library logs through Python's standard logging module. To see what it's doing:

import logging

logging.basicConfig(level=logging.INFO)

Credentials

Tools look up credentials by service and connection name (connection="default" unless you pass another one), in this order:

  1. INSTACKUP_<SERVICE>__<CONNECTION>__<KEY> environment variables, e.g. INSTACKUP_POSTGRESQL__DEFAULT__PASSWORD;
  2. a credentials document stored in AWS Secrets Manager (INSTACKUP_AWS_SECRET_ID) or GCP Secret Manager (INSTACKUP_GCP_SECRET_NAME);
  3. a YAML or JSON file set in INSTACKUP_CREDENTIALS_FILE (or the legacy CREDENTIALS_HOME), whose values can reference environment variables as ${NAME}.

When Google or AWS credentials aren't configured, the tools use Application Default Credentials and the AWS default credential chain, the recommended setup in production (service accounts, Workload Identity, IAM roles).

A minimal local setup:

# credentials.yml (use credentials/secret_template.yml as a starting point)
PostgreSQL:
  default:
    host: localhost
    dbname: postgres
    user: postgres
    password: ${POSTGRES_PASSWORD}
export INSTACKUP_CREDENTIALS_FILE="$HOME/.config/instackup/credentials.yml"
export POSTGRES_PASSWORD=...
gcloud auth application-default login  # For Google tools
aws sso login                          # For AWS tools

Read the credentials guide for every option, production recommendations and how to migrate from CREDENTIALS_HOME.

Documentation

Development

The project uses uv.

uv sync --all-extras          # Create .venv with every extra and the dev tools
uv run pytest                 # Unit tests
uv run ruff check             # Lint
uv run ruff format            # Format
uv run mypy                   # Type check

Integration tests run against real databases and are skipped unless their URLs are set:

docker run -d --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:17-alpine
TEST_POSTGRESQL_URL=postgresql://postgres:postgres@localhost:5432/postgres uv run pytest -m integration

Every push and pull request runs the CI workflow. Publishing a GitHub release uploads the package to PyPI; see releasing.md.

Version logs

See what changed in every version.

Metadata

Release files for instackup 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instackup 0.4.0
File Size Uploaded Provenance
instackup-0.4.0.tar.gz 105.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for instackup 0.4.0
File Interpreter ABI Platform
instackup-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 150.3 kB

Release files / instackup-0.4.0.tar.gz

Download URL instackup-0.4.0.tar.gz
Size 105.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b0ff2fb269455d0559a607de2d99009ca92ac81b795e89096fa0411fac7688e0
BLAKE2b-256 checksum
How to use checksums
dd1ec5558b896a032cbeee11cc5fbd1db43aeb0dac71c9aee0e9e22e80f279aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / instackup-0.4.0-py3-none-any.whl

Download URL instackup-0.4.0-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3938c435dc76b82aff1b4346dac1a3d21efec3c87c43d8bc9f34bfc813fe4ca
BLAKE2b-256 checksum
How to use checksums
6eab389785bc03021e94dc475cec6074ca4f7d97044f6d9e40074bb6afd2541f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for instackup 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for instackup-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page