Amazing Printer
It's an attempt to port the Ruby's awesome_print to Python.
Install
pip install amazing-printer
Usage
from amazing_printer import ap
ap(object, options = {})
# Options:
# sort_keys - boolean, set to sort the dictionary keys, default is False.
# indent - integer, set the width of indentation, default is 4 spaces.
# multiple_lines - boolean, set to print the fields for dict or list in multiple lines, default is True.
# color - dict, set the color for different literals, default is
# {
# 'str': 'yellow',
# 'list': 'blue',
# 'tuple': 'green',
# 'none': 'red',
# }
# supported colors: 'yellow', 'blue', 'green', 'red', 'black', 'magenta', 'cyan', 'white'
Contributing
- Fork & clone the repository
$ git clone git@github.com:<your-github-handle>/amazing_printer.git
$ cd amazing_printer
- Create a virtual environment and activate it' This project uses Pipenv. Follow the instruction here to install.
$ pipenv shell --three
- Install dependencies
# Install dependencies for development purpose.
$ pipenv install --dev
-
Make your awesome changes
-
Run test and coverage
# Run test
(env) $ pytest
# Run test with coverage report
(env) $ pytest --cov=amazing_printer amazing_printer/tests/
# Run specific test
(env) $ pytest -k "TestFormatter"
- Run test for multiple environments Make sure you have installed multiple versions of Python. Recommended way of managing Python version using Pyenv
(env) $ tox
- Make your pull request
License
Copyright (c) 2019 Kher Yee, Ting
Released under the MIT license. See LICENSE file for details.
Metadata
Release files for amazing-printer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amazing_printer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / amazing_printer-0.1.0-py3-none-any.whl
| Download URL | amazing_printer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98605430f330b4247e2a3357ebf7bcdd73433c56d8e61d117b8ed71a9718e052
|
|
BLAKE2b-256 checksum How to use checksums |
fc40a8fe1e22e67eb7e6eb31caddbb383eb4e83a4b57108489316a5fb0af2406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|