semvec/pypi-packages huggingface dataset:
serpyco-d7 1.3.16
Fast serialization of dataclasses using Cython
License: MIT
Requires Python: >=3.7,<3.12

============================================
Serpyco: a serializer for python dataclasses
============================================

What is Serpyco ?
-----------------

Serpyco is a serialization library for `Python 3.6+ dataclasses <https://docs.python.org/3/library/dataclasses.html>`_ that works just by defining your dataclasses:

.. code-block:: python

    import dataclasses
    import typing

    import serpyco

    @dataclasses.dataclass
    class Example(object):
        name: str
        num: int
        tags: typing.List[str]


    serializer = serpyco.Serializer(Example)

    result = serializer.dump(Example(name="foo", num=2, tags=["hello", "world"]))
    print(result)

    {'name': 'foo', 'num': 2, 'tags': ['hello', 'world']}

Serpyco works by analysing the dataclass fields and can recognize many types : `List`, `Set`, `Tuple`, `Optional`, `Union`... You can also embed other dataclasses in a definition.

The main use-case for Serpyco is to serialize objects for an API, but it can be helpful whenever you need to transform objects to/from builtin Python types.


Features
--------

- Serialization and unserialization of dataclasses
- Validation of input/output data
- Very fast
- Extensible through custom encoders

Installing
----------

Serpyco is best installed via pip:

.. code-block:: shell

    pip install serpyco

It has only 3 (4 with python 3.6 dataclasses backport) dependencies:

- rapid-json: used for data validation and fast JSON dump/load
- python-dateutil: used for serializing datetime objects
- typing_inspect: used to inspect types as needed to create serializers

Documentation
-------------

- `Documentation <https://sgrignard.gitlab.io/serpyco/docs>`_
- `API Reference <https://sgrignard.gitlab.io/serpyco/docs/api.html>`_

Contributing
------------

Serpyco is written using `Python <https://www.python.org>`_ and `Cython <https://www.cython.org>`_ for parts needing speed.

- `Issue tracker <https://gitlab.com/sgrignard/serpyco/issues>`_
- `Source code <https://gitlab.com/sgrignard/serpyco>`_
ShellyPy 0.3.0
Wrapper around the Shelly HTTP api
License: MIT

# ShellyPy
not to be confused with [pyShelly](https://github.com/StyraHem/pyShelly)  
Python 2 and 3 Wrapper around the Shelly HTTP api


## why
other packages like [pyShelly](https://github.com/StyraHem/pyShelly) only support CoAP or MSQT, neither I am comfortable with using in personal projects


## examples
#### relay
a simple working example for the Shelly 1 that turns a relay on 
```python
import ShellyPy

device = ShellyPy.Shelly("192.168.0.5")

device.relay(0, turn=True)
```
[examples/toggle_relay.py](examples/toggle_relay.py)

#### monitor
a simple working example for the Shelly 1 that request monitor information 
```python
import ShellyPy

device = ShellyPy.Shelly("192.168.68.121")

deviceMeter = device.meter(0)   #request meter information
print(deviceMeter['power'])     #print power information
print(deviceMeter['total'])     #print total information
```
other examples are available as well [examples/meter.py](examples/meter.py)

## devices
#### supported
- Shelly1
- Shelly1PM
- Shelly2
- Shelly2.5
- Shelly4Pro (untested)
- Shelly Plug (untested)
- Shelly PlugS (untested)
- Shelly Bulb (untested)
- Shelly H&T (untested)
- Shelly Smoke (untested)
- Shelly EM (untested)
- Shelly flood (untested)

#### unsupported
- Shelly Sense (documentation is inaccurate, incomplete)
- Shelly RGBW (documentation is incomplete)

## applicability
this wrapper is best used in closed networks where other solutions are either not an option or not desired  
give your shelly devices static IP adresses for best results


## license
this project is licensed under the [MIT License](LICENSE)  
feel free to do whatever you want with it