Skip to main content

Pretty prints Python lists

Project description

Build Status

Pretty prints Python lists.

Usage

from nice_list import nice_print, nice_format

nice_print([1, 2, 3, 4])
# -> 1, 2, 3 and 4

nice_print(["Alice", "Bob", "Charles"])
# -> Alice, Bob and Charles

nice_print(["Alice", "Bob", "Charles"], use_and=False)
# -> Alice, Bob, Charles

nice_print(["Alice", "Bob", "Charles", 20], string_quotes='"')
# -> "Alice", "Bob", "Charles" and 20

nice_print([1, 2, 3, 4], oxford_comma=True)
# -> 1, 2, 3, and 4

print(nice_format(["Alice", "Bob", "Charles"]))
# -> Alice, Bob and Charles

Installation

pip install nice_list

Testing

python nice_list_test.py

License

MIT.

Supported by

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