semvec/pypi-packages huggingface dataset:
easy-tcp-python2-3 0.0.1.0
easy socket programming between python 2 and 3 without compatibility issues

# easy-tcp-python2-3

- easy socket programming between python 2 and 3 without compatibility issues
- receive and send the list, json or image via pickle and cv2 (jpeg)

## Dependencies
- python 2 or python 3 (>=3.7)
- opencv-python
- [pickle-compat](https://pypi.org/project/pickle-compat/)

## Installation
```
$ pip install easy_tcp_python2_3
```

## Usage

- send a sample list and image from a server to client
```
# server
from easy_tcp_python2_3 import socket_utils as su
import numpy as np
sock, add = su.initialize_server('localhost', 7777)
sample_list = [1, 2]
print("Send list:, sample_list)
su.sendall_pickle(sock, sample_list)
sample_image = np.uint8(np.zeros([480, 640]))
print("Send image:, sample_image.shape)
su.sendall_image(sock, sample_image)

# client
from easy_tcp_python2_3 import socket_utils as su
sock = su.initialize_client('localhost', 7777)
recv_list = su.recvall_pickle(sock)
print("Received list:", recv_list)
recv_image = su.recvall_image(sock)
print("Received image:"recv_image.shape)
```

## Authors
* **Seunghyeok Back** [seungback](https://github.com/SeungBack)

## License
This project is licensed under the MIT License
Ittigorn 0.0.2
My helper classes library
Requires Python: >=3.7

README.md message placeholder

To build this project before publishing, run the following command
`python .\setup.py sdist bdist_wheel`

To publish this project, run the following command after building
`python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*`

ref : https://www.codementor.io/@ajayagrawal295/how-to-publish-your-own-python-package-12tbhi20tf
mock-protocol 1.0.0
A unittest mock library than understands annotations
Requires Python: >=3.6, <4
Keywords: test unittest mock protocol annotation

# mock_protocol
A unittest mock library than understands protocols and annotations

A drop-in replacement for the builtin python 3.7 unittest.mock module where annotations on spec objects are used to spec mocked attributes and methods.

In addition to the standard `unittest.mock` functionality, a new `from_protocol` function
is added.

```python
import mock_protocol

m = mock_protocol.from_protocol(C, **kwargs)
``` 
is an alias for 
```python
m = mock_protocol.create_autospec(C, spec_set=True, instance=True, **kwargs)
```
which is essentially the same as the `unittest.mock` method of the same name
```python

m = unittest.mock.create_autospec(C, spec_set=True, instance=True, **kwargs)
```
except that type-hints are used to spec the mocked attributes.
 
When you have type-hinted code like this
```python
class A(object):
    b: str

    def __init__(self, b: str):
        self.b = b

    def foo(self, bar: int) -> list:
        return ['x']*bar


class C(object):
    a: int

    def __init__(self, a: int):
        self.a = a

    def bar(self, foo: str) -> A:
        return A(foo)
```
Then mocking them with mock_protocol will use the type hints as specs for child mocks.
```python
m = mock_protocol.from_protocol(C)
a = m.bar('hello')

# the following are all True
isinstance(a, A)
isinstance(a.b, str)
isinstance(m.a, int)
isinstance(a.foo(4), list)
```

`mock_protocol` also understands common `typing` types such as `Dict` and `Tuple` and `Optional`

```python
import typing

class D(object):
    a: typing.Optional[int]
    d: typing.Dict[str, int]
    e: typing.Optional[typing.AnyStr]
    t: typing.Tuple[int, float]

    def __init__(self, a: int):
        self.a = a

    def bar(self, foo: str) -> typing.Optional[A]:
        return A(foo)

m = mock_protocol.from_protocol(D)
a = m.bar('hello')

# the following are all True
isinstance(m, D)
isinstance(a, A)
isinstance(m.a, int)
isinstance(m.d, dict)
isinstance(m.e, str)
isinstance(m.t, tuple)
```