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.1.0.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.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docu_lite_kit-0.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 40759ec80961d23a0ca65272ca08d11b7d488af7ce7871797eb4119932cca207
MD5 fa8dcf106d6ff51696c6771041b54a7c
BLAKE2b-256 2efc60d6bcaa95c60b2be5264fe17aae0d4bbf7df45e2063f5e847304f1ac62b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docu_lite_kit-0.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82a187ebb1096de1b6d925bcfa00bd8c7a0ca78397baf255502e18da5686c4d0
MD5 d2be00e986d746892aa4d50b93182ec9
BLAKE2b-256 12f075049a2fd2ea03f1f34527a4fe3a385efdb377dcff54f3c6f91f6138520c

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