Skip to main content

🧾 pybonsai: Ultra-light Python code parser with optional cli and JSON output

Reason this release was yanked:

incorrect details

Project description

Docu-lite-kit

Standalone cli/importable components inspired by docu-lite

The first component here is the ultra-light Python parser:

  • Rewritten to be more robust around docstrings
  • Packaged to be useable from the command line or imported as a module into other code
  • Soon to replace the parser used within docu-lite

Current plans / ideas:

  • Add standalone / importable docu-lite-like html rendering components
  • Add standalone / importable API delta checkers

Screenshots

Capture

🛠 Installation

Install using pip: open a command window and type

pip install docu-lite-kit

💡 Usage

Command line:

docu-lite-kit.cli [-h] [--out] [--noprint] input.py
  • -h = show help
  • --out specifies the output file (JSON format)
  • --noprint = don't print the basic printout to the console

Imported as a module:

import pybonsai

Provides the following three interfaces (see demo_minimal.py):

    input_file = r"./demo_minimal.py"
    # parse the doc looking for objects matching a,b,c,d:
    # parser = pybonsai.pbIO(input_file, [ pattern_list =  [a,b,c,d] ])
    # For the pattern list, docstring and body are implied & don't need to be mentioned.
    # The pattern list itself is optional and defaults to ['class', 'def']
    parser = pybonsai.pbIO(input_file)

    # print out the result including the elements a,b,c,d:
    # parser.pbPrint([a,b,c,d])
    # This time 'docstring' and 'body' do need to be explicitly mentioned if wanted in the printout
    # However pattern list is optional and defaults to ['class', 'def', 'docstring']
    # parser.pbPrint( pattern_list = ['def', 'class', 'docstring', 'body'])
    parser.pbPrint(['def', 'class', 'docstring', 'body'])

    # Similar to pbPrint, this dumps the output to a JSON file:
    # parser.pbDumpJSON(JSON_file = 'pybonsai.JSON', pattern_list = ['def', 'class', 'docstring'])
    parser.pbDumpJSON()

PyPI link

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

docu_lite_kit-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

docu_lite_kit-0.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file docu_lite_kit-0.0.1.tar.gz.

File metadata

  • Download URL: docu_lite_kit-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for docu_lite_kit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ec63dd77f7521297f93de42b1d0252080d311f7cb66a723c104345dd8a619bf7
MD5 6b6500672ab883e65241331dbe91483d
BLAKE2b-256 e3aa2a6771171eb389a8ac4bc9c3ba4008d1f27de77a9db77ed70e6e82169991

See more details on using hashes here.

File details

Details for the file docu_lite_kit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: docu_lite_kit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for docu_lite_kit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2637def0576daaaa292abfc88b4de07c13b0e60dc55e30deb814b74ecf513dee
MD5 c1472399f102b4d7fb39256c26ee3afe
BLAKE2b-256 23b384ef191bb2cc622eae4f2be006330c542b43c1a065347de76a44137916e8

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