semvec/pypi-packages huggingface dataset:
pigeonapi-python-client 0.13
Python package containing several classes and data for extracting and manipulating market and trading data.
Requires Python: >=3.7

# Pigeon

Pigeon is a Python library to get Brazilian Financial Market Data.

## Installation

```bash
pip3 install pigeonapi-python-client
```

## Example - WebSocket Books
```python
import pigeon
ws = pigeon.WebSocketClient(api_key='YOUR_API_KEY', ws_type='books', instruments=['PETR4', 'VALE3'])
ws.run(on_message=lambda message: print(message))
```
## Example - WebSocket Trades Delayed
```python
import pigeon
ws = pigeon.WebSocketClient(api_key='YOUR_API_KEY', ws_type='trades', target='delayed', instruments=['PETR4', 'VALE3'])
ws.run(on_message=lambda message: print(message))
```

## Example - IntradayCandles
```python
import pigeon
int_candles = pigeon.IntradayCandles(api_key='YOUR_API_KEY')
int_candles.get_intraday_candles(market_type='stocks', tickers=['PETR4', 'VALE3'], candle_period='1m', mode='relative', raw_data=True)
```
## Example - Plot HistoricalCandles
```python
import pigeon
hist_candles = pigeon.HistoricalCandles(api_key='YOUR_API_KEY')
hist_candles.get_historical_candles(ticker='PETR4', lookback='5D', mode='absolute').plot(x='date', y='close_price', kind='scatter')
```
## Documentation
The official documentation is hosted at https://python-client-docs.pigeonapi.io/
pylambdic 1.0.0
Validate input and output for AWS Lambda handlers using Pydantic
Requires Python: >=3.7

# pylambdic

pylambdic is a Python package that simplifies the process of validating input and output for AWS Lambda handlers using Pydantic. It automatically validates the input and output types of your Lambda function using Pydantic models, making it easier to ensure your function is working with the correct data.

## Features

- Automatic input and output validation using Pydantic models.
- Simplified error handling for invalid input and output data.
- Support for AWS Lambda context object.
- Easy integration with existing AWS Lambda functions.

## Installation

Install pylambdic using pip:

```bash
pip install pylambdic
```

## Usage

To use pylambdic, simply import the `handler` decorator and apply it to your AWS Lambda function. You should also define your input and output types using Pydantic models.

Here's an example of how to use pylambdic:

```python
from pydantic import BaseModel
import pylambdic

class InputModel(BaseModel):
    name: str
    age: int

class OutputModel(BaseModel):
    message: str

@pylambdic.handler
def my_lambda_handler(input_data: InputModel) -> OutputModel:
    return OutputModel(message=f"Hello {input_data.name}, you are {input_data.age} years old.")
```

In this example, the `my_lambda_handler` function expects an input event with `name` and `age` fields, and returns a response with a `message` field. pylambdic will automatically validate the input and output data against the `InputModel` and `OutputModel` Pydantic models.

If the input data is invalid, the Lambda function will return a 400 status code with a descriptive error message. If the output data is invalid, it will return a 500 status code with a descriptive error message.

You can also use the context object provided by AWS as follows:

```python

from pydantic import BaseModel
import pylambdic

class InputModel(BaseModel):
    name: str
    age: int

class OutputModel(BaseModel):
    message: str
    request_id: str

@pylambdic.handler
def my_lambda_handler(input_data: InputModel, context) -> OutputModel:
    message = f"Hello {input_data.name}, you are {input_data.age} years old."
    request_id = context.aws_request_id
    return OutputModel(message=message, request_id=request_id)
```


## Contributing

Contributions are welcome! Please feel free to submit issues and pull requests for consideration.