inspecta


Nameinspecta JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/grimen/python-inspecta
SummaryA colorized object pretty printer - for Python.
upload_time2019-03-10 11:13:57
maintainer
docs_urlNone
authorJonas Grimfelt
requires_python
licenseMIT
keywords inspector inspection color colors syntax-highlighting prettyprinter pretty-printer debugging terminal
VCS
bugtrack_url
requirements setupextras rootpath six pygments termcolor colour-runner deepdiff tox coverage codecov
Travis-CI
coveralls test coverage No coveralls.
            
# `inspecta` [![PyPI version](https://badge.fury.io/py/inspecta.svg)](https://badge.fury.io/py/inspecta) [![Build Status](https://travis-ci.com/grimen/python-inspecta.svg?branch=master)](https://travis-ci.com/grimen/python-inspecta) [![Coverage Status](https://codecov.io/gh/grimen/python-inspecta/branch/master/graph/badge.svg)](https://codecov.io/gh/grimen/python-inspecta)

*A colorized object pretty printer - for Python.*

## Introduction

The default `pprint` is not human friendly enough - color syntax highlighting to the rescue.


## Install

Install using **pip**:

```sh
$ pip install inspecta
```


## Use

Very basic **[example](https://github.com/grimen/python-inspecta/tree/master/examples/basic.py)**:

```python
import inspecta

data = {
    'foo': {
        'bar': {
            'baz': [
                {
                    'a': 1,
                    'b': 'two',
                    'c': ('three', 4, 'five')
                }
            ]
        }
    },
    'bar': [1, 2, 3],
    'baz': True
}

print('\n.inspect(data)\n')

print(inspecta.inspect(data))

print('\n.print(data)\n')

inspecta.print(data)
```

Run this with optional environment variables `COLORS` / `ERROR_COLORS` set too truthy or falsy values, so see various error info formatting in terminal.

Something like this (imagine some colorized formatting):

```bash

.inspect(data)

{   'bar': [1, 2, 3],
    'baz': True,
    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}


.print(data)

{   'bar': [1, 2, 3],
    'baz': True,
    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}


```


## Test

Clone down source code:

```sh
$ make install
```

Run **colorful tests**, with only native environment (dependency sandboxing up to you):

```sh
$ make test
```

Run **less colorful tests**, with **multi-environment** (using **tox**):

```sh
$ make test-tox
```


## About

This project was mainly initiated - in lack of solid existing alternatives - to be used at our work at **[Markable.ai](https://markable.ai)** to have common code conventions between various programming environments where **Python** (research, CV, AI) is heavily used.


## License

Released under the MIT license.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/grimen/python-inspecta",
    "name": "inspecta",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "inspector,inspection,color,colors,syntax-highlighting,prettyprinter,pretty-printer,debugging,terminal",
    "author": "Jonas Grimfelt",
    "author_email": "grimen@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/74/40/3703630202705f96bd08a32a74ef7772345f7e84109915caeed057eeaff8/inspecta-0.1.3.tar.gz",
    "platform": "",
    "description": "\n# `inspecta` [![PyPI version](https://badge.fury.io/py/inspecta.svg)](https://badge.fury.io/py/inspecta) [![Build Status](https://travis-ci.com/grimen/python-inspecta.svg?branch=master)](https://travis-ci.com/grimen/python-inspecta) [![Coverage Status](https://codecov.io/gh/grimen/python-inspecta/branch/master/graph/badge.svg)](https://codecov.io/gh/grimen/python-inspecta)\n\n*A colorized object pretty printer - for Python.*\n\n## Introduction\n\nThe default `pprint` is not human friendly enough - color syntax highlighting to the rescue.\n\n\n## Install\n\nInstall using **pip**:\n\n```sh\n$ pip install inspecta\n```\n\n\n## Use\n\nVery basic **[example](https://github.com/grimen/python-inspecta/tree/master/examples/basic.py)**:\n\n```python\nimport inspecta\n\ndata = {\n    'foo': {\n        'bar': {\n            'baz': [\n                {\n                    'a': 1,\n                    'b': 'two',\n                    'c': ('three', 4, 'five')\n                }\n            ]\n        }\n    },\n    'bar': [1, 2, 3],\n    'baz': True\n}\n\nprint('\\n.inspect(data)\\n')\n\nprint(inspecta.inspect(data))\n\nprint('\\n.print(data)\\n')\n\ninspecta.print(data)\n```\n\nRun this with optional environment variables `COLORS` / `ERROR_COLORS` set too truthy or falsy values, so see various error info formatting in terminal.\n\nSomething like this (imagine some colorized formatting):\n\n```bash\n\n.inspect(data)\n\n{   'bar': [1, 2, 3],\n    'baz': True,\n    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}\n\n\n.print(data)\n\n{   'bar': [1, 2, 3],\n    'baz': True,\n    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}\n\n\n```\n\n\n## Test\n\nClone down source code:\n\n```sh\n$ make install\n```\n\nRun **colorful tests**, with only native environment (dependency sandboxing up to you):\n\n```sh\n$ make test\n```\n\nRun **less colorful tests**, with **multi-environment** (using **tox**):\n\n```sh\n$ make test-tox\n```\n\n\n## About\n\nThis project was mainly initiated - in lack of solid existing alternatives - to be used at our work at **[Markable.ai](https://markable.ai)** to have common code conventions between various programming environments where **Python** (research, CV, AI) is heavily used.\n\n\n## License\n\nReleased under the MIT license.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A colorized object pretty printer - for Python.",
    "version": "0.1.3",
    "split_keywords": [
        "inspector",
        "inspection",
        "color",
        "colors",
        "syntax-highlighting",
        "prettyprinter",
        "pretty-printer",
        "debugging",
        "terminal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "fe3ce2479aff95018147f93353b0144e",
                "sha256": "043b4dc3e6b7727e706e793befcba9981eb00f2b1c012c49f6d9cdcb2c18b15f"
            },
            "downloads": -1,
            "filename": "inspecta-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe3ce2479aff95018147f93353b0144e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9150,
            "upload_time": "2019-03-10T11:13:56",
            "upload_time_iso_8601": "2019-03-10T11:13:56.577846Z",
            "url": "https://files.pythonhosted.org/packages/03/aa/5ad8e223fa564d474b465771710b8b7b23896b59651cf115f510bcfda3ee/inspecta-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "7fa1ec828c204e3dffde5c9ea3ea3a11",
                "sha256": "17124dfae9b05e6226cc426036aa7736bbdf37d61ae5cc85178474ca9ec3d6c1"
            },
            "downloads": -1,
            "filename": "inspecta-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "7fa1ec828c204e3dffde5c9ea3ea3a11",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9987,
            "upload_time": "2019-03-10T11:13:57",
            "upload_time_iso_8601": "2019-03-10T11:13:57.782944Z",
            "url": "https://files.pythonhosted.org/packages/74/40/3703630202705f96bd08a32a74ef7772345f7e84109915caeed057eeaff8/inspecta-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-03-10 11:13:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "grimen",
    "github_project": "python-inspecta",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "setupextras",
            "specs": [
                [
                    ">=",
                    "0.1.5"
                ]
            ]
        },
        {
            "name": "rootpath",
            "specs": [
                [
                    ">=",
                    "0.1.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    ">=",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    ">=",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "termcolor",
            "specs": [
                [
                    ">=",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "colour-runner",
            "specs": [
                [
                    ">=",
                    "0.0.5"
                ]
            ]
        },
        {
            "name": "deepdiff",
            "specs": [
                [
                    ">=",
                    "3.3.0"
                ]
            ]
        },
        {
            "name": "tox",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    ">=",
                    "4.5.2"
                ]
            ]
        },
        {
            "name": "codecov",
            "specs": [
                [
                    ">=",
                    "2.0.15"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "inspecta"
}
        
Elapsed time: 0.02845s