Metadata-Version: 2.1
Name: repr_soso
Version: 1.0.0
Summary: Prints an object all spread out and indented.
Author-email: Leon Dionne <ldionne@dridesign.sh.cn>
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Intended Audience :: Developers
Project-URL: Home, https://github.com/Zen-Master-SoSo/repr_soso

# repr_soso

Prints an object all spread out and indented.

Takes an object like this:

	{'format': 2, 'versions': ['ARIA', 'Cakewalk', 'LinuxSampler', 'SFZ v1', 'SFZ v2', 'sfizz'], 'headers': [{'name': 'region', 'short_description': 'The basic component of an instrument. An instrument is defined by one or more regions.', 'version': 'SFZ v1'}, {'name': 'group', 'short_description': 'Multiple regions can be arranged...

... and formats it like this:

	{
		"format"	: 2,
		"versions"	: [
			'ARIA',
			'Cakewalk',
			'LinuxSampler',
			'SFZ v1',
			'SFZ v2',
			'sfizz'
		],
		"headers"	: [
			{
				"name"				: 'region',
				"short_description"	: 'The basic component of an instrument. An instrument is defined by one or more regions.',
				"version"			: 'SFZ v1'
			},
			{
				"name"				: 'group',
				"short_description"	: 'Multiple regions can be arranged in a group. Groups allow entering common parameters for multiple regions.',
				"version"			: 'SFZ v1'
			},
			...


### Goal

My purpose in creating this was to use it to produce good-looking code which
can be placed in the source file of another project (sfzen). I had an expensive
operation, building up a large dictionary which never changes. Instead of
performing it on every invocation, it made sense to just include the definition
in the source. Using repr_soso, I wrote the dictionary directly to a file with
a .py extension.


### Usage:

	from repr_soso import Repr
	repr = Repr(big_dictionary)
	repr.print()

... or ...

	repr(big_dictionary).print()


### Speed

This package differs from "rich", which already does this, by doing only one
thing, and doing it fast. Testing with a large dictionary produced the
following:

	rich:       2.1802 seconds
	repr_soso:  0.1395 seconds

YMMV.


