fastly
A Python Fastly API client library
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 fastlyuv
uv add fastlypoetry
poetry add fastlyInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
cudo-computeA Python client library for the Cudo Compute…
permissive · top 15,000 on PyPI
contentfulA Python client library for querying and…
permissive · top 15,000 on PyPI
alibabacloud-cdn20180510Provides Python bindings to Alibaba Cloud's CDN…
permissive · top 15,000 on PyPI
asanaPython client library for the Asana REST API,…
permissive · top 5,000 on PyPI
volcengine-python-sdkPython SDK for Volcengine cloud services,…
permissive · top 15,000 on PyPI
py-consulPython client library for HashiCorp Consul that…
permissive · top 5,000 on PyPI
datadog-api-clientPython client library for the Datadog API,…
permissive · top 1,000 on PyPI
recurlyOfficial Python client library for Recurly's V3…
unclear · top 15,000 on PyPI
python-barbicanclientPython client library and command-line tool for…
permissive · top 15,000 on PyPI
httplib2httplib2 is an HTTP client library that handles…
permissive · top 1,000 on PyPI