Metadata-Version: 2.4
Name: Py3AMF
Version: 0.9.0
Summary: AMF support for Python
Home-page: https://github.com/StdCarrot/Py3AMF
Author: The Py3AMF Project
Author-email: yhbu@stdc.so
License: MIT License
Keywords: python3 amf amf0 amf3 flex flash remoting rpc http flashplayer air bytearray objectproxy arraycollection recordset actionscript decoder encoder gateway wsgi remoteobject sharedobject lso sol
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Development Status :: 5 - Production/Stable
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: defusedxml>=0.7.1
Provides-Extra: lxml
Requires-Dist: lxml>=6.1.1; extra == "lxml"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: summary

Py3AMF
======

Py3AMF is a Python 3 fork of
`PyAMF <https://github.com/hydralabs/pyamf>`__. It provides Action
Message Format (AMF0 and AMF3) encoding, decoding, and remoting support
for Python applications.

Current support
~~~~~~~~~~~~~~~

The 0.9.0 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.
- Jython, Cython extension builds, 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

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
<http://en.wikipedia.org/wiki/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 <http://en.wikipedia.org/wiki/Adobe_AIR>`__ and `Adobe Flash
Player <http://en.wikipedia.org/wiki/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 <http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol>`__
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``.
