{"id":13595569,"url":"https://github.com/tommikaikkonen/prettyprinter","last_synced_at":"2025-05-16T02:09:20.778Z","repository":{"id":37602604,"uuid":"113555950","full_name":"tommikaikkonen/prettyprinter","owner":"tommikaikkonen","description":"Syntax-highlighting, declarative and composable pretty printer for Python 3.5+","archived":false,"fork":false,"pushed_at":"2023-12-18T22:22:37.000Z","size":1057,"stargazers_count":338,"open_issues_count":39,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T11:04:55.696Z","etag":null,"topics":["pretty","prettyprint","prettyprinter","print"],"latest_commit_sha":null,"homepage":"https://prettyprinter.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommikaikkonen.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-08T09:18:56.000Z","updated_at":"2025-01-13T23:49:55.000Z","dependencies_parsed_at":"2024-08-01T16:39:58.257Z","dependency_job_id":"c877e4c4-2787-4ae1-b70d-e2d9cdb82fdc","html_url":"https://github.com/tommikaikkonen/prettyprinter","commit_stats":{"total_commits":204,"total_committers":9,"mean_commits":"22.666666666666668","dds":0.1421568627450981,"last_synced_commit":"53ba5f934f24228315ef10898fc2b73370349696"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommikaikkonen%2Fprettyprinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommikaikkonen%2Fprettyprinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommikaikkonen%2Fprettyprinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommikaikkonen%2Fprettyprinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommikaikkonen","download_url":"https://codeload.github.com/tommikaikkonen/prettyprinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838446,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pretty","prettyprint","prettyprinter","print"],"created_at":"2024-08-01T16:01:52.643Z","updated_at":"2025-04-08T12:12:37.853Z","avatar_url":"https://github.com/tommikaikkonen.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"=============\nPrettyPrinter\n=============\n\nDocumentation_\n\nSyntax-highlighting, declarative and composable pretty printer for Python 3.5+\n\n.. code:: bash\n\n    pip install prettyprinter\n\n- Drop in replacement for the standard library ``pprint``: just rename ``pprint`` to ``prettyprinter`` in your imports.\n- Uses a modified Wadler-Leijen layout algorithm for optimal formatting\n- Write pretty printers for your own types with a dead simple, declarative interface\n\n.. image:: prettyprinterscreenshot.png\n    :alt:\n\n.. image:: ../prettyprinterscreenshot.png\n    :alt:\n\n.. image:: prettyprinterlightscreenshot.png\n    :alt:\n\n.. image:: ../prettyprinterlightscreenshot.png\n    :alt:\n\nPretty print common Python values:\n\n.. code:: python\n\n    \u003e\u003e\u003e from datetime import datetime\n    \u003e\u003e\u003e from prettyprinter import pprint\n    \u003e\u003e\u003e pprint({'beautiful output': datetime.now()})\n    {\n        'beautiful output': datetime.datetime(\n            year=2017,\n            month=12,\n            day=12,\n            hour=0,\n            minute=43,\n            second=4,\n            microsecond=752094\n        )\n    }\n\nAs well as your own, without any manual string formatting:\n\n.. code:: python\n\n    \u003e\u003e\u003e class MyClass:\n    ...     def __init__(self, one, two):\n    ...         self.one = one\n    ...         self.two = two\n\n    \u003e\u003e\u003e from prettyprinter import register_pretty, pretty_call\n\n    \u003e\u003e\u003e @register_pretty(MyClass)\n    ... def pretty_myclass(value, ctx):\n    ...     return pretty_call(ctx, MyClass, one=value.one, two=value.two)\n\n    \u003e\u003e\u003e pprint(MyClass((1, 2, 3), {'a': 1, 'b': 2}))\n    MyClass(one=(1, 2, 3), two={'a': 1, 'b': 2})\n\n    \u003e\u003e\u003e pprint({'beautiful output': datetime.now(), 'beautiful MyClass instance': MyClass((1, 2, 3), {'a': 1, 'b': 2})})\n    {\n        'beautiful MyClass instance': MyClass(\n            one=(1, 2, 3),\n            two={'a': 1, 'b': 2}\n        ),\n        'beautiful output': datetime.datetime(\n            year=2017,\n            month=12,\n            day=12,\n            hour=0,\n            minute=44,\n            second=18,\n            microsecond=384219\n        )\n    }\n\nComes packaged with the following pretty printer definitions, which you can enable by calling ``prettyprinter.install_extras()``:\n\n- ``datetime`` - (installed by default)\n- ``enum`` - (installed by default)\n- ``pytz`` - (installed by default)\n- ``dataclasses`` - any new class you create will be pretty printed automatically\n- ``attrs`` - pretty prints any new class you create with ``attrs``\n- ``django`` - pretty prints your Models and QuerySets\n- ``numpy`` - pretty prints numpy scalars with explicit types\n- ``requests`` - pretty prints Requests, Responses, Sessions, and more from the ``requests`` library\n\n* Free software: MIT license\n* Documentation: Documentation_.\n\n.. _Documentation: https://prettyprinter.readthedocs.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommikaikkonen%2Fprettyprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommikaikkonen%2Fprettyprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommikaikkonen%2Fprettyprinter/lists"}