semvec/pypi-packages huggingface dataset:
tupas-verisigner 0.0.1
TUPAS URL verification and signing
License: MIT
Requires Python: >=3.5

[![Build Status](https://api.travis-ci.org/adarshk7/tupas_verisigner.png)](https://api.travis-ci.org/adarshk7/tupas_verisigner)

# TUPAS Verisigner

## Introduction

This package can be used to:

* Receive a TUPAS request URL and parse it.
* Calculate the signature using a shared input secret and query params.
* Compare it to the signature in the URL.
* And, generate a response URL with new signature based on an shared output secret.


## Usage

```
from tupas_versigner import TupasVerisigner

signer = TupasVerisigner(
    input_secret,            # Shared input secret.
    output_secret,           # Shared output secret.
    base_output_url,         # Base URL for the response.
    error_url                # Error URL to return if signature verification fails.
    encoding='Windows-1252'  # Optional, default: 'Windows-1252'
)

signer.verify_and_sign_url(url)
```

For example,

```
from tupas_versigner import TupasVerisigner

signer = TupasVerisigner(
    'inputsecret',
    'outputsecret'
    'http://otherserver.com',
    'http://otherserver.com/error.html'
)

url = (
    'http://someserver.com/?B02K_VERS=0003&B02K_TIMESTMP=50020181017141433899056&'
    'B02K_IDNBR=2512408990&B02K_STAMP=20010125140015123456&B02K_CUSTNAME=FIRST%20'
    'LAST&B02K_KEYVERS=0001&B02K_ALG=03&B02K_CUSTID=9984&B02K_CUSTTYPE=02&B02K_MA'
    'C=EBA959A76B87AE8996849E7C0C08D4AC44B053183BE12C0DAC2AD0C86F9F2542'
)

signer.verify_and_sign_url(url)
```

> http://otherserver.com/?firstname=First&lastname=Last&hash= 4f6536ca2a23592d9037a4707bb44980b9bd2d4250fc1c833812068ccb000712


## Tests

`pip install -r requirements.txt`


### Unit tests

`pytest`


### Linting

`flake8 .`
`isort --recursive --diff . && isort --recursive --check-only .`
pysherasync 0.2
Asyncio Pusher Channels Client
License: MIT
Keywords: pusher websocket client

PysherAsync 
=============

`pysherasync` is a python module for handling Pusher Channels. It is based on @ekulyk's `PythonPusherClient` and @nlsdfnbch  `Pysher`. This is a re-implementation of the project
to use more efficient asynchronous logic and more efficient websockets. A key difference is the dropped support for pre-3.5 Python versions. 

This is also currently a very minimalistic implementation and may be missing some components, please submit an issue and let me know if you run into any problems. 

Installation
------------

Simply clone the project and run `python setup.py install` - or install via pip `pip install pysherasync`.

This module depends on websockets module available from: <https://github.com/aaugustin/websockets>

Example
-------

Example of using this pusher client to consume websockets:

```python
import pysherasync

async def bitstamp_ob_subscription(loop):
    global loop 
    # This is your app key, currently set to https://www.bitstamp.net/websocket/ 
    appkey = "de504dc5763aeef9ff52"
    # Create an instance of PusherAsyncClient and pass it the appkey 
    pusherclient = pysherasync.PusherAsyncClient(appkey)
    # Connect to websocket 
    pushersocket = await pusherclient.connect()
    # Subscribe to channel 
    status = await pusherclient.subscribe(channel_name='order_book')
    print("Subscription Status: %s"%(status))
    while True:
        ## This is because re-connection logic is not implemented yet
        if not pushersocket.open:
            # on disconnections, reconnect
            print("Connection reconnecting")
            # re-connect
            pushersocket = await pusherclient.connect()
            # re-subscribe 
            status = await pusherclient.subscribe(channel_name='order_book')
            print("Subscription Status: %s"%(status))
        try:
            # wait for msg
            msg = await asyncio.wait_for(pushersocket.recv(), 5)
            # parse to json 
            msg = json.loads(msg)
            # print the msg 
            if msg:
                print(msg)        
        except asyncio.TimeoutError:
            print("asyncio timeout while waiting for ws msg")
        except Exception as e:
            print(e)

 if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(bitstamp_ob_subscription(loop))
    loop.close()
```

Performance
------
PysherAsync relies on websockets which is one of the most efficient implementations on python.

Thanks
------
A big thanks to @ekulyk for developing the [PythonPusherClient](https://github.com/ekulyk/PythonPusherClient) library.

A big thanks to @nlsdfnbch for developing the [Pysher](https://github.com/nlsdfnbch/Pysher) library.

A big thanks to @aaugustin for developing the [WebSockets](https://github.com/aaugustin/websockets) library.


Copyright
---------

MTI License - See LICENSE for details.

Changelog
---------
## Version 0.2
### Fix
 - Bug fix for disconnect, added missing await  
## Version 0.1
### New
 - First Working Version
monki 0.1.1
Patch functions at runtime, the easy way.
License: MIT
Keywords: monkey patching utility programming development

# Monki

Patch functions at runtime, the easy way.

## Installation

    pip install monki

## Basic usage

We want to patch the following function:

    def func():
        print('First')   # line 0
        print('Second')  # line 1
        print('Third')   # line 2

Different ways to patch it:

    import monki

    # Add code at beginning or end

    monki.patch(func, start="print('Starting')", end="print('Ending')")
    func()
        >>> 'Starting'
        >>> 'First'
        >>> 'Second'
        >>> 'Third'
        >>> 'Ending'

    # Insert lines at any offset

    monki.patch(func, insert_lines={1: "print('Injected line')", 2: "print('Another injection')"})
    func()
        >>> 'First'
        >>> 'Injected line'
        >>> 'Second'
        >>> 'Another injection'
        >>> 'Third'

    # Let's patch a loop inside the function!
    # To do so we need to insert the loop and indent a line to go inside it.

    monki.patch(func, insert_lines={1: "for i in range(3):"}, indent_lines=[1])
    func()
        >>> 'First'
        >>> 'Second'
        >>> 'Second'
        >>> 'Second'
        >>> 'Third'

## Limitations

* Currently you cannot patch the same function twice
* Some edge cases will not work with closure functions
* Will probably only work on CPython 3+. Currently only tested on CPython 3.7
dxl-py 0.1
Dynamixel SDK Python Wrapper
License: MIT

# dxl_py
Simple python wrapper over the [Dynamixel API](https://github.com/ROBOTIS-GIT/DynamixelSDK).
Allows commanding and receiving positions for an arbitrary number of servos.
### Use

Create a config dictionary with one entry per servo:
```
MY_SERVOS_CONFIG = {
    'test_servo': {
        'id': 1,  # Servo ID
        'model': 'mx',  # Servo model tag, one of 'MX' or 'PRO'
        'min': 0, # Minimum position (MX servos go from 0 to 4095)
        'max': 4095, # Maximum position
    },
    ...
}
```
Create the servo object using your config dictionary.
```
from dxl.servos import Servos
my_servos = Servos(config = MY_SERVOS_CONFIG, action_bounds = [-1.0, 1.0])
```
Set the servo position. The `action_bounds` kwarg determines how actions relate to positions. An action of 1.0 here
sets the position of the servo to `4095`.
```
my_servos.set({'test_servo' : 1.0, ...})
```
Get the servo position.
```
my_servos.get(['test_servo', ...])
```
### Setup

Clone the DynamixelAPI repo into the desired directory. Install into your desired python environment (consider using [Anaconda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)).
```
$ git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git .
$ cd DynamixelSDK/python/
$ pip install -e .
```
The wrapper can be installed as a pip package:
```
pip install dxl_py
```
This repo uses `MX-28` model dynamixel servos connected via USB through a [U2D2](http://www.robotis.us/u2d2/).
After connecting the device, check it exists (the name might be different from the one below):
```
$ ls /dev/ttyUSB*
/dev/ttyUSB0
```
Now configure and add a custom udev rule using the `fix_udev.sh` script. You might need to reboot.
```
$ sudo ./fix_udev.sh
```
If we check the devices again we should now see the dynamixel device.
```
$ ls /dev/dynamixel
/dev/dynamixel
```
Connect a servo with `id=1` and run the test with `python -m unittest`.