一个使用britecore etl的python包。

brite_etl的Python项目详细描述


一个使用britecore etl的python包。

请注意:brite_etl跟在Semantic Versioning后面,目前正处于初始开发阶段(0.x.x)。小心使用。

使用

这些都在介绍页上被分解了。

importbrite_etlfrombrite_etl.core.io.frame_sourcesimportCsvSource# Create a "set" of frames to work with...contoso=brite_etl.lib.FrameSet('contoso')#Set the source of our csvs (can also pass BriteDataFrame/PreparedDataFrame)...contoso.set_data_sources(source=CsvSource(DF_ROOT),prepared_source=CsvSource(DF_PREP))# Easy handling of dataframes, works same for both csv and britedataframe sources.# Essentially a wrapper around the pandas DataFrame. Dates parsed automatically.contoso.frames.get('property_items')contoso.frames.get('agencies').df# original dataframe# Import BriteCore reports. Don't have to open/change/save columns in excel, hyperlinks and other# formatting issues are handled. Don't even have to rename the file to take out the dates.frombrite_etl.core.ioimportimport_reportadv_prem=import_report('/tmp/input','Advance Premium',sheet='Advance Premium List',skip_rows=2)# Pandas DataFramecontoso.frames.set('ap',df=adv_prem)# Make custom frames in your frame set# Define frame-specific operations...contoso.frames.get('prepared.lines').endOfMonthSum()# Or use universal operations, chain across multiple frames..._contoso=contoso.chain(_contoso.filter_dates('date filter for multiple frames actually isn\'t done yet (soon, though)').hash_cols(['policyId'])# MD5 hashed dataframes.export_excel(path='/tmp/output',file_name='end_month_integrity_hash.xlsx')# Every frame is put into it's own sheet during export.run())# Computations make use of multiple frames within a frame set (also chainable)...trans=_contoso.get_item_transactions().value()# Create multiple, isolated sets of frames...wrk=brite_etl.lib.FrameSet('working',from_set=contoso)

安装

pip install brite_etl

开发

要运行所有测试,请运行:

tox

使用tox -e py27tox -e py35测试所需的python版本。比运行所有测试环境快得多。

关于测试的注意事项:有些测试需要实际的df_缓存数据才能运行。df_缓存目录的位置在setup.cfg文件中定义。运行时,测试将检查以确保目录存在并包含文件。如果他们不这样做,这些测试将被跳过,其余的测试应该正常工作。

更改日志

0.1.0(2016-10-03)

  • 更新文档
  • femove pypy env
  • 使用语义版本控制

0.0.1(2016-10-02)

  • pypi上的第一个版本。

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

推荐PyPI第三方库


热门话题
java试图使用JavaFX2实现“插入符号浏览”   三个给定集合中两个集合的java交集?   数组如何在java中从csv文件的元素集中随机选择?   java从变量插入到Jtable,从DB插入   java如何在静态方法的末尾返回变量   java另一个JPA问题   java收藏家。按两列分组不起作用   将java值改为下一个千,而不是最近的千   JavaSpringDataREST:如何通过另一个对象的键进行搜索?   java Spring MVC:HTTP Status 404/SimpleMVC/WEB_INF/HelloPage。jsp   java应用程序光盘在OpenJdk中可用吗?   java在数组中的特定点添加字符   java如何用Mockito模拟方法调用   java从JList获取数据   我们可以在Java中搜索不同IMAP电子邮件帐户中的电子邮件吗?   计算表达式的数学Java算法   未构建Maven的java服务器组件   java调用部署在远程计算机上的会话bean的方法   java XML:迭代地获取每个节点元素的节点值或文本内容