Skip to main content

Powertools for AWS Glue

Powertools for AWS Glue is a developer toolkit to implement best practices and increase developer velocity.

Inspired by Powertools for AWS Lambda.

Features

  • BatchJob — Automates Glue batch job lifecycle (job.init() and failure-safe job.commit()), initializes Spark and Glue contexts, and injects (args, context).
  • SparkJobInfo & SparkJobRun — Curated runtime metadata via ctx.job, lazy AWS Glue telemetry via ctx.run (attempts, workers, timing), and infrastructure paths.
  • Clean Argument Separation — Strictly separates business inputs in args from platform metadata in ctx.job.
  • Typed Argument Parsing — Automatically validates and parses business CLI parameters into standard dataclasses or Pydantic models using entrypoint type hints.

Installation

pip install aws-glue-powertools

To enable Pydantic model validation for typed argument parsing, install the pydantic extra:

pip install "aws-glue-powertools[pydantic]"

Quick Start

from dataclasses import dataclass

from aws_glue_powertools.jobs.spark import BatchJob, SparkJobContext


@dataclass
class JobParameters:
    target_date: str
    source_bucket: str
    dry_run: bool = False


@BatchJob()
def main(args: JobParameters, ctx: SparkJobContext) -> None:
    if args.dry_run:
        print(f"Dry-run for {ctx.job.name} (run {ctx.job.run_id})")
        return

    spark = ctx.glue.spark_session
    df = spark.read.parquet(f"{args.source_bucket}/{args.target_date}/")
    df.write.parquet(f"{ctx.job.temp_dir}/output/")


if __name__ == "__main__":
    main()

License

This project is licensed under the MIT License — see the LICENSE file for details.

Metadata

Release files for aws-glue-powertools 0.2.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 aws-glue-powertools 0.2.0
File Size Uploaded Provenance Actions
aws_glue_powertools-0.2.0.tar.gz 10.9 kB With provenance Details for aws_glue_powertools-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-glue-powertools 0.2.0
File Interpreter ABI Platform Actions
aws_glue_powertools-0.2.0-py3-none-any.whl Python 3 none any Details for aws_glue_powertools-0.2.0-py3-none-any.whl

Total release size: 23.2 kB

Release files / aws_glue_powertools-0.2.0.tar.gz

Download URL aws_glue_powertools-0.2.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c4d0c7a08ba4b7ef659c9f0058ef47ed1d080f00b90c43d772250df25e618fd1
BLAKE2b-256 checksum
How to use checksums
3a7b601f88caeb9c5e18cd83812c9b1fed8403b52a326f58851f20cc97db3c87
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 Nov 13, 2026.

Transparency log

Release files / aws_glue_powertools-0.2.0-py3-none-any.whl

Download URL aws_glue_powertools-0.2.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dd21812b18b56aa8a6c7565db5486baa264a30f656b03ea3fe090d0aebdbcf3
BLAKE2b-256 checksum
How to use checksums
7c5c75e8e7547cb4fffdcc2c60d17024a933d4bc7ec10ac675561093488ca228
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 Nov 13, 2026.

Transparency log

Security for aws-glue-powertools 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aws_glue_powertools-0.2.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 Nov 13, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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