Project Icon

spyne

灵活构建分布式系统的Python框架

Spyne是一个基于Python的分布式系统构建框架,严格遵循MVC模式。它实现了常用的传输、协议和接口文档标准,提供了可扩展的API。Spyne支持多种协议和传输方式,方便开发者快速构建分布式服务。框架兼容Python 2.7和3.6+版本,可与lxml、SQLAlchemy等多个常用库集成使用。Spyne适用于构建Web服务、RPC系统和微服务架构,能够简化分布式应用的开发流程,提高开发效率。

If you like and use Spyne, star it on Github <https://github.com/arskom/spyne>_!

About

Spyne aims to save the protocol implementers the hassle of implementing their own remote procedure call api and the application programmers the hassle of jumping through hoops just to expose their services using multiple protocols and transports.

In other words, Spyne is a framework for building distributed solutions that strictly follow the MVC pattern, where Model = spyne.model, View = spyne.protocol and Controller = user code.

Spyne comes with the implementations of popular transport, protocol and interface document standards along with a well-defined API that lets you build on existing functionality.

The following are the primary sources of information about spyne:

Requirements

Spyne source distribution is a collection of highly decoupled components, which makes it a bit difficult to put a simple list of requirements, as literally everything except pytz is optional.

Python version

Spyne 2.13 supports Python 2.7, 3.6, 3.7, 3.8, 3.9 and 3.10.

Libraries

Additionally the following software packages are needed for various subsystems of Spyne:

  • A Wsgi server of your choice is needed to wrap spyne.server.wsgi.WsgiApplication
  • lxml>=3.2.5 <http://lxml.de>_ is needed for any xml-related protocol.
  • lxml>=3.4.1 <http://lxml.de>_ is needed for any html-related protocol.
  • SQLAlchemy <http://sqlalchemy.org>_ is needed for spyne.model.complex.TTableModel.
  • pyzmq <https://github.com/zeromq/pyzmq>_ is needed for spyne.client.zeromq.ZeroMQClient and spyne.server.zeromq.ZeroMQServer.
  • Werkzeug <http://werkzeug.pocoo.org/>_ is needed for using spyne.protocol.http.HttpRpc under a wsgi transport.
  • PyParsing <http://pypi.python.org/pypi/pyparsing>_ is needed for using HttpPattern's with spyne.protocol.http.HttpRpc.
  • Twisted <http://twistedmatrix.com/>_ is needed for anything in spyne.server.twisted and spyne.client.twisted.
  • Django <http://djangoproject.com/>_ (tested with 1.8 and up) is needed for anything in spyne.server.django.
  • Pyramid <http://pylonsproject.org/>_ is needed for spyne.server.pyramid.PyramidApplication.
  • msgpack>=1.0.0 <http://github.com/msgpack/msgpack-python/>_ is needed for spyne.protocol.msgpack.
  • PyYaml <https://bitbucket.org/xi/pyyaml>_ is needed for spyne.protocol.yaml.
  • simplejson <http://github.com/simplejson/simplejson>_ is used when found for spyne.protocol.json.

You are advised to add these as requirements to your own projects, as these are only optional dependencies of Spyne, thus not handled in its setup script.

Installing

You first need to have package manager (pip, easy_install) installed. Spyne ships with a setuptools bootstrapper, so if setup.py refuses to run because it can't find setuptools, do:

bin/distribute_setup.py

You can add append --user to get it installed with $HOME/.local as prefix.

You can get spyne via pypi: ::

easy_install [--user] spyne

or you can clone the latest master tree from Github: ::

git clone git://github.com/arskom/spyne.git

To install from source distribution, you can run the setup script as usual: ::

python setup.py install [--user]

If you want to make any changes to the Spyne code, just use ::

python setup.py develop [--user]

so that you can painlessly test your patches.

Finally, to run the tests, you need to first install every single library that Spyne integrates with, along with additional packages like pytest or tox that are only needed when running Spyne testsuite. An up-to-date list is maintained in the requirements/ directory, in separate files for both Python 2.7 and >=3.6. To install everything, run: ::

pip install [--user] -r requirements/test_requirements.txt

If you are still stuck on Python 2.x however, you should use: ::

pip install [--user] -r requirements/test_requirements_py27.txt

Assuming all dependencies are installed without any issues, the following command will run the whole test suite: ::

python setup.py test

Spyne's test harness has evolved a lot in the 10+ years the project has been active. It has 3 main stages: Traditional unit tests, tests that perform end-to-end testing by starting actual daemons that listen on real TCP sockets on hard-coded ports, and finally Django tests that are managed by tox. Naively running pytest etc in the root directory will fail as their auto-discovery mechanism was not implemented with Spyne's requirements in mind.

Getting Support

Official support channels are as follows:

  • The official mailing list for both users and developers alike can be found at: http://lists.spyne.io/listinfo/people.

  • You can use the 'spyne' tag to ask questions on Stack Overflow <https://stackoverflow.com/questions/tagged/spyne>_.

  • You can also use the forum <https://github.com/arskom/spyne/discussions>_ on the project's github page.

Please don't use the issue tracker for asking questions. It's a database that holds the most important information for the project, so we must avoid cluttering it as much as possible.

Contributing

If you feel like helping out, see the CONTRIBUTING.rst file in the Spyne source distribution for starting points and general guidelines.

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号