semvec/pypi-packages huggingface dataset:
freeproxy-cn 1.8
.. figure:: https://img.shields.io/pypi/pyversions/cuckoopy.svg :alt:

免费的中国代理，网站列表

::

    [1]: lab.crossincode.com
    [2]: 89ip
    [3]: www.ip3366.net
    [4]: ip.jiangxianli.com
    [5]: www.kuaidaili.com
    [6]: www.xsdaili.com
    [7]: www.xicidaili.com
    [8]: www.superfastip.com
    [9]: www.freeip.top

安装
~~~~

::

    pip install freeproxy_cn

使用
~~~~

1. 循环抓取代理

.. code:: python

    >>> from freeproxy_cn import Engin
    >>> import asyncio
    >>> loop = asyncio.get_event_loop()
    >>> loop.run_until_complete(Engin().run())

2. 获取代理

   .. code:: python

       >>> from redis import Redis
       >>> rds = Redis()
       >>> rds.spop('http://icanhazip.com')
       192.168.1.1

参数说明
~~~~~~~~

\| Engin参数 \| 含义 \| \| -------------- \|
------------------------------------------------------------------------------------------------------------------------------
\| \| redis\_host \| 存储代理的redis的host \| \| redis\_port \|
存储代理的redis的port \| \| redis\_password \| 存储代理的redis的password
\| \| redis\_db \| 存储代理的redis使用哪个db,默认为0 \| \| valid\_thread
\| 用于验证代理有效性的线程数目，默认为4，想加快验证的可以适当增大该参数
\| \| valid\_per\_time \|
每批验证多少个代理地址，默认20个，可以适当增大该参数加快验证 \| \|
valid\_url \|
默认为一个返回请求IP\ `网站 <http://icanhazip.com>`__,这个网站没有区分http和https，\ **实际中需要换成自己要抓取的目标网站来验证代理**
\| \| valid\_timeout \| 验证超时时间设定，默认为5秒 \| ### 改进

可以使用一个web服务器代替redis进行代理提供，暂时还没有写

更新日期
~~~~~~~~

2019-12-23

Home-page: https://github.com/Hexmagic/freeproxy_cn.git
Author: Hexmagic
Author-email: 191440042@qq.com
License: GNU General Public License v3.0
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.6
Classifier: Operating System :: OS Independent
retry-helper 0.0.4
Helper for retrying code when exception occur
Requires Python: >=3.6

# Retry Helper 

Helper tool fro retrying code when soem exceptions occur

## Usage

### RetryManager
Retry manager is context manager for retrying block of code. In fact its double layer context manager in first context you will create context manager and use while retry object is true. And the run you code in context of retry.attempt.

 * max_attempts - maximum count of attempts, default 1
 * wait_seconds - How many second it should wait before next retry, default 0
 * exceptions - exception class or tuple of exceptions classes which cause retry, if None all exceptions cause retry default None
 * reset_func - function to be run before each retry (it is not call on first try)


 
```
with RetryManager(max_attempts=20, wait_seconds=1, exceptions=(TypeError,KeyError)) as retry:
while retry:
    with retry.attempt:
        # code raising exception if fail
```