Skip to main content

Python project parser used to generate member trees for sphinx autosummary documentation.

Project description

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pthree-1.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pthree-1.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file pthree-1.0.1.tar.gz.

File metadata

  • Download URL: pthree-1.0.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pthree-1.0.1.tar.gz
Algorithm Hash digest
SHA256 fe815ff3dcdd338861f5b5043784643b94184868e99dd277d3ba42b5e5b0ac7a
MD5 81cec18a0a9a3a970294b228108ca125
BLAKE2b-256 f082d0fc45289cd1f552b75c5c4e1f6693acd9f29e0d032992323bacebd85cc4

See more details on using hashes here.

File details

Details for the file pthree-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pthree-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pthree-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 187e44c9ef0fef0d3192015b5f3143e8c6b2d9e11978b2d4bbf5d55df1a61195
MD5 814604b90fa53ccbc66d5a72b7c788bd
BLAKE2b-256 a9ee5b57ad9d59793d8b37ab2911ec5aed43404d327bd2ac4ebe657eed232a0a

See more details on using hashes here.

Supported by

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