Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mercadona/rele
Easy to use Google Pub/Sub
https://github.com/mercadona/rele
event-driven google-cloud hacktoberfest pubsub python
Last synced: 3 months ago
JSON representation
Easy to use Google Pub/Sub
- Host: GitHub
- URL: https://github.com/mercadona/rele
- Owner: mercadona
- License: apache-2.0
- Created: 2019-05-09T10:51:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T12:41:47.000Z (8 months ago)
- Last Synced: 2024-05-22T13:15:38.058Z (8 months ago)
- Topics: event-driven, google-cloud, hacktoberfest, pubsub, python
- Language: Python
- Homepage: https://mercadonarele.readthedocs.io/en/latest/index.html
- Size: 441 KB
- Stars: 199
- Watchers: 33
- Forks: 24
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Authors: AUTHORS.md
Awesome Lists containing this project
README
Relé makes integration with Google PubSub straightforward and easy.
## Motivation and Features
The [Publish-Subscribe pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern)
and specifically the Google Cloud [Pub/Sub library](https://pypi.org/project/google-cloud-pubsub/)
are very powerful tools but you can easily cut your fingers on it. Relé makes integration
seamless by providing Publisher, Subscriber and Worker classes with the following features:* Powerful Publishing API
* Highly Scalable Worker
* Intuitive Subscription Management
* Easily Extensible Middleware
* Ready to go Django/Flask integration
* CLI
* And much more!## What it looks like
```python
# Publish to the topic
import relerele.publish(topic='photo-uploaded', data={'customer_id': 123})
# Subscribe to the Pub/Sub topic
from rele import sub@sub(topic='photo-uploaded')
def photo_uploaded(data, **kwargs):
print(f"Customer {data['customer_id']} has uploaded an image")
```## What's in the name
"Relé" is Spanish for *relay*, a technology that
[has played a key role](https://technicshistory.wordpress.com/2017/01/29/the-relay/) in
history in the evolution of communication and electrical technology, including the telegraph,
telephone, electricity transmission, and transistors.## Install
Relé supports Python 3.6+ and installing via ``pip``
`pip install rele`
or with Django integration
`pip install rele[django]`
or with Flask integration
`pip install rele[flask]`
## Quickstart
[Please see our documentation to get started.](https://mercadonarele.readthedocs.io/en/latest/guides/basics.html)
You can also read more about it [here](https://medium.com/mercadona-tech/announcing-rel%C3%A9-c2d0540af3b9)
----
## Running Tests
Does the code actually work?
make test