{"id":20551590,"url":"https://github.com/clarketm/pprintast","last_synced_at":"2025-04-14T11:30:50.221Z","repository":{"id":62577996,"uuid":"160030128","full_name":"clarketm/pprintast","owner":"clarketm","description":"An AST pretty printer for Python 🐍","archived":false,"fork":false,"pushed_at":"2019-02-11T03:28:14.000Z","size":85,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T00:44:01.746Z","etag":null,"topics":["ast","ppast","pprint","pprintast","python"],"latest_commit_sha":null,"homepage":"https://pprintast.readthedocs.io/en/latest/","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/clarketm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-02T09:02:09.000Z","updated_at":"2023-07-07T13:28:43.000Z","dependencies_parsed_at":"2022-11-03T19:37:21.568Z","dependency_job_id":null,"html_url":"https://github.com/clarketm/pprintast","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarketm%2Fpprintast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarketm%2Fpprintast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarketm%2Fpprintast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarketm%2Fpprintast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clarketm","download_url":"https://codeload.github.com/clarketm/pprintast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591539,"owners_count":21130054,"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":["ast","ppast","pprint","pprintast","python"],"created_at":"2024-11-16T02:32:21.168Z","updated_at":"2025-04-14T11:30:50.185Z","avatar_url":"https://github.com/clarketm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [pprintast](https://pprintast.readthedocs.io/en/latest/)\n\n[![PyPi release](https://img.shields.io/pypi/v/pprintast.svg)](https://pypi.org/project/pprintast/)\n[![PyPi versions](https://img.shields.io/pypi/pyversions/pprintast.svg)](https://pypi.org/project/pprintast/)\n[![Downloads](https://pepy.tech/badge/pprintast)](https://pepy.tech/project/pprintast)\n[![Documentation Status](https://readthedocs.org/projects/pprintast/badge/?version=latest)](https://pprintast.readthedocs.io/en/latest/?badge=latest)\n\nAn AST (abstract syntax tree) pretty printer for Python 🐍.\n\n[Check out the pprintast docs](https://pprintast.readthedocs.io/en/latest/)\n\n## Installation\n\n```bash\n$ pip install pprintast\n```\n\n## Usage\n\n```text\n\nusage: pprintast.py [-h] [-a] [-c cmd] [-m mode] [-t] [-v] [file]\n\nA pretty-printing dump function for the ast module. The code was copied from the ast.dump function\nand modified slightly to pretty-print.\n\npositional arguments:\n  file                   program passed in as file\n\noptional arguments:\n  -h, --help             show this help message and exit\n  -a, --attributes       include attributes such as line numbers and column offsets\n  -c cmd, --command cmd  program passed in as string\n  -m mode, --mode mode   compilation mode (choices: exec, eval, single) (default: exec)\n  -t, --terse            terse output by disabling field annotations\n  -v, --version          show program's version number and exit\n\n```\n\n### Script\n\nPretty print AST from a **file** using the `pprintast` CLI.\n\n```bash\n$ pprintast \"./path/to/script.py\"\n```\n\nPretty print AST from a **string** using the `pprintast` CLI.\n\n```bash\n$ pprintast -c \"lambda a: a**2\"\n```\n\n### Module\n\nPretty print AST from a **string** using the `pprintast` module.\n\n```python\n\n# 1. import the \"pprintast\" function.\nfrom pprintast import pprintast as ppast # OR: from pprintast import ppast\n\n# 2. pretty print AST from a \"string\".\nexp = \"lambda a: a**2\"\n\nppast(exp)\n\n```\n\n![stdout](https://raw.githubusercontent.com/clarketm/pprintast/master/pprintast.png)\n\n## License\n\nMIT \u0026copy; [**Travis Clarke**](https://blog.travismclarke.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarketm%2Fpprintast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclarketm%2Fpprintast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarketm%2Fpprintast/lists"}