simple-pyms: Python Microservices Without The Headaches
Simple PyMS (SPMS) provides base class abstractions for a very simple microservice architecture. Currently SPMS provides a baseline component that sends heartbeats and a monitor component that tracks microservices and their statuses based on these heartbeats.
The WAMP protocol is used to handle message brokering and RPC. So, to use PyMS you will need a WAMP router such as crossbar.io.
What Does It Do?
SPMS makes creating microservices (WAMP Components) and monitoring them easy. There are two components to deal with - Monitor and Microservice. Monitor monitors Service instances.
So, create a single Monitor instance and one or more Microservice instances. Connect them to the router and you have a poor man's microservice architecture.
Configuring Your Wamp Router
To configure your wamp router, you will need to setup roles for your components.
Each microservice component will need to have permissions setup properly for
the microservice uri: py.ms.*
permissions:
# Microservice activities
- uri: py.ms
match: prefix
allow:
call: true
register: true
publish: true
subscribe: true
Creating A Simple Component
from simplepyms.microservice import mk_component
from autobahn.twisted.component import run
component = mk_component('component-name', 'ws://localhost:8080/ws', 'realm')
run(component)
The code above creates a component that has stop, restart and heartbeat notification built in. Add functionality to make your component more meaningful.
from simplepyms.microservice import mk_component
from autobahn.twisted.component import run
component = mk_component('component-name', 'ws://localhost:8080/ws', 'realm')
@component.register('py.ms.add')
def add(a, b):
return a + b
run(component)
Metadata
Release files for simple-pyms 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| simple-pyms-0.2.0.tar.gz | 5.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_pyms-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / simple-pyms-0.2.0.tar.gz
| Download URL | simple-pyms-0.2.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d9a3dce9c03a20bf7536b6885f99de8721c610cb79f34c702a9e55e394f5284
|
|
BLAKE2b-256 checksum How to use checksums |
064e7c62c849aece75fb9f6973cdfe4f40762818d541bd84a5b1438c2fb5ff6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Release files / simple_pyms-0.2.0-py3-none-any.whl
| Download URL | simple_pyms-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bdc6853f085d8268dec8a6d4eb2689e947b60f54da0bf3374c76f2e0c12f1d8
|
|
BLAKE2b-256 checksum How to use checksums |
525d95258a7bd5005e717d3334c3aaf9d56d2e4f6094062d8859e8e57b11943f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Security for simple-pyms 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.