skillfed

fastly

A Python Fastly API client library

fastly v14.0.0 87.7K downloads/30d#13,776 on PyPI77
Permissive license Active released

What it is and what it does

fastly is an official Python client for the Fastly CDN and edge computing platform API. It wraps Fastly's REST endpoints in a typed, object-oriented interface, allowing developers to programmatically create and manage services, configure caching rules, manage access control lists, set up backends, and handle billing operations without writing raw HTTP requests.

The library requires Python 3.6 or later and depends only on python-dateutil and urllib3 for date handling and HTTP transport. It uses a context-manager pattern for API clients and raises fastly.ApiException for error handling. Most operations require authentication via an API token, which can be supplied directly or read from the FASTLY_API_TOKEN environment variable.

Use it for:

  • Automate Fastly service provisioning and configuration in CI/CD pipelines or infrastructure-as-code workflows.
  • Programmatically manage ACL entries and access control rules for dynamic IP allowlisting or blocking.
  • Query billing and invoice data to integrate Fastly costs into internal billing systems or dashboards.
  • Build monitoring or operational dashboards that pull real-time service status and configuration from Fastly.
  • Bulk update backend origins or routing rules across multiple Fastly services in a single script.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for the Fastly API, providing programmatic access to manage CDN services, ACLs, backends, billing, and other Fastly platform features.

Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and provides comprehensive API coverage for Fastly platform automation. It is well-suited for teams already using Fastly who need programmatic control over their CDN configuration. No known vulnerabilities as of the latest security scan.

Install

fastly on PyPI

pip

pip install fastly

uv

uv add fastly

poetry

poetry add fastly

Installing fastly

Before you install

Low install friction with only two lightweight runtime dependencies (python-dateutil and urllib3). Actively maintained with a recent release 28 days ago and ongoing repository activity.

License in practice

Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install fastly

import fastly
from fastly.api import acl_api

configuration = fastly.Configuration()
configuration.api_token = 'YOUR_API_KEY'

with fastly.ApiClient(configuration) as api_client:
    api_instance = acl_api.AclApi(api_client)
    api_response = api_instance.create_acl('service_id', 1, name='test-acl')

Requires a valid Fastly API token; set via configuration.api_token or FASTLY_API_TOKEN environment variable.

Verify before relying

  • Completeness of API endpoint coverage relative to the full Fastly API surface.
  • Performance characteristics and rate-limiting behavior for high-volume operations.
  • Backward compatibility guarantees across major version updates.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 2 — python-dateutil, urllib3
Maintenance actively maintained — 28 days since the last release
Last repo commit
First released
Downloads 87,681/month — #13,776 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastly-14.0.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

fastly api client pythoncdn management libraryfastly service configurationhttp caching controledge computing apicontent delivery network clientfastly automation
cdn-managementapi-client

More WWW/HTTP packages