semvec/pypi-packages huggingface dataset:
kinesis-logger-streamhandler 0.0.8
AWS Kinesis logger streamhandler with AWS Session Management
Requires Python: >=3.7

# Kinesis Logger Stream Handler

This package contains 

AwsSessionManagement - handles AWS Session with AWS Temp credentials by Assuming a given Role
                       it renews the temp credentials when needed

AWS Kinesis Logger StreamHandler - a logging streamhandler which can send logs to AWS Kinesis


Usage:

```
def get_kinesis_client(aws_access_key_id, aws_secret_access_key, aws_session_token):
    logger.info("creating/updating kinesis client ...")
    kinesis = boto3.client('kinesis', region_name=get_region(),
                           aws_access_key_id = aws_access_key_id,
                           aws_secret_access_key = aws_secret_access_key,
                           aws_session_token = aws_session_token)
    logger.info("returning new kinesis client")
    return kinesis


logger = logging.getLogger("my-package")
logger.setLevel(logging.INFO)

kinesisAwsSessionManagement = AwsSessionManagement(role_arn='roleArnValue',
                                                   external_id='externalIdValue',
                                                    func=get_kinesis_client,
                                                    role_session_name="KinesisSession")

kinesis_stream_handler = KinesisDataStreamHandler(kinesis_stream_name, 'subsystem_value', 'component_value', 'action_value', 'project_name', 'env', 'version', kinesisAwsSessionManagement)

kinesis_stream_handler.setLevel(logLevel)
logger.addHandler(kinesis_stream_handler)

```

Now, every logging call will send the logs both to console and kinesis data stream with a given 'kinesis_stream_name'
cobblr 0.1.4
pyzmq broker and client handlers with name based addressing
Requires Python: >=3.9

# cobblr

This is a package for simple client-broker and client-client communications 
using the [ZeroMQ](https://zeromq.org/) package for python.

It is designed for M2M communications and easy passing of data between
software modules. Each client program runs asynchronously in a single 
new background thread. Clients are addressed with a unique name and once
registered with a broker can request new communications.

This package was built as part of the [Digital Manufacturing on a Shoestring 
Project](https://www.digitalshoestring.net/).

This library is in development. 

Please check back soon!

## API

    from cobblr.cobblr import CobblrBroker
    cb = CobblrBroker

Create and start a broker

    from cobblr.cobblr import CobblrClient
    cl = CobblrClient("cl_test")

Create and start a client named `cl_test`

    cl.register()

Register client `cl_test` with the running broker

    from cobblr.cobblr import CobblrClient
    cr = CobblrClient("cr_test")
    cr.register()

Create, start and register client `cr_test`

    cl.request_connection("cr_test")

Request a connection to client `cr_test` from client `cl_test`

    connection_list = cl.get_connected()

Populates `connection_list` with names of connected clients and broker. 
The broker is always named `service`.

    cl.send_message("cr_test",["string_1", "string_2"])

Sends a message from client `cl_test` to client `cr_test`, consisting of two 
strings.

    msg = ["no_msg"]
    while msg == ["no_msg"]:
        msg = cr.get_messages()
    print(msg)

Loop to read message inbox on client `cr_test`. Messages will be returned
as a list, with each entry a list of `[<message number>, <from address>, 
<message contents>]`.

The inbox is cleared on reading.

    cr.end

Ends client `cr_test`.

**API for pub-sub to be added soon**

## Features List

- [x] Client name registration at broker
- [x] Single IP space
- [ ] Multiple IP and Network support
- [x] Request a connection to another named client
- [x] Request - Response messaging pattern between named clients
- [x] Publish - Subscribe messaging pattern
- [x] Simple state machine with task prioritisation
- [x] Asynchronous background operation
- [ ] Smooth shutdown and restart
- [x] Heartbeat for network status and awareness
- [ ] Backup broker
- [ ] Network configuration save and load
- [ ] Message encryption
optimization-lib 2.0.0
Measures program speed
Requires Python: >=3.6

# Optimization Library 

The optimization library measures the general speed of a program based on the last run. \
This library can be used by developers to speed up their programs.

![alt text](https://media1.giphy.com/media/YHYmMLkOmqoo/giphy.webp?cid=ecf05e47v65rqtldq6gxecdovfuuw6sw99cg7jccb7ityvrw&rid=giphy.webp&ct=g)

## Example Usage:
First, import the library:

    from optimization import optimization

Next, the library needs to be initialized:

    opt = optimization.OptimizationLibrary()

Finally, we can start and stop the timer:
    
    opt.start_timer()
    '''
    implement function/program to meausure 
    '''
    opt.end_timer()

![alt text](https://media4.giphy.com/media/14gmG4WWSdTsQw/giphy.gif?cid=ecf05e47f4l2ri2tuzoey6jffnirrrbhr2w1do87lqbhqokk&rid=giphy.gif&ct=g
)



## Example File 
    
    from optimization import optimization

    def function_to_optiimize()
        pass

    def test():
        opt = optimization.OptimizationLibrary() 
        opt.start_timer()
        function_to_optiimize()
        opt.end_timer()
    if __name__ == '__main__':
        test()


### Additional Notes: 

This is a developer tool. \
The library has a small performance window (to account for natural program variance). \
This is an optional parameter that can be changed with the 'variance' optional parameter.\
The library can also be initialized with an optional parameter to show performance increases/decreases visually. This can be changed with the 'color' parameter:        

    opt = optimization.OptimizationLibrary(variance=2.5, color=True) 

![alt text](https://media2.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif?cid=ecf05e47lzn1ze8ms6at1sw32xif96a59yx346ngz8z6wlxr&rid=giphy.gif&ct=g
)