小而高级的工具,可以填补当前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如何在Android上的可访问文件夹中创建文件?(非根)   tomcat Unix脚本未使用Process Runtime在Java中运行   模拟器中的java Android AudioTrack速度异常   java是否创建具有特定@ConditionalOnProperty的注释?   java如何使用json数据从gridview中的URL加载图像?(类别和子类别)   ConcurrentHashMap的java锁定值对象   如何在具有额外属性的Java枚举上执行Javadoc?   java如何修复SocketException连接重置问题?   无附加表的java JPA实体继承   java Android应用程序在启动屏幕后崩溃   java如何将Arraylist保存到文件?   java restTemplate从restfull Web服务获取文件数组   java活动带布局隐藏导航栏   socket未接收任何内容的java BufferedReader