Skip to main content

Py3AMF

Py3AMF is a Python 3 fork of PyAMF. It provides Action Message Format (AMF0 and AMF3) encoding, decoding, and remoting support for Python applications.

Current support

The current release line keeps the supported surface small and focused:

  • CPython 3.11, 3.12, 3.13, and 3.14 are tested with the python:3.11-slim, python:3.12-slim, python:3.13-slim, and python:3.14-slim container images.

  • Older Python 3 versions are not intentionally blocked, but they are not part of the active test matrix.

  • AMF0, AMF3, core remoting, the WSGI gateway, and pure Python runtime code are supported.

  • pyamf.adapters remains available as helper and compatibility modules.

  • Cython extension builds are available as an explicit source-build option. Default installs use the pure Python runtime.

  • Jython, framework gateways, and automatic conversion of third-party framework models are no longer officially supported.

Applications should convert framework-specific objects at the application layer before passing data to Py3AMF.

Install

Install the released package with pip:

python -m pip install Py3AMF

To compile the optional Cython extensions, use these lines in a requirements.txt file:

--no-binary Py3AMF
Py3AMF==0.9.1 --config-settings=py3amf.ext.cython=1

The Py3AMF[cython] extra is not used because extras select optional install dependencies, not a new wheel build variant. --config-settings passes the build request directly to the backend.

Each part has a separate role:

--no-binary Py3AMF

Tells pip not to select a prebuilt wheel for Py3AMF. Pip selects the source distribution instead and runs the local PEP 517 wheel build.

--config-settings=py3amf.ext.cython=1

Passes the opt-in value to the Py3AMF build backend for this requirement. The backend adds Cython to the isolated build environment and enables the cpyamf extension modules.

Pip may reuse a compatible wheel that it built previously. Use python -m pip install --no-cache-dir -r requirements.txt when a clean source rebuild is required.

For local development:

git clone git@github.com:StdCarrot/Py3AMF.git
cd Py3AMF
python -m pip install -r test-requirements.txt
python -c "import pyamf.tests; pyamf.tests.main()"
python -m pip install .

Simple example

Everything is same with PyAMF, but you have to concern str and bytes types.

import pyamf
from pyamf import remoting
from pyamf.flex import messaging
import uuid
import requests

msg = messaging.RemotingMessage(operation='retrieveUser',
                                destination='so.stdc.flexact.common.User',
                                messageId=str(uuid.uuid4()).upper(),
                                body=['user_id'])
req = remoting.Request(target='UserService', body=[msg])
ev = remoting.Envelope(pyamf.AMF3)
ev['/0'] = req

# Encode request
bin_msg = remoting.encode(ev)

# Send request; You can use other channels like RTMP
resp = requests.post('http://example.com/amf',
                     data=bin_msg.getvalue(),
                     headers={'Content-Type': 'application/x-amf'})

# Decode response
resp_msg = remoting.decode(resp.content)
print(resp_msg.bodies)

Action Message Format is a compact binary format used by Adobe Flash Player and Adobe AIR applications. Py3AMF keeps the AMF codec and WSGI remoting pieces current for modern Python 3 runtimes.

The Adobe Integrated Runtime and Adobe Flash Player use AMF to communicate between an application and a remote server. AMF encodes remote procedure calls (RPC) into a compact binary representation that can be transferred over HTTP/HTTPS or the RTMP/RTMPS protocol. Objects and data values are serialized into this binary format, which increases performance, allowing applications to load data up to 10 times faster than with text-based formats such as XML or SOAP.

AMF3, the default serialization for ActionScript 3.0, provides various advantages over AMF0, which is used for ActionScript 1.0 and 2.0. AMF3 sends data over the network more efficiently than AMF0. AMF3 supports sending int and uint objects as integers and supports data types that are available only in ActionScript 3.0, such as ByteArray, ArrayCollection, ObjectProxy, and IExternalizable.

Release files for Py3AMF 0.9.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 Py3AMF 0.9.1
File Size Uploaded
py3amf-0.9.1.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for Py3AMF 0.9.1
File Interpreter ABI Platform
py3amf-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / py3amf-0.9.1.tar.gz

Download URL py3amf-0.9.1.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
c9414aa31032978f258fd97c7334f60da0bda9b5e73fa526f7c43a995da5bf78
BLAKE2b-256 checksum
How to use checksums
01df4a89217635f5cf2532ca1c7a1073b79b5620c0897c8a34a46752d5eed509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / py3amf-0.9.1-py3-none-any.whl

Download URL py3amf-0.9.1-py3-none-any.whl
Size 208.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d97c0e9206e33d72c23d0ce6a729f53cbdb57537b3a10445de7bdfd47641a73
BLAKE2b-256 checksum
How to use checksums
ec6cec602117f0226905e36626c661cecdaf2d28113623c764a33b7a95f6c0b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 release files

0.9.0

2 release files

0.8.12

1 release file

0.8.11

1 release file

0.8.10

1 release file

0.8.9

2 release files

0.8.8

1 release file

0.8.7

1 release file

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

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