读取、写入和排序大文件
streamio的Python项目详细描述
streamio是一个简单的函数库,用于使用迭代器读取、写入和排序大型文件,以便成功完成操作 在RAM有限的系统上此库在开发TerraNova时已在Griffith University广泛使用。 Climate Change and Adaptation Visualization处理大量数据的工具。streamio是用Python写成的,有大量的文档 以及100%覆盖的单元测试
有关可用函数的列表,请参见API。
示例
反复读取大文本文件:
fromstreamioimportstreamf=stream("large_file.txt")
迭代读取大型CSV文件:
fromstreamioimportjsonstreamf=stream("large_file.json")
用键itemgetter("value"):
合并排序大型json文件fromoperatorimportitemgetterfromstreamioimportmergesortf=mergesort("large_file.json",key=itemgetter("value"))
安装
安装streamio的最简单和推荐的方法是使用pip。 您可以使用pip安装pypi的最新稳定版本:
> pip install streamio
如果您没有PIP,可以使用Easy_安装:
> easy_install streamio
或者,您可以从 PyPI Page或Project Website上的Downloads page; 提取并使用安装:
> python setup.py install
您还可以安装 latest-development version使用pip或easy_install:
> pip install streamio==dev
或:
> easy_install streamio==dev
有关更多信息,请参见streamio documentation。
支持的平台
- Linux、FreeBSD、Mac OS X
- python 2.7版
- Pypy 2.2
-
dt> ^ {STR 1 } $Windows :我们承认Windows存在并作出合理的努力
- 以保持兼容性不幸的是我们不能保证 此时支持。
更改
流量0.0.9(2014-02-27)
- 凸起PY 1.4.19->;1.4.20
流量0.0.8(2014-02-13)
- 修复了对csvstream的Unicode支持,并将unicodecsv添加为新的依赖项。
流量0.0.7(2014-01-29)
- 忘记包含必需的readme.rst和changes.rst
流量0.0.6(2014-01-29)
- 不要在生成的egg中包含fabfile和tests(目前为止)
- 通过progress=True
流量0.0.5(2014-01-16)
- 向*stream()函数添加了encoding参数支持。
流量0.0.4(2013-11-22)
- 添加了streamio.stream.compress函数,用于使用zlib压缩来压缩iterable。
- 对py和progress的松散要求
流量0.0.3(2013-11-21)
- 修复了到api文档的断开链接。
流量0.0.2(2013-11-21)
- 添加了一些示例
- 修正了一些打字错误
流量0.0.1(2013-11-21)
- 首次公开发行