From be79bf1137b898b032e1c002954a7206ccfeeb50 Mon Sep 17 00:00:00 2001 From: StdC Date: Sat, 25 Feb 2023 01:10:06 +0900 Subject: [PATCH] Change README.md to README.rst --- README.rst | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 README.rst diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..333a1611 --- /dev/null +++ b/README.rst @@ -0,0 +1,119 @@ +Py3AMF +====== + +Py3AMF is fork of `PyAMF `__ to +support Python3 + +Why Py3AMF +~~~~~~~~~~ + +By states of issues and PR in +`PyAMF `__, it dosen’t seems to be +under developing. And another PR that supports Py3 has been discontinued +for over two years. This is the only Python AMF Project which trying to +support Py3 under developing on GitHub. + +State +~~~~~ + +Pass ``setup.py test`` But, adapters were not tested + +Warning +~~~~~~~ + +This project isn’t completed. If you want to make it fast, please send +PR. + +Install +~~~~~~~ + +This was tested on Ubuntu 16.04.2 and macOS 10.12.4 + +To install, you can use pip3 on your environment. + +:: + + pip3 install Py3AMF + +Or, you can use setup.py to develop. + +:: + + git clone git@github.com:StdCarrot/Py3AMF.git + cd Py3AMF + # python3 setup.py test + python3 setup.py 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) + +TODO +---- + +- Check adapters + +-------------- + +`PyAMF `__ provides Action Message Format +(`AMF `__) support +for `Python `__ that is compatible with the `Adobe +Flash Player `__. It includes +integration with Python web frameworks like +`Django `__, `Pylons `__, +`Twisted `__, +`SQLAlchemy `__, +`web2py `__ and +`more `__. + +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 `__. diff --git a/setup.py b/setup.py index 35c50773..39ecd245 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name = "Py3AMF" description = "AMF support for Python" -long_description = setupinfo.read('README.md') +long_description = setupinfo.read('README.rst') url = "https://github.com/StdCarrot/Py3AMF" author = "The Py3AMF Project" author_email = "yhbu@stdc.so"