Skip to main content

pybasemkit

Python base module kit: YAML/JSON I/O, structured logging, CLI tooling, shell execution, and remote pydevd debug support.

PyPi PyPI Status License pypi format downloads
GitHub Github Actions Build Release Contributors Last Commit GitHub issues GitHub closed issues
Code style-black imports-isort
Docs API Docs formatter-docformatter style-google

Docs and Tutorials

Wiki

CLI Tooling

basemkit.base_cmd.BaseCmd is the standard base class for every BITPlan command line interface. It provides the house-standard options -a/--about, -d/--debug, --debugServer/--debugPort (remote pydevd), -f/--force, -q/--quiet, -v/--verbose and -V/--version plus consistent exit codes (0 = OK, 1 = KeyboardInterrupt, 2 = Exception). Downstream projects must subclass it instead of using plain argparse.

The canonical pattern - a Version dataclass and a BaseCmd subclass:

from dataclasses import dataclass

from basemkit.base_cmd import BaseCmd

import mytool


@dataclass
class Version:
    """Version information for mytool."""

    name: str = "mytool"
    version: str = mytool.__version__
    date: str = "2026-08-02"
    updated: str = "2026-08-02"
    description: str = "what mytool does"
    authors: str = "Wolfgang Fahl"
    doc_url: str = "https://wiki.bitplan.com/index.php/Mytool"
    chat_url: str = "https://github.com/WolfgangFahl/mytool/discussions"
    cm_url: str = "https://github.com/WolfgangFahl/mytool"


class MytoolCmd(BaseCmd):
    """mytool command line interface."""

    def __init__(self):
        super().__init__(Version())

    def add_arguments(self, parser):
        """Add tool arguments to the given parser."""
        super().add_arguments(parser)
        parser.add_argument("--input", help="input file")

    def handle_args(self, args) -> bool:
        """Handle parsed arguments."""
        handled = super().handle_args(args)
        if not handled and args.input:
            # tool logic here
            handled = True
        return handled


def main(argv=None) -> int:
    """CLI entry point."""
    cmd = MytoolCmd()
    exit_code = cmd.run(argv)
    return exit_code

Register the entry point in pyproject.toml:

[project.scripts]
mytool = "mytool.mytool_cmd:main"

Live examples: gov-service, ProfiWiki, djvu-viewer, ngwidgets.

Metadata

Release files for pybasemkit 0.2.6

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

Source distribution (sdist)

Source distribution for pybasemkit 0.2.6
File Size Uploaded
pybasemkit-0.2.6.tar.gz 38.4 kB Details

Built distribution (wheel)

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

Total release size: 64.9 kB

Release files / pybasemkit-0.2.6.tar.gz

Download URL pybasemkit-0.2.6.tar.gz
Size 38.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b13ea68341905fd942dd8a2c78bbf5e4b1d8bd3655c00ffee35ec6ac269fa3e2
BLAKE2b-256 checksum
How to use checksums
c8c7343853b2fff45259723cf75f82cc9c8a9a5e59e671ea7295dc70740d69ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / pybasemkit-0.2.6-py3-none-any.whl

Download URL pybasemkit-0.2.6-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26e88992a5836baa6dedaed424c2ba559340722347d9a9f38977e915b36cf07e
BLAKE2b-256 checksum
How to use checksums
fefb3be4058d4fa38e750f2815820a5163c177ba0edb73ba5199ba0e914605bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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