Skip to main content

Xacto

CLI Analyzer/Generator

Introspect, compose, marshal and export arbitrary callables into a unified, hierarchical, command-line interface (CLI)

Features

auto-find tools scan signatures and export as CLI node

Why

FAST! EASY! natural import usage! --help is decent!

Quickstart

  1. Install:

    # pip install xacto
  2. Prepare:

    # ln -s $(which xacto) do
  3. Create python file at tools/work.py:

from pprint import pprint


__all__ = ["easy", "hard", "manual"]


def easy(method, speed=16, *tasks):
    """The simple version"""
    pprint(locals())


def hard(method, speed=32, *tasks, **params):
    """The difficult version"""
    pprint(locals())


class manual(object):
    """The laborious version"""

    def __call__(self, method, speed, *tasks):
        pprint(locals())

    def method(self, process):
        """Howto perform operation"""

    def speed(self, ops=64):
        """Operations per second"""

    def tasks(self, pri, sec, ter):
        """Various tasks"""
  1. View --help:

    # ./do work --help
    usage: do work OBJECT ...
    
    additional modules:
      OBJECT  := { .do.work }
        easy  The simple version
        hard  The difficult version
        manual
              The laborious version
  2. View object-level --help:

    # ./do work manual --help
    usage: do work manual --method PROCESS --speed [OPS] [tasks [tasks ...]]
    
    The laborious version
    
    positional arguments:
      tasks             Various tasks
    
    optional arguments:
      --method PROCESS  Howto perform operation
      --speed [OPS]     Operations per second
    
    The laborious version
  3. Run tool (function):

    # ./do work hard --method=cheat --code=iddqd taskN
    {'method': 'cheat',
     'params': {'code': 'iddqd'},
     'speed': 32,
     'tasks': ('taskN',)}
  4. Run tool (class):

    # ./do work manual --method=cheap --speed=256 taskN
    {'method': 'cheap',
     'self': <do.work.manual object at ...>,
     'speed': '256',
     'tasks': ('taskN',)}

Limitations

  • true/false quirkyness (default=True means –default flips to False)

TODO

  • RELEASE!

  • testing: set-like functions, import semantics.. everything

  • handle bools better

  • detect output

  • standard output structure

  • prettify to tty

  • lazy load tools

  • lazy import globals (cpython)

  • bytecode cache

  • argument forwarding/chaining

  • integrate with zippy.shell

  • tab-completion

  • auto-reduce common components for aliases

  • make xacto object accessible to tools

Metadata

Release files for xacto 0.8.7

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

Source distribution (sdist)

Source distribution for xacto 0.8.7
File Size Uploaded
xacto-0.8.7.tar.gz 15.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for xacto 0.8.7
File Interpreter ABI Platform
xacto-0.8.7-py3-none-any.whl Python 3 none any Details
xacto-0.8.7-py2-none-any.whl Python 2 none any Details

Total release size: 45.6 kB

Release files / xacto-0.8.7.tar.gz

Download URL xacto-0.8.7.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1a1447f54167ede5be20a62d7c75b92bf690abc91cae68a4f1cf89f5a137f2d
BLAKE2b-256 checksum
How to use checksums
3edcd05b1c869df146422bd656328c0e041c44437c5a86e30bace2f8e6dd249e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / xacto-0.8.7-py3-none-any.whl

Download URL xacto-0.8.7-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30e124ec9a6b1f82d25c7894dfaefe01c539adbc4baa555efdace964b7570e71
BLAKE2b-256 checksum
How to use checksums
5e8d4b5e48223a90b99f2f2ab25fe437061e97adcde2e26b39fbef2f89e12aa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / xacto-0.8.7-py2-none-any.whl

Download URL xacto-0.8.7-py2-none-any.whl
Size 15.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
b126bdd53ec9caa4a772bc08289d8bde603d5680d2a80ac4b80aca1452ae2fd3
BLAKE2b-256 checksum
How to use checksums
ebb945c308286a04be0cede51dbd9f35b0ed02095614f3d397df2182e7e2af53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.8.7 This release

3 release files

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.6.3

1 release file

0.6.2

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