Skip to main content

A simple project parser for Python.

This package is designed to be a lightweight, dependency-free tool for parsing project trees using python’s built-in ast, importlib, and inspect modules. It was originally developed as a series of helper functions used to generate ASTs which could be passed to Sphinx’s sphinx.ext.autosummary extension; I have since extracted it into its own package for easier reuse viz. so that it can be injected into other documentation projects.

Installation

You can install the package directly from PyPI using pip:

pip install pthree

Examples

Here is a simple example demonstrating how to use the package to parse a project tree:

import json
from pthree import build_node_tree, node_tree_to_dict


node_tree = build_node_tree(json)
node_dict = node_tree_to_dict(node_tree)

print(json.dumps(node_dict, indent=2, sort_keys=False, ensure_ascii=False))

Metadata

Release files for pthree 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pthree 1.0.1
File Size Uploaded
pthree-1.0.1.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pthree 1.0.1
File Interpreter ABI Platform
pthree-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.8 kB

Release files / pthree-1.0.1.tar.gz

Download URL pthree-1.0.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fe815ff3dcdd338861f5b5043784643b94184868e99dd277d3ba42b5e5b0ac7a
BLAKE2b-256 checksum
How to use checksums
f082d0fc45289cd1f552b75c5c4e1f6693acd9f29e0d032992323bacebd85cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release files / pthree-1.0.1-py3-none-any.whl

Download URL pthree-1.0.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
187e44c9ef0fef0d3192015b5f3143e8c6b2d9e11978b2d4bbf5d55df1a61195
BLAKE2b-256 checksum
How to use checksums
a9ee5b57ad9d59793d8b37ab2911ec5aed43404d327bd2ac4ebe657eed232a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page