Skip to main content

Message Mediator.

Project description

sirji-messages

sirji-messages is a Python package.

Installation

Install sirji-messages quickly with pip:

pip install sirji-messages

Usages

Message Parser

from sirji_messages import message_parse

message_str ="""```
FROM: CODER
TO: USER
ACTION: INFORM
DETAILS: Some information.
```"""

message = message_parse(message_str)

Custom Exceptions

# message_parser can throw exceptions of following types.
from sirji_messages import MessageParsingError, MessageValidationError

Action Enum

from sirji_messages import ActionEnum

# We can use either '.' or '[]' to get the enum
action1 = ActionEnum.ACKNOWLEDGE
action2 = ActionEnum['ACKNOWLEDGE']

Agent Enum

from sirji_messages import AgentEnum

# We can use either '.' or '[]' to get the enum
agent1 = AgentEnum.CODER
agent2 = AgentEnum['CODER']

Message Factory

from sirji_messages import MessageFactory, ActionEnum
message_class = MessageFactory[ActionEnum.ACKNOWLEDGE.name]

License

sirji-messages is made available under the MIT License. See the included LICENSE file for more details.

Project details


Download files

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

Source Distribution

sirji-messages-0.0.1.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

sirji_messages-0.0.1-py3-none-any.whl (25.4 kB view hashes)

Uploaded Python 3

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