AMF对Python的支持
Py3AMF的Python项目详细描述
#py3 amf
py3amf是[pyamf]的分支(https://github.com/hydralabs/pyamf)来支持python3
试图支持GitHub上正在开发的Py3的项目。
\35 35 35 35 35
state
pass'setup.py test`
>但是,没有测试适配器
如果您想快速完成此项目,请发送pr。
如果您想快速完成此项目,请发送pr。
安装
此项目已在ubuntututu16 10.12.4要安装,你可以在你的环境中使用pip3。
````
pip3安装py3amf
````
或者,你可以使用setup.py来开发。
`````
git clone git@github.com:stdcarrot/py3amf.git
cd py3amf
cd py3amf
python3 setup.py test
python3 setup.py install
`````
>
python3 setup.python3 setup.pytest
python3 setup.python3 setup.pyinstall
install和Pyamf一样,但是您必须考虑str和bytes类型。
``python
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=['用户id'])
req=remoting.request(target='用户服务',body=[消息])
ev=remoting.envelope(pyamf.amf3)
ev['/0']=req
rtmp
resp=requests.post('http://example.com/amf',
data=bin_msg.getvalue(),
headers={content-type':'application/x-amf'})
格式([AMF](http://en.wikipedia.org/wiki/action_message_format))支持与[Adobe Flash播放器](http://en.wikipedia.org/wiki/flash_player)兼容的[Python](http://en.wikipedia.org/wiki/flash_format)。它包括与python web框架的集成,比如[django](http://djangoproject.com)、[pylons](http://pylonshq.com)、[twisted](http://twistedmatrix.com)、[sqlalchemy](http://sqlalchemy.org)。[web2py](http://www.web2py.com)和[更多](http://pyamf.org/tutorials/index.html)。
[Adobe集成运行时](http://en.wikipedia.org/wiki/adobe-air)和[Adobe Flash播放器](http://en.wikipedia.org/wiki/flash-player)使用AMF在应用程序和远程服务器之间进行通信。amf将远程过程调用(rpc)编码为一个压缩的二进制表示,可以通过http/https或[rtmp/rtmps]协议(http://en.wikipedia.org/wiki/real_time_messaging_protocol)进行传输。对象和数据值被序列化为这种二进制格式,这将提高性能,允许应用程序加载数据的速度比基于文本的格式(如XML或SOAP)快10倍。
amf3是[actionscript]的默认序列化(http://dev.pyamf.org/wiki/actionscript)3.0,与amf0相比提供了各种优势,后者用于ActionScript1.0和2.0。amf3比amf0更有效地通过网络发送数据。AMF3支持将“int”和“uint”对象作为整数发送,并支持仅在ActionScript3.0中可用的数据类型,例如[ByteArray](http://dev.pyamf.org/wiki/ByteArray)、[ArrayCollection](http://dev.pyamf.org/wiki/ArrayCollection),[objectproxy](http://dev.pyamf.org/wiki/objectproxy)和[iexternalizable](http://dev.pyamf.org/wiki/iexternalizable)。
py3amf是[pyamf]的分支(https://github.com/hydralabs/pyamf)来支持python3
试图支持GitHub上正在开发的Py3的项目。
\35 35 35 35 35
state
pass'setup.py test`
>但是,没有测试适配器
如果您想快速完成此项目,请发送pr。
如果您想快速完成此项目,请发送pr。
安装
此项目已在ubuntututu16 10.12.4要安装,你可以在你的环境中使用pip3。
````
pip3安装py3amf
````
或者,你可以使用setup.py来开发。
`````
git clone git@github.com:stdcarrot/py3amf.git
cd py3amf
cd py3amf
python3 setup.py test
python3 setup.py install
`````
>
python3 setup.python3 setup.pytest
python3 setup.python3 setup.pyinstall
install和Pyamf一样,但是您必须考虑str和bytes类型。
``python
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=['用户id'])
req=remoting.request(target='用户服务',body=[消息])
ev=remoting.envelope(pyamf.amf3)
ev['/0']=req
rtmp
resp=requests.post('http://example.com/amf',
data=bin_msg.getvalue(),
headers={content-type':'application/x-amf'})
格式([AMF](http://en.wikipedia.org/wiki/action_message_format))支持与[Adobe Flash播放器](http://en.wikipedia.org/wiki/flash_player)兼容的[Python](http://en.wikipedia.org/wiki/flash_format)。它包括与python web框架的集成,比如[django](http://djangoproject.com)、[pylons](http://pylonshq.com)、[twisted](http://twistedmatrix.com)、[sqlalchemy](http://sqlalchemy.org)。[web2py](http://www.web2py.com)和[更多](http://pyamf.org/tutorials/index.html)。
[Adobe集成运行时](http://en.wikipedia.org/wiki/adobe-air)和[Adobe Flash播放器](http://en.wikipedia.org/wiki/flash-player)使用AMF在应用程序和远程服务器之间进行通信。amf将远程过程调用(rpc)编码为一个压缩的二进制表示,可以通过http/https或[rtmp/rtmps]协议(http://en.wikipedia.org/wiki/real_time_messaging_protocol)进行传输。对象和数据值被序列化为这种二进制格式,这将提高性能,允许应用程序加载数据的速度比基于文本的格式(如XML或SOAP)快10倍。
amf3是[actionscript]的默认序列化(http://dev.pyamf.org/wiki/actionscript)3.0,与amf0相比提供了各种优势,后者用于ActionScript1.0和2.0。amf3比amf0更有效地通过网络发送数据。AMF3支持将“int”和“uint”对象作为整数发送,并支持仅在ActionScript3.0中可用的数据类型,例如[ByteArray](http://dev.pyamf.org/wiki/ByteArray)、[ArrayCollection](http://dev.pyamf.org/wiki/ArrayCollection),[objectproxy](http://dev.pyamf.org/wiki/objectproxy)和[iexternalizable](http://dev.pyamf.org/wiki/iexternalizable)。