一个使用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 ProcessBuilder在使用多个参数时运行不正常   java如何使用Spring数据ORM/JPA创建EntityManagerFactory?   将Velocity宏转换为Java指令   internet上的Java TCP/IP服务器客户端通信   java为什么JDK 8允许一个局部内部类(在方法内部)访问封闭方法的非最终局部变量?   基于Java的比率算法   java应用程序在选择列表首选项时出错   java保存对象以供以后使用   java如何使用MySQL JDBC驱动程序连接Android和MySQL   java Zipkin可以用于控制台应用程序   java单击刷新Servlet页面显示重复内容   java如何递归地反转字符串数组?   java如何使用inputStream作为outputStream的文本?   java扩展令牌选择操作符   java在映射中使用通用枚举类   arraylist如何使用JAVA流从对象列表中查找平均值   windows将FileInputStream和FileOutputStream传递给ffmpeg进行转码(使用JAVEJava音频视频编码)   java Ant脚本在执行CVS签出后找不到目标   重复值情况下的java插入排序,双链表ADT   java如何在Accumulo中获取数据库查询计数