一个使用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如何处理可以为null或整数的POJO类值   JavaFXSpring类NotFoundException:org。springframework。上下文注释。注释ConfigApplicationContext   java Jackson JSON不包装嵌套对象的属性   编写多个SQL查询的java最佳实践   安卓 java。lang.IllegalStateException:无法提取AndroidPlatform、sslSocketFactory上的信任管理器   MongoDB/Morphia将技术id保存为ObjectId,尽管它在Java中是一个字符串   JavaEclipse只加载log4。测试文件夹中的属性   java如何通过次对角线遍历2D数组?   java在geotools jmappane中制作shapefile编辑器   数组如何在java中获得表大小2^32   java API调试。如何查找函数体之前发生的错误?   java如何创建二维数组,其中#1位于随机位置,并执行特定次数   java文本文件比较   java SDK支持diff spring版本   javaspring引导集成测试javax。坚持不懈PersistenceException:org。冬眠PersistentObject异常