各种各样的python工具。一些用法:取整日期时间、验证输入数据、按计划执行函数、解析argv

fons的Python项目详细描述


fons公司

用于各种用途的Python库。在

fons-拉丁语表示“源”

一些有用的函数和类:

* aio.call_via_loop_afut - call a (async)function via (another) loop (possibly running in a different thread),
                            returns async future with pending result/exception thrown of the function

* argv.parse_argv - for parsing input sys.argv into dict values and list values, modifying them, and de-parsing

* func.(async_)limitcalls - a decorator for setting rate limit to (async) function/method
                            @limitcalls(1, 5, action='sleep')
                            def f(): pass     -> f can only be called once per every 5 seconds, sleeps until that delay is reached

* io.update_settings - load dict from settings file, supporting multiple configs in the same or different files

* iter.flatten - "flatten" a nested list (iterator): list(flatten([2,{3:4},[5,6,(7,)],'89'])) -> [2,{3:4},5,6,7,'89']
                  (by default includes only "known" iterators; doesn't include: dicts, strings, namedtuples, custom defined classes)

* iter.fliter - "flatten" any iterable: list(fliter([2,{3:4},[5,6,(7,)],'89'])) -> [2,3,4,5,6,7,'8','9']

* iter.unique - keep each value of iterator only once: list(unique([2,3,2])) -> [2,3]

* sched.(Async)Ticker.loop - repeatedly execute a (async)function with a set interval (supports pandas offsets, e.g. '1B')

* time.dt_round - round datetime: dt_round(datetime.datetime(2016,3,1,2), 'D') -> datetime.datetime(2016,3,1)

* verify.verify_data - assert the correctness of input data (useful for avoiding accidental user config mistypes)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java SimpleFramework和工厂方法   Java适当地处理异常   java单例类不起作用   java小程序和Swing在eclipse中不显示组件   多个键上的java Redisson FastRemove不起作用   java验证请求正文不等于模式   在Java中从URL读取数据   eche RecyclerView项的java Set自定义字体   string Java如何从Date获取HH:mm:ss   当Java应用程序落后于负载均衡器时,在某些URL上强制使用SSL   使用esapi时发生java错误   java使用流根据第二个列表中的值更新一个列表中的对象   组织。openqa。硒。Java中的NoTouchElementException WebDriver?   从JSON字符串Java创建CSV文件