Metadata-Version: 2.1
Name: events-protocol
Version: 0.0.1
Summary: Library to be a Client and Server using event protocol
Home-page: https://github.com/GuiaBolso/events-protocol-python
Author: Guiabolso
License: Apache-2.0
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: certifi (==2019.11.28)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: dataclasses-json (==0.3.7)
Requires-Dist: idna (==2.8)
Requires-Dist: marshmallow (==3.3.0)
Requires-Dist: marshmallow-enum (==1.5.1)
Requires-Dist: mypy-extensions (==0.4.3)
Requires-Dist: requests (==2.22.0)
Requires-Dist: stringcase (==1.2.0)
Requires-Dist: typing-extensions (==3.7.4.1)
Requires-Dist: typing-inspect (==0.5.0)
Requires-Dist: urllib3 (==1.25.8)

<h1 align="center">events-protocol</h1>
<p align="center">
    <a href="https://github.com/GuiaBolso/events-protocol-python/actions"><img alt="Actions Status" src="https://github.com/GuiaBolso/events-protocol-python/workflows/Black%20Check%20and%20Tests/badge.svg?branch=master"></a>
    <a href="https://github.com/GuiaBolso/events-protocol-python/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
    <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

### Como usar

#### Client

As informações essenciais para enviar o evento são: *url*, *name*, *version* e *payload*.

Apenas com estas informações já é possivel enviar um evento.

```pyt
from events_protocol.client import EventClient

# Instancia o client
client = EventClient(url="http://example.com/events/")

# Exemplo passando apenas as informações essenciais
response = client.send_event(
	name="event:example",
	version=1,
	payload={
		"example": "example"
	},
)

# Exemplo passando todas as informações
response = client.send_event(
	name="event:example",
	version=1,
	id="9230c47c-3bcf-11ea-b77f-2e728ce88125",
	flow_id="a47830ca-3bcf-11ea-a232-2e728ce88125",
	payload={
		"example": "example"
	},
	identity={
		"userId": "USER_ID",
	},
	metadata={
		"date": "00-00-0000",
	},
	timeout=1000,
)
```



