Skip to main content

Python application configuration - highly inspired by `node-config`.

Project description

inspecta Build Status PyPI version

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:

$ pip install inspecta

Use

Very basic example:

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):

.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:

$ make install

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

$ make test

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

$ make test-tox

About

This project was mainly initiated - in lack of solid existing alternatives - to be used at our work at 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.

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

inspecta-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inspecta-0.1.0-py2-none-any.whl (7.4 kB view details)

Uploaded Python 2

File details

Details for the file inspecta-0.1.0.tar.gz.

File metadata

  • Download URL: inspecta-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.13

File hashes

Hashes for inspecta-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c441cc8c14a6f3b98768515a16a502e3fb075ce4234bf950ca4be5754dbcc6c7
MD5 839c7f7f70d89b17e1bf079a19cbf507
BLAKE2b-256 2bf54e5753a96be04231486cca60cfccdb6239e95089ae3a82f4c96e7cb41843

See more details on using hashes here.

File details

Details for the file inspecta-0.1.0-py2-none-any.whl.

File metadata

  • Download URL: inspecta-0.1.0-py2-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.13

File hashes

Hashes for inspecta-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b4087e2aa5516f390a47828d8cfb9e95392815a7be5f4a0409d4fbc80dd8b99d
MD5 c83293190679a0bddf363cccfc230a10
BLAKE2b-256 da847167481605bed7d9b2877319e275d647d9ece5cb9eaaee6173a08ef3ad44

See more details on using hashes here.

Supported by

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