semvec/pypi-packages huggingface dataset:
pydarg 0.1
Pure Python decorator for more complex dictionary handling
License: MIT License
Keywords: python,dictionary,decorator,configuration,utils

pydarg
======

Pydarg is a python simple utility package providing a way to handle
more deeply dictionary parameters of implemented function


REQUIREMENT
===========

Require python 3.6+

INSTALLATION
============

Run this command line to fetch the package on Pypi

``` shell
$ pip install pydarg
```

USAGE
============

This package provide a method "dct_arg" used as a decorator

### Basic Usage

without any parameter, dct_arg unpacks the dictionary
argument of function signature

``` python

@dct_arg
def example(foo,bar):
    print(foo,bar)

param = {'foo':'1,'bar':'2','other':3}
example(param)
```

the main advantage of using dct_arg instead of **param
is that it avoid binding extra argument, making it really useful for
handling configuration dictionary having multiple of parameter.

those functions call would also be valid

``` python
example(foo='foo',bar='bar')
example({'foo':'foo_1'},bar='bar)
example({},'foo','bar')
```

It is also possible to override dct_arg's name by using keyword argument.
making this line printing "foo_2" and "bar_2"

``` python
example({'foo':'foo_1','bar:'bar_1},'foo_2,bar='bar_2)
```


### parameters

```python
dct_arg(
    _fct=None, *,
    is_positional=True,
    is_keyword=True,
    name='dct_arg',
    path="",
    fetch_args=None
    ):
```

Where :
- arg_type:

    define what is the type of the dct_arg

    - ArgType.POSITIONAL
    - ArgType.KEY_WORD
    - ArgType.BOTH,

- name

    represent the keyword name of the dct_arg

- path

    if the desired dct_arg is nested you you can specify the path
    with "/"

- fetch_args

    dictionary composed of key representing keyword parameter, and
    the path with "/" to fetch them in the dct_arg


### Examples

**fetch the nested dictionary argument named config**

```python
@dct_arg(name='config,path='child/subchild')
def example(e0, e1):
    print(e1, e0)


example(config={'child': {'subchild': {'e1': 1, 'e0': 0}}})
example({'child': {'subchild': {'e1': 1}}}, e0=0)
```

since by default a dct_arg is a positional keyword
both function call works

**fetch the dct_arg itself as an argument**

```python
@dct_arg(fetch_args={'config': ""})
def example(config, e0):
    pass

example(configuration={'e0': 0})
```
wsrequests 0.1.1
thin wrapper for requests enable websocket
License: MIT License

Copyright (c) 2018 denzow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: # wsrequests
        
        thin wrapper for requests enable websocket.
        
        
        ## how to install
        
        ```bash
        $ pip install wsrequests
        ```
        
        ## how to use
        
        ```python
        from wsrequests import WsRequests
        
        wsr = WsRequests()
        
        # login django
        wsr.get('http://localhost:3000')
        wsr.post(
            'http://localhost:3000',
            data={
                'username': 'your name',
                'password': 'your password',
                'csrfmiddlewaretoken': wsr.cookies['csrftoken'],
                'next': '/',
            }
        )
        
        # connect websocket
        wsr.connect('ws://localhost:3000/ws/room')
        wsr.send_message({'message': 'ping'})
        wsr.receive_message()
        wsr.disconnect()
        
        ```
        
        
Platform: UNKNOWN