This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# vxUtils

这是我的工具箱


## decorator 修饰器

1. retry

错误重试的修饰器

```python
from vxUtils.decorator import retry

@retry(5, ValueError, delay=1, backoff=2)
def test():

raise ValueError('try it ')
```

2. timeit

计算运行消耗时间

```python
import time
from vxUtils.decorator import timeit

@timeit
def test():
time.sleep(5)
```

3. Singleton

设计模式:单例实现方式

```python
from vxUtils.decorator import singleton

@singleton
class Test():
pass
```

4. threads

异步多线程

```python
import requests
from vxUtils.decorator import threads

@threads(5)
def get_url(url):
return requests.get(url)

if __name__ == '__main__':
urls = [
'www.sina.com',
'www.baidu.com',
'www.qq.com',
'www.taobao.com'
]

responses = [get_url(url) for url in urls]
for r in responses:
print(r.content)

```

5. timeout

限制超时时间

```python
import time
from vxUtils.decorator import timeout

@timeout(5)
def test():
print('start to test')
for n in range(10):
time.sleep(1)
print('n: %s' % n)
```

6. lazy_property

类似@property的功能,但只执行一次

```python
from vxUtils.decorator import lazy_property

class T():
@lazy_property
def myproperty(self):
print('call myproperty')
return 'myproperty'
```

## PrettyLogger

漂亮的日志格式

1. add_console_logger

增加console logger

```python
import logging
from vxUtils.PrettyLogger import add_console_logger

logger = logging.getLogger('test')

logger = add_console_logger(logger, 'debug')

logger.debug('蓝色')
logger.info('绿色')
logger.warnning('黄色')
logger.error('棕色')
logger.critical('红色')
```

2. add_qyWechat_logger

企业微信号,日志通知

```python
import logging
from vxUtils.PrettyLogger import add_qyWechat_logger

logger = logging.getLogger('test')

logger = add_qyWechat_logger(logger,'warning',corpid, appsecret, agentid)

logger.warning('这是微信日志通知')
```
Release History

Release History

0.0.7

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
vxUtils-0.0.7-py3.4.egg (21.8 kB) Copy SHA256 Checksum SHA256 3.4 Egg Feb 1, 2017
vxUtils-0.0.7.tar.gz (8.0 kB) Copy SHA256 Checksum SHA256 Source Feb 1, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting