小而高级的工具,可以填补当前python工具集中的空白。

tinytools的Python项目详细描述


简介

tinytools是一组小的、高级的工具,它们填补了python中的空白 工具组。这些工具被分成一组模块

  1. bunch:包含一个OrderedBunch对象类,它与 bunchify/unbunchify方法,类似于其他bunch实现,但是 构建了一个ordereddict,其中ipython表完全重载到 数据存储器。
  2. files:具有可配置的高级筛选和搜索功能 搜索深度、区分大小写和搜索类型。
  3. cmd_list:精简子进程包装以简化命令行 电话。
  4. pvl:读写函数 PVL files
  5. class_csv:在csv文件中移动列的函数-一个常见的需要 用于在机器学习工具之间移动类属性的csv文件。
  6. np_img:翻转图像的numpy操作-即转换 numpy图像数组从(4200200)到(200200,4)。
  7. py_styles:显示python风格的建议。

安装

pipinstalltinytools

导入

importtinytools

或者使用更方便的别名:

importtinytoolsastt

快速启动

importtinytoolsastt## Search functionfound=tt.files.search('/path/to/search',['*.til','proj1*.til'],depth=5,case_sensitive=False)## OrderedBunchfromcollectionsimportOrderedDict# Create an OrderedBunch from and return it to an OrderedDictod=OrderedDict({'a':1,'b':2,'c':{'aa':1.23,'bb':'string'}})ob=tt.bunch.ordered_bunchify(od)ob.a# Explore the OrderdBunch with tab completeob['a']# Equivalent to aboveob.c.bb# orderd_bunchify is recursive on nested Dict objectsob['c']['bb']# Equivalent to aboveod2=tt.bunch.ordered_unbunchify(ob)## Interacting with PVL files# Read full PVL fileimd=tt.pvl.read_from_pvl('/path/to/image.IMD')type(imd)# returns collections.OrderedDictimdob=tt.bunch.ordered_bunchify(img)# Create an ordered bunch to ease# interactive explorationimdob.IMAGE_1.satID# Tab complete through the IMD files# Read an item from a PVL filett.pvl.read_from_pvl('/path/to/image.IMD','satId')# return same as abovett.pvl.read_from_pvl('/path/to/image.IMD','ULLon')# return a list of all# items matching key

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

推荐PyPI第三方库


热门话题
java Grid loadmask(true)在gxt中不起作用   java将字符串索引转换为整数   为什么Java泛型适用于基元数组,但不适用于基元数组?   java如何让Azure应用程序服务Tomcat将所有80/443流量转发到运行在同一应用程序服务上的JBoss   具有多个值的java转换映射到树?   java如何设置SQL server连接URL?   java设置了多个相互独立的JFrame   安全性在JAVA中如何使用RSAPrivateKey的密码短语?   java不能使用比Apache Velocity中更大的条件   如何在Java中打印字符串的所有排列   停止Android Studio自动导入java。sql。日期   对象简单计算器程序java   java如何在安卓中使用“&”符号作为字符串?   java Connect,为我的安卓应用程序从REST API发布和获取数据