profimp-生成导入配置文件树

profimp的Python项目详细描述


https://img.shields.io/coveralls/boris-42/profimp.svghttps://api.travis-ci.org/boris-42/profimp.svg?branch=masterhttps://pypip.in/version/profimp/badge.svghttps://pypip.in/py_versions/profimp/badge.svghttps://pypip.in/download/profimp/badge.svg

profimp允许您跟踪代码的导入。

应该使用这个库来简化代码中导入的优化。 至少你会发现什么消耗了大部分时间 正确的决定。

安装

profimp的安装非常简单:

sudo pip install profimp

git clone https://github.com/boris-42/profimp && cd profimp
sudo python setup.py install

用法

语法:

profimp [import_module_line] [--html]

样品:

profimp "import collections"

profimp "from somemoudle import something"

prpfimp --html "import multiprocessing"

漂亮的HTML报告

如果使用–html键运行prpfimp,将获得漂亮的html输出

profimp "import collections"
American Gothic

原始json结果

在输出中,您将看到如下内容:

profimp "import collections"

{
  "level": 0,
  "finished_at": 1427986324.921502,
  "import_line": "root",
  "duration": 1.0581016540527344,
  "started_at": 1427986324.920444,
  "children": [
    {
      "level": 1,
      "finished_at": 1427986324.9215,
      "import_line": "import collections",
      "duration": 1.0390281677246094,
      "started_at": 1427986324.920461,
      "children": [
        {
          "level": 2,
          "finished_at": 1427986324.920694,
          "import_line": "from _abcoll import *",
          "duration": 0.006198883056640625,
          "started_at": 1427986324.920688,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.920702,
          "import_line": "import _abcoll",
          "duration": 0.0019073486328125,
          "started_at": 1427986324.9207,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.920891,
          "import_line": "from _collections import deque, defaultdict",
          "duration": 0.1850128173828125,
          "started_at": 1427986324.920706,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.920899,
          "import_line": "from operator import itemgetter, eq",
          "duration": 0.00286102294921875,
          "started_at": 1427986324.920896,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.921064,
          "import_line": "from keyword import iskeyword",
          "duration": 0.16188621520996094,
          "started_at": 1427986324.920902,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.92107,
          "import_line": "import sys",
          "duration": 0.0021457672119140625,
          "started_at": 1427986324.921068,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.921402,
          "import_line": "import heapq",
          "duration": 0.3299713134765625,
          "started_at": 1427986324.921072,
          "children": [
            {
              "level": 3,
              "finished_at": 1427986324.921241,
              "import_line": "from itertools import islice, count, imap, izip, tee, chain",
              "duration": 0.0040531158447265625,
              "started_at": 1427986324.921237,
              "children": []
            },
            {
              "level": 3,
              "finished_at": 1427986324.921246,
              "import_line": "from operator import itemgetter",
              "duration": 0.0021457672119140625,
              "started_at": 1427986324.921244,
              "children": []
            },
            {
              "level": 3,
              "finished_at": 1427986324.921391,
              "import_line": "from _heapq import *",
              "duration": 0.13899803161621094,
              "started_at": 1427986324.921252,
              "children": []
            }
          ]
        },
        {
          "level": 2,
          "finished_at": 1427986324.921409,
          "import_line": "from itertools import repeat, chain, starmap",
          "duration": 0.00286102294921875,
          "started_at": 1427986324.921406,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.921413,
          "import_line": "from itertools import imap",
          "duration": 0.0019073486328125,
          "started_at": 1427986324.921411,
          "children": []
        },
        {
          "level": 2,
          "finished_at": 1427986324.921455,
          "import_line": "from thread import get_ident",
          "duration": 0.03981590270996094,
          "started_at": 1427986324.921415,
          "children": []
        }
      ]
    }
  ]

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

推荐PyPI第三方库


热门话题
我们可以使用java for loop with switch语句。。?   java如何从具有循环关系的数据集生成树?   使用s:mvcUrl标记时java Spring启动问题   javascript Wicket调色板水平滚动条在firefox中不显示   java如何清理Maven插件绑定?   java将文件从设备发送到计算机不起作用(文件被破坏)   Java GPU编程的性能   java字符串标记器问题   连接Java LDAP断开连接   java Android GridView将无法确定正确的位置   java AlarmManager在指定时间未显示toast消息   MVC中的java测试外观|断言返回类型   logcat上的java Android运行时错误   java Building Workspace在Eclipse中遇到错误   堆栈溢出尾部递归遗传算法抛出“awteventque0”java。StackOverflowerr语言   java ArrayOutOfBounds测试代码不工作   java有没有像Moodle这样流行的课程管理系统?   java如何从jsp获取xml文件作为响应