Skip to main content

profimp - generates tree of imports profiles

Project description

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

Profimp allows you to trace imports of your code.

This lib should be used to simplify optimization of imports in your code. At least you will find what consumes the most part of time and do the right decisions.

Installation

Installation of profimp is super easy:

sudo pip install profimp

or

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

Usage

Syntax:

profimp [import_module_line] [--html]

Samples:

profimp "import collections"

profimp "from somemoudle import something"

prpfimp --html "import multiprocessing"

Pretty HTML reports

if you run prpfimp with –html key you will get pretty html output

profimp "import collections"
profimp --html "import collections"

Raw JSON Results

In output you will see something like:

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": []
        }
      ]
    }
  ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

profimp-0.0.3.tar.gz (194.2 kB view details)

Uploaded Source

Built Distribution

profimp-0.0.3.macosx-10.10-intel.exe (77.4 kB view details)

Uploaded Source

File details

Details for the file profimp-0.0.3.tar.gz.

File metadata

  • Download URL: profimp-0.0.3.tar.gz
  • Upload date:
  • Size: 194.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for profimp-0.0.3.tar.gz
Algorithm Hash digest
SHA256 899579c0076c19c8532c00be624a2e7b8ebc27ff97bec28c8b3759623ec84518
MD5 00673367ced449dbba0f094bdb1a99ef
BLAKE2b-256 5cf07ac1ef7e7ea9bf0f6ce9dd6d357e80a55fa5a1decb9714ff791014852572

See more details on using hashes here.

File details

Details for the file profimp-0.0.3.macosx-10.10-intel.exe.

File metadata

File hashes

Hashes for profimp-0.0.3.macosx-10.10-intel.exe
Algorithm Hash digest
SHA256 56de7a55d87ac1939430bb84bc18604a5216e14a0ff184a478d8e0e5c97e0c86
MD5 b55c5cc1f4d27883422d9076b92747e1
BLAKE2b-256 720947f25c39f37e0ecc29f4f40e534031a23adfe749e6297e435576a17aa4f0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page