semvec/pypi-packages huggingface dataset:
SocketSwap 0.1.11
SocketSwap is a python package that allows to proxy any third-party libraries traffic through a local TCP Proxy
License: MIT

# SocketSwap

SocketSwap is a tool that allows to proxy any third-party libraries traffic through a TCP SOCKS5 Proxy.

Some Python libaries support proxing out of the box like requests.
For all other libaries especially ones not natively written in python, you can use SocketSwap to redirect traffic via a proxy.

### Usage:

There are two ways to use SwapSock. 

    - Via a Context Manager that starts the proxy in a daemon process
    - Directly as a blocking script

#### Context Manager

```python 
import socket
from SocketSwap import ProxySwapContext


def socket_factory():
    target_host = "localhost"
    target_port = 5432
    remote_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    remote_socket.connect((target_host, target_port))
    return remote_socket

def main():
    
    with ProxySwapContext(socket_factory, "127.0.0.1", 2222):
        # do something you want to proxy
        # connect to 127.0.0.1:2222

```
The ProxySwapContext takes essentially 3 mandatory arguments.  


#### Logging and Debugging
```python 
from SocketSwap import ProxySwapContext

# debug level logging
import logging
socket_swap_logger = logging.getLogger("SocketSwap")
socket_swap_logger.addHandler(logging.StreamHandler())
socket_swap_logger.setLevel(logging.DEBUG)

```
By default logging is not enabled. You can do so by assigning a handler to the "SocketSwap" logger and choosing a level.

## Credits:

The TCP Proxy part is a slim modified version of https://github.com/ickerwx/tcpproxy.
commonMethods-zhaozl-green 2.6
timeTrans code2Name mysqlOperator printWithColor comtradeParse processBar trendAnalyzer bounceAnalyzer evennessDetermine……
License: MIT
Requires Python: >=3.7.0

## 版本记录

v1.0 从commonMethods_zhaozl==v3.13版本中，删除bpNetWork的内容

v1.1 从commonMethods_zhaozl==v3.14版本中，删除bpNetWork的内容，相比v1.0增加proportionalGrouping函数

v1.2 修正了冗余代码

v2.0 简化并优化了脚本，适应Python3.8

v2.2 增加了几种进度条

v2.3 toolbox中增加了Shuffle

v2.4 降级了环境要求，Python3.7

v2.5 修改了mysqlOperator中的功能

v2.6 修改了mysqlOperator中的bug