Skip to main content

Akamai-Purge-Cache : Interactive Script

Current Python Script

"""Module to invoke Akamai Fastpurge via simple CLI utility."""
import os
import click
from fastpurge import FastPurgeClient


@click.command()
@click.option(
    "paths",
    "--path",
    "-p",
    multiple=True,
    help="A single URL to Purge (This option is repeatable for additional URLs)",
)
@click.option(
    "--dryrun",
    "-d",
    is_flag=True,
    help="Just print the command and args that will be run and exit",
)
def mgpurge(paths: list[str], dryrun: bool) -> None:
    """
    Module to invoke Akamai Fastpurge via simple CLI utility.
    :param list[str] paths: List of paths to purge from Akamai cache.
    :param bool dryrun: Just print the command and args that will be run and exit
    """
    # Default: Credentials are read from ~/.edgerc
    # client = FastPurgeClient()

    # Environment: Credentials are read from environment variables
    client = FastPurgeClient(
        auth={
            "client_secret": os.environ["AKAMAI_DEFAULT_CLIENT_SECRET"],
            "host": os.environ["AKAMAI_DEFAULT_HOST"],
            "access_token": os.environ["AKAMAI_DEFAULT_ACCESS_TOKEN"],
            "client_token": os.environ["AKAMAI_DEFAULT_CLIENT_TOKEN"],
        }
    )
    if dryrun:
        print("These paths will be purged:")
        for path in paths:
            click.echo(message=path)
        return
        # Start purge of some URLs
    # purge is a Future, if we want to ensure purge completed
    # we can block on the result:
    purge_cmd = client.purge_by_url(urls=paths)
    # purge is a Future, if we want to ensure purge completed
    # we can block on the result:
    result = purge_cmd.result()
    print("Purge completed:", result)


if __name__ == "__main__":
    # pylint: disable=no-value-for-parameter
    mgpurge()

TO-DO

  • Document local installation
  • Document local run
  • Document building
  • Document publishing to PY-Pi
  • Document remote installation and usage

Metadata

Release files for akamai_purge_cache 2.0.1

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

Source distribution (sdist)

Source distribution for akamai_purge_cache 2.0.1
File Size Uploaded Provenance Actions
akamai_purge_cache-2.0.1.tar.gz 2.3 kB Without provenance Details for akamai_purge_cache-2.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 5.9 kB

Release files / akamai_purge_cache-2.0.1.tar.gz

Download URL akamai_purge_cache-2.0.1.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d286534b5582fe00a8a098ebeba0e58522c59973f0c8532d327eaad9e288c61
BLAKE2b-256 checksum
How to use checksums
5d6c62eed316ec030f575ea9ffa10006a7447388e0ed5c95782a3428ef4b3e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Linux/5.15.49-linuxkit-pr

Release files / akamai_purge_cache-2.0.1-py3-none-any.whl

Download URL akamai_purge_cache-2.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8230b92746da942a0542da90613f0ac5d432cf0ed24e4a19f374101b7a9d3726
BLAKE2b-256 checksum
How to use checksums
d0021a33c6b6f065192ce88a8dda84950a8b85f1aa61627dedd5200f9a2b76e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Linux/5.15.49-linuxkit-pr

Security for akamai_purge_cache 2.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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