semvec/pypi-packages huggingface dataset:
cbu-tools 1.0.0
A package for working with Clave Bancaria Uniforme (CBU)
Requires Python: >=3.6
Keywords: cbu,clave bancaria uniforme,argentina,banco,validador,bank,validator

cbu_tools
=======================

:code:`cbu_tools` is a Python package that provides tools for working with Clave Bancaria Uniforme (CBU) numbers, which are bank account identifiers used in Argentina.

Features
---------
- Validate a CBU number

Installation
------------
You can install :code:`cbu_tools` using :code:`pip`:

.. code-block:: bash

    $ pip install cbu_tools

Usage
-----
Once installed, you can import the :code:`CBU` class from :code:`cbu_tools` and use it to validate CBU numbers:

.. code-block:: python

    from cbu_tools import CBU

    cbu = CBU("0170099220000067797370")

    if cbu.is_valid():
        print("Valid CBU")
    else:
        print("Invalid CBU")

Please note that :code:`is_valid` merely validates the format and checksum of a CBU according to the `algorithm specified for CBU validation <https://es.wikipedia.org/wiki/Clave_Bancaria_Uniforme>`_. It does not perform any verification or validation against external systems to determine if the CBU exists or if it is associated with a specific person or entity.

Running Tests
-------------
You can run the tests using :code:`tox`:

.. code-block:: bash

    $ tox

License
-------
This project is licensed under the MIT License. See the LICENSE.txt file for details.
sockettools 1.0.1
Wrapper around built-in python sockets library
Requires Python: >=3.7

# Socket Server Tools
Use sockets easily
## Installation
To install the latest version run
Unix/macOS:
```
python3 -m pip install sockettools
```
Windows:
```
py -m pip install sockettools
```
To install a specified release run
Unix/maxOS
```
python3 -m pip install sockettools=[version]
```
Windows:
```
py -m pip install sockettools=[version]
```
## Quickstart
server.py:
```python
import network

class TransferProtocol(network.Protocol):
    @classmethod
    def encode(cls, data):
        # This function gets data that the program wants to send and encodes it to bytearray or bytes to send to socket
        return data
    
    @classmethod
    def decode(cls, data : bytearray):
        # This function is called every tome some data is recieved
        # returns CONTINUE if data should be continued to be recieved and data param is continued to be built up
        # If the function returns data: data param is reset and resu't is returned
        return data

class ClientHandler(network.ClientHandler):
    protocol = TransferProtocol # This protocol only allows sending and recieving binary data
    def __init__(self, conn, addr, server):
        # This function is called it the main thread when a client connects
        # conn - socket object of the client connection
        # addr - client address
        # server - Server which created the client hander
        # You sould call the original init for the handler to work
        super().__init__(conn, addr, server)
    def serve():
        # This function is called in a separate thread after the init
        self.transport.run_background() # Activates events
        self.event.register(self.event.PACKET_RECIEVED, self.on_recieved)
    def on_recieved(self, data):
        self.transport.send(data)

echo_server = network.Server(host="0.0.0.0", port=8085, handler=ClientHandler)
echo_server.run()
```
client.py:
```python
import network
class TransferProtocol(same as in server.py)

class Client(network.Client):
    protocol = TransferProtocol
    # Same as ClientHandler
    def serve():
        ...
        self.transport.send(b"Echo test")
    def on_recieved(self, data):
        print(data)

client = Client.conect("127.0.0.1", 8085)
client.run()
```