# Transactional Ruler
Lib to post user events on transactional topics
## Running tests and lint
`docker-compose up integration-tests`
`docker-compose up lint`
## Installation
`pip install jsm-transactional-ruler`
## Example Usage
```python
from jsm_transactional_ruler.enums import EventType
from jsm_transactional_ruler.events import Event
from jsm_transactional_ruler.publisher import publish_event
event = Event(
user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event)
```
The attribute `event_type` accepts only events registered in the `EventType` enum.
The `publish_event` method accepts the optional `queue` and `publisher_parameters` parameters to send to django-stomp:
```python
event = Event(
user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event, queue="/topic/VirtualTopic.user-update-transactions", persistent=False)
```
## Versioning
This lib follows the [pypi version format](https://www.python.org/dev/peps/pep-0440/) with the convention of using
_major_._minor_._patch_ version.
### When to bump a patch version?
Bump the patch version if you are doing a quick fix, nothing that changes the library functionality.
### When to bump the minor version?
Bump the minor version if you are adding new functionality without breaking backwards compatibility. For example,
adding support to new events.
### When to bump the major version?
Bump the major version if you are breaking backwards compatibility by adding new functionality or refactoring.
## Contributing
This project uses a [trunk based development](https://trunkbaseddevelopment.com/) flow, so that we have only one long-lived branch (`master`).
For any development, simply create a branch from it and follow the flow described [below](#how-to-upload-lib-to-pypi).
## How to upload lib to PyPI
It is necessary to update the lib version using the command below:
```shell
$ poetry version major|minor|patch
```
After generating the version:
* Create a new branch with the files updated by Poetry
* Open PR based on the `master` branch
* Merge PR into the master
* Generate a new release based on the version. [Document to generate release](https://docs.github.com/en/enterprise/2.13/user/articles/creating-releases)
* After generating the new release "Github Actions" will upload the lib to PyPI using Poetry.
* Good job!
Raw data
{
"_id": null,
"home_page": "https://juntossomosmais.com.br",
"name": "jsm-transactional-ruler",
"maintainer": "Juntos Somos Mais",
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": "labs@juntossomosmais.com.br",
"keywords": null,
"author": "Juntos Somos Mais",
"author_email": "labs@juntossomosmais.com.br",
"download_url": "https://files.pythonhosted.org/packages/c8/b2/22115effa114cbb78ef51da7b4640bb508d1659a55b878102b1cef1b68f8/jsm_transactional_ruler-3.0.0.tar.gz",
"platform": null,
"description": "# Transactional Ruler\n\nLib to post user events on transactional topics\n\n## Running tests and lint\n\n`docker-compose up integration-tests`\n`docker-compose up lint`\n\n## Installation\n\n`pip install jsm-transactional-ruler`\n\n## Example Usage\n\n```python\nfrom jsm_transactional_ruler.enums import EventType\nfrom jsm_transactional_ruler.events import Event\nfrom jsm_transactional_ruler.publisher import publish_event\n\nevent = Event(\n user_id=\"fake_id\", event_type=EventType.T_EVENT_REGISTERED_USER, data={\"email\": \"teste@juntossomosmais.com.br\"}\n)\npublish_event(event_trigger=event)\n```\n\nThe attribute `event_type` accepts only events registered in the `EventType` enum.\n\nThe `publish_event` method accepts the optional `queue` and `publisher_parameters` parameters to send to django-stomp:\n\n\n```python\nevent = Event(\n user_id=\"fake_id\", event_type=EventType.T_EVENT_REGISTERED_USER, data={\"email\": \"teste@juntossomosmais.com.br\"}\n)\npublish_event(event_trigger=event, queue=\"/topic/VirtualTopic.user-update-transactions\", persistent=False)\n```\n\n## Versioning\nThis lib follows the [pypi version format](https://www.python.org/dev/peps/pep-0440/) with the convention of using\n_major_._minor_._patch_ version.\n\n### When to bump a patch version?\nBump the patch version if you are doing a quick fix, nothing that changes the library functionality.\n\n### When to bump the minor version?\nBump the minor version if you are adding new functionality without breaking backwards compatibility. For example,\nadding support to new events.\n\n### When to bump the major version?\nBump the major version if you are breaking backwards compatibility by adding new functionality or refactoring.\n\n## Contributing\n\nThis project uses a [trunk based development](https://trunkbaseddevelopment.com/) flow, so that we have only one long-lived branch (`master`).\n\nFor any development, simply create a branch from it and follow the flow described [below](#how-to-upload-lib-to-pypi).\n\n## How to upload lib to PyPI\n\nIt is necessary to update the lib version using the command below:\n\n```shell\n$ poetry version major|minor|patch\n```\n\nAfter generating the version:\n* Create a new branch with the files updated by Poetry\n* Open PR based on the `master` branch\n* Merge PR into the master\n* Generate a new release based on the version. [Document to generate release](https://docs.github.com/en/enterprise/2.13/user/articles/creating-releases)\n* After generating the new release \"Github Actions\" will upload the lib to PyPI using Poetry.\n* Good job!\n",
"bugtrack_url": null,
"license": null,
"summary": "Lib to post user events on transactional topics",
"version": "3.0.0",
"project_urls": {
"Homepage": "https://juntossomosmais.com.br",
"Repository": "https://github.com/juntossomosmais/transactional-ruler"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4ae5cbe8cb2a26f965512fbc68492a370a9949b6c08a62e092a625d1e14fcffe",
"md5": "1199cfee300d2d8ea00b5f2f775b014e",
"sha256": "6508b126099237066053c0a56499ee43d15b27ebacd0677f3557d6d3f4e2e661"
},
"downloads": -1,
"filename": "jsm_transactional_ruler-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1199cfee300d2d8ea00b5f2f775b014e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 4982,
"upload_time": "2024-10-08T20:43:35",
"upload_time_iso_8601": "2024-10-08T20:43:35.507406Z",
"url": "https://files.pythonhosted.org/packages/4a/e5/cbe8cb2a26f965512fbc68492a370a9949b6c08a62e092a625d1e14fcffe/jsm_transactional_ruler-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c8b222115effa114cbb78ef51da7b4640bb508d1659a55b878102b1cef1b68f8",
"md5": "b0c00c8f48a3f5f1b53b572a522f83f6",
"sha256": "e15f8e70696b6bbde2fb09e9a626710e63fa4fc0582ff2df9bc276efe3496677"
},
"downloads": -1,
"filename": "jsm_transactional_ruler-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b0c00c8f48a3f5f1b53b572a522f83f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 4075,
"upload_time": "2024-10-08T20:43:37",
"upload_time_iso_8601": "2024-10-08T20:43:37.492027Z",
"url": "https://files.pythonhosted.org/packages/c8/b2/22115effa114cbb78ef51da7b4640bb508d1659a55b878102b1cef1b68f8/jsm_transactional_ruler-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 20:43:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "juntossomosmais",
"github_project": "transactional-ruler",
"github_not_found": true,
"lcname": "jsm-transactional-ruler"
}