Skip to main content

Bolt A Cli Interface (onto your python functions)

Project description

WIP!! This is incomplete/theoretical examples!

baci - very simple cli framework (for the very lazy)

Got No time to learn and download a huge framework just to make some simple clis? Yeah me neither I got a board game meetup to get to after this!

Why not just write a bunch of vanilla python functions and let baci deal with the weird linux stuff?!

# cli.py

# this can already be a cli command!
def say_hello():
    # docstring adds a description to --help options
    """Prints hello to the screen"""
    print("hello lazy!")

if __name__ == '__main__':
    from baci import Baci
    baci = Baci(commands=(say_hello,))
    baci.run()
$ python cli.py say-hello
hello lazy!

But generally you would add an entrypoint to your cli that discovers all functions:

from baci import Baci

baci.autorun(dir="./commands")

All non-private defined functions in commands/ will be registerd in the cli

Prefix a function with a _ to be ignored. That's the only way.

philosophies

Be a strong, independent package who don't need no pypi

Dependencies means vulnerabilities, which means frequent patching and updating. WHO GOT TIME FOR DAT?

Write it all in-house.

Update like it's moving apartments

Would you move to a new studio bedroom every month?

Command line syntax hasn't changed for decades, what's there to update?

Make it feature complete and reliable.

The only exceptions are if there's a bug. Just like in your apartment, you would make the effort to get rid of bugs.

There's no zen here, bub!

We don't follow zen of python. Zen is nice but we live in the real world, ya dig? No bad-ass mf got time for explicitly stating everything. So just learn the conventions here once and save big on keystrokes!

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

baci-0.0.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

baci-0.0.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: baci-0.0.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for baci-0.0.1.tar.gz
Algorithm Hash digest
SHA256 02ae5213abaebdec329a8ee3cfa2d48b6aa19c382de45e9489fe219d7c281c2b
MD5 75143311b0632ebb17e86f66ac5d44d4
BLAKE2b-256 2e95f92c9c98c743857b0e4accdc67556c40c093f1789dc2a4114c7833a76da1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: baci-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for baci-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf69b57d6915554192b05394732d6cc83fcf76cc1346bffbc71d1536c485d8c5
MD5 79e9be439f05f0adf676ea5441b11a9a
BLAKE2b-256 13bb68baf7f58629a8b10f59ca7df3c58975cf43b67a0a31ade5ca1d3729271b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page