Python SDK for Fastly Compute
Project description
Fastly Compute Python SDK
Experimental Python SDK for Fastly Compute services
Highlights
- Support for WSGI Frameworks. Flask and Bottle examples are included for reference.
- Access from Python to Fastly's API
- Full type hints and IDE support
Quick Start
Here's how to write your own Python WSGI app and run it on Fastly's edge network:
-
Install the package that provides the Fastly Python build tool and gives you access to the Fastly API:
pip install fastly-compute -
Make a project shaped like our Flask example. You may find it easiest to clone the repository, copy the
examples/flask-appfolder, and modify it. If you change the name of the top-level.pyfile, be sure to also update the entrypoint (entry = "your_top_level_module_name") inpyproject.toml. -
cd your-project -
Install the Fastly CLI if you don't already have it.
-
fastly compute init -
Say yes when warned "The current directory isn't empty." Answer "Other" when it asks for Language.
-
Add this to the bottom of
fastly.toml:[scripts] build = "fastly-compute-py build" -
fastly compute build -
fastly compute deploy
Run Some Examples on Your Own Machine
We ship a few simple examples you can run locally to get a taste of what's possible.
Status
Currently supports...
- Building pure Python into WebAssembly components
- Creating Python bindings from Fastly's WIT files
- Hosting web frameworks by adapting Fastly's API to WSGI
- Hosting non-WSGI applications by writing directly against Fastly's API
Caveats
- So our memory-snapshotting build process can retain them, all the packages
needed at runtime must get imported when your entrypoint (e.g.
flask-app.py) is imported. This can happen transitively. But beware of deferred imports like non-top-level ones; if they aren't triggered by importing your entrypoint, they will fail at runtime. (If you have third-party code that uses non-top-level imports, you can ensure they work by importing them at the top level in your own code.) - Third-party C extension modules are not yet supported.
- Our in-Python API may change backward-incompatibly during this beta period.
Contributing
See CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 18.7 MB
- Tags: CPython 3.12+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31fb3399d9d1c506b9f7ceb2e2ef97966a7715bc204b2ea8a8674a286f96e3a9
|
|
| MD5 |
8a02f74ca5791948e45fa3c404dca5d7
|
|
| BLAKE2b-256 |
0e35bb72a076e50d77d32158cfddbf9b71b5be01aee44802a2f6078520d2e3ab
|
Provenance
The following attestation bundles were made for fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on fastly/compute-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
31fb3399d9d1c506b9f7ceb2e2ef97966a7715bc204b2ea8a8674a286f96e3a9 - Sigstore transparency entry: 1698868199
- Sigstore integration time:
-
Permalink:
fastly/compute-sdk-python@42064bdf82df48ccde1bcbc37647480d96792a94 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fastly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42064bdf82df48ccde1bcbc37647480d96792a94 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 18.2 MB
- Tags: CPython 3.12+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1dd2282e7bdfa55dd792218bbecb74100f8543a9fb7acc956221b36b582a78c
|
|
| MD5 |
a978652145843d1f129ef9795d3500b1
|
|
| BLAKE2b-256 |
10d4742fc8f9b32aa456e736e6d7865a940d86a239eaa7622868985b2f3ea25f
|
Provenance
The following attestation bundles were made for fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl:
Publisher:
publish.yml on fastly/compute-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastly_compute-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
f1dd2282e7bdfa55dd792218bbecb74100f8543a9fb7acc956221b36b582a78c - Sigstore transparency entry: 1698868318
- Sigstore integration time:
-
Permalink:
fastly/compute-sdk-python@42064bdf82df48ccde1bcbc37647480d96792a94 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fastly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42064bdf82df48ccde1bcbc37647480d96792a94 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastly_compute-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fastly_compute-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 17.0 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4846937181110131e81b04b4752aa4f980129ef43d85134dce9379ba6cb411d
|
|
| MD5 |
8f007668da5fddff58e1f6153043c7b6
|
|
| BLAKE2b-256 |
c5c1de1f220b311a2cd7f247910b1f346c26431a090aca5635177cdb8d08fa80
|
Provenance
The following attestation bundles were made for fastly_compute-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on fastly/compute-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastly_compute-0.1.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
f4846937181110131e81b04b4752aa4f980129ef43d85134dce9379ba6cb411d - Sigstore transparency entry: 1698868453
- Sigstore integration time:
-
Permalink:
fastly/compute-sdk-python@42064bdf82df48ccde1bcbc37647480d96792a94 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fastly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42064bdf82df48ccde1bcbc37647480d96792a94 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastly_compute-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl.
File metadata
- Download URL: fastly_compute-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl
- Upload date:
- Size: 17.9 MB
- Tags: CPython 3.12+, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ba6fa294360f17a1975b67b59fcee691677bbda4da921468afa06e4aa6c987
|
|
| MD5 |
6ed488caf0afc02bd60c3a7902b16984
|
|
| BLAKE2b-256 |
9374e3be93750ed90baa6e28c2266004eabc71368ebd9bd3b76a02826146ed07
|
Provenance
The following attestation bundles were made for fastly_compute-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl:
Publisher:
publish.yml on fastly/compute-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastly_compute-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl -
Subject digest:
e5ba6fa294360f17a1975b67b59fcee691677bbda4da921468afa06e4aa6c987 - Sigstore transparency entry: 1698868049
- Sigstore integration time:
-
Permalink:
fastly/compute-sdk-python@42064bdf82df48ccde1bcbc37647480d96792a94 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fastly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42064bdf82df48ccde1bcbc37647480d96792a94 -
Trigger Event:
release
-
Statement type: