PYF框架的数据流分割系统
pyf.splitter的Python项目详细描述
简介
splitter是一个完全独立的模块,可以与pyf一起使用,也可以在 任何其他项目。它不依赖于PYF。
目的
拆分器的目的很简单,而且会一直这样。它给了你一个抽象 在数据流(或任何python iterable)之上 在磁盘上序列化所有内容时操作内存中的iterable 以避免内存消耗。
第二个也是最后一个目的是分割(因此命名)您的数据流 根据一些简单的规则。分裂至少是最不重要的 能够在不影响文件系统的情况下在磁盘上存储大量数据块 限制(尝试过在胖文件系统上存储600GB文件吗?)
需要注意的是,我们没有封装(即:隐藏)bucket 文件夹。拆分器给出它生成的bucket文件名,然后 使用另一个函数将文件读入另一个流。
运行测试
要运行测试,您需要安装tox:
pip install tox
如果你想得到完整的测试套件,那就启动tox,比如python2.7, Python3.4和pep8。
如果只想运行某种类型的测试(即:仅限python2.7),可以指定 就像这样:
tox -e py27
所有定义的测试环境都在tox.ini文件中定义
更改
2015年10月9日,3.1版
- Version 3.0 introduced python3 support and version 3.1 is a bugfix release
to add more sane defaults in the separator. (The datetime objects were not
serializable using the python3 version with the default separator)
- Version 3.0 introduced python3 support and version 3.1 is a bugfix release to add more sane defaults in the separator. (The datetime objects were not serializable using the python3 version with the default separator)