Skip to main content

A Python library for writing (micro)services and their clients

Project description

https://readthedocs.org/projects/pysoa/badge/ https://pepy.tech/badge/pysoa https://img.shields.io/pypi/l/pysoa.svg https://api.travis-ci.org/eventbrite/pysoa.svg https://img.shields.io/pypi/v/pysoa.svg https://img.shields.io/pypi/wheel/pysoa.svg https://img.shields.io/pypi/pyversions/pysoa.svg

PySOA is a general-purpose library for writing fast Python (micro)services and their clients, based on an RPC (remote procedure call) calling style. It provides both a client and a server, which can be used directly by themselves or, as we do, extended with extra functionality (our authentication, database routing, and other code is written as private middleware and runs on top of this library).

PySOA uses the concept of pluggable “transports” to define a layer for sending requests and responses (messages) between clients and servers. The default, production-ready included transport is a Redis pub-sub layer, which we use in combination with Redis Sentinel in clusters. A single Redis cluster is capable of handling tens of thousands of PySOA messages per second with extremely efficient and desirable load-balancing properties. There is also a local transport implementation primarily used for testing and demonstration but capable of being used in production where appropriate.

Basic Tenets

  • Services and actions both have simple names, and are called from the client by name. You can call actions individually, or bundle multiple action calls into a “job” to be run serially (either aborting or continuing on error).

  • Requests and responses are simply Python dictionaries, and PySOA uses our open source validation framework Conformity in order to verify their schema on the way in and out.

  • Message bodies are encoded using MessagePack by default (however, you can define your own serializer), with a few non-standard types encoded using MessagePack extensions, such as dates, times, date-times, and amounts of currency (using our open source currint library).

  • Requests have a context, which is sourced from the original client context (web request, API request, etc.) and automatically chained down into subsequent client calls made inside the service. This is used for contextual request information like correlation IDs, authentication tokens, locales, etc.

  • We include “SOA Switches” as a first-party implementation of feature flags/toggles. Part of the context, they are bundled along with every request and automatically chained, and are packed as integers to ensure they have minimal overhead.

This intro summarizes some of the key concepts of using PySOA. For more thorough documentation, see the PySOA Documentation.

License

PySOA is licensed under the Apache License, version 2.0.

Installation

PySOA is available in PyPi and can be installing directly via Pip or listed in setup.py, requirements.txt, or Pipfile:

pip install 'pysoa~=1.2'
install_requires=[
    ...
    'pysoa~=1.2',
    ...
]
pysoa~=1.2
pysoa = {version="~=1.2"}

Documentation

The complete PySOA documentation is available on Read the Docs!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysoa-1.4.2.tar.gz (157.5 kB view details)

Uploaded Source

Built Distribution

pysoa-1.4.2-py27.py35.py36.py37.py38-none-any.whl (194.6 kB view details)

Uploaded Python 2.7 Python 3.5 Python 3.6 Python 3.7 Python 3.8

File details

Details for the file pysoa-1.4.2.tar.gz.

File metadata

  • Download URL: pysoa-1.4.2.tar.gz
  • Upload date:
  • Size: 157.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.1

File hashes

Hashes for pysoa-1.4.2.tar.gz
Algorithm Hash digest
SHA256 8e5c6db4fd573e0997155a3e2cd2c82c7ef0ae216fe53dba2da2dbf66e56f56f
MD5 335f817ae31a3c8209c4e3b7a00d6496
BLAKE2b-256 eaeff3a22201208498e4626eb5f8c853b14eb1348cc16cd86b4d35fd6dbd0533

See more details on using hashes here.

File details

Details for the file pysoa-1.4.2-py27.py35.py36.py37.py38-none-any.whl.

File metadata

  • Download URL: pysoa-1.4.2-py27.py35.py36.py37.py38-none-any.whl
  • Upload date:
  • Size: 194.6 kB
  • Tags: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.1

File hashes

Hashes for pysoa-1.4.2-py27.py35.py36.py37.py38-none-any.whl
Algorithm Hash digest
SHA256 09b2a0f8236a547225eb28223b1cfaf92b4a8a58d846c2cee9fd3792ed9f155e
MD5 799948ccd9fb4dc5f3b7f4596e03b917
BLAKE2b-256 3519d9f7664c1caf635ca370b963dfda247d68b4e87673660aac4b78dd3ca989

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page