Metadata-Version: 2.1
Name: akamai-purge-cache
Version: 0.1.9
Summary: Marriott CDN Team Fastpurge POC script
Author: Alan Janis
Author-email: alan.janis@marriott.com
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: awslambdaric (>=2.0.4,<3.0.0)
Requires-Dist: click (>=8.1.6,<9.0.0)
Requires-Dist: edgegrid-python (>=1.3.1,<2.0.0)
Requires-Dist: fastpurge (>=1.0.4,<2.0.0)
Requires-Dist: monotonic (>=1.6,<2.0)
Requires-Dist: more-executors (>=2.11.4,<3.0.0)
Description-Content-Type: text/markdown

# akamai-purge-cache : interactive python script

## Python Script

```python
from fastpurge import FastPurgeClient
import click

@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):
  # Omit credentials to read from ~/.edgerc
  client = FastPurgeClient()
  if dryrun:
    print('These paths will be purged:')
    for path in paths:
      click.echo(path)
  else:

    # Start purge of some URLs
    mgpurge = client.purge_by_url(paths)
    # purge is a Future, if we want to ensure purge completed
    # we can block on the result:
    result = mgpurge.result()
    # print("Purge completed:")
    print("Purge completed:", result)
  
if __name__ == "__main__":
  mgpurge()
```

## TO-DO
- Document local installation
- Document local run
- Document building
- Document publishing to PY-Pi
- Document remote installation and usage
