Skip to main content

🧾 docu-lite-kit: Ultra-light cli/importable Python code parser tools

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: docu_lite_kit-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 903109df2e52c597d6ca2189c8349e81996b972f7b31805d84a3aa64827f04dd
MD5 c75de4ed7fee89380085962405386a9c
BLAKE2b-256 899980d9aa21fac1af844e02d875cb8576fe7de8eedc0db2d5f3b2b8bd3c383c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docu_lite_kit-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 191261cafe821ddde85eb77f6e902fa7cbf092d153a632b141bfa06c66e1c5ff
MD5 dcbf3c1ea138e538f6bb3582e2797147
BLAKE2b-256 dae4c63714bb5aa439b82bc39aadadd0ec4d9e0aa59bc40c58b877bee5ae34ca

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