Skip to main content

Modules for my scripts.

Project description

huik-module

python version Alt text

How to install:

    pip install huik-module

Command Line Interface Usage

Command Line Interface are built with Click.

Use command --help for built in help info.

tool list module tl

Tool list (tl) provide a way to make user defined shortcuts for frequently used shell commands.

  • tl to start tool list.

  • tl --help to show help menu.

  • tl [command key] to quickly invoke saved shell command.

    Hint: Shell commands are ran in a new process, if a command is changing shell behavior this change will not be reflected in the current shell. If user want to retain such behavior, one way to use exec shell or exec zsh at the end of command. (see folder module for example)

folder module fd

Folder (fd) can mark folder as favorites and let user quickly navigate to that folder in terminal.

  • fd [favorite folder shortcut] cd to saved folder.

  • fd -c config use bash or zsh as default shell.

    Under the hood, fd uses python subprocess to run shell script.

    subprocess.run("cd /path/to/folder;exec zsh",shell=True,)
    

    The subprocess start another process and run shell command. Without exec zsh, after the subprocess exits, the current shell will remain in the same folder. exec zsh or exec bash start a shell in the subprocess and allow user input in that process.

OK module ok

OK module let user write / install plugins to extend its function.

OK module also manages to import/export/sync configuration and plugins.

Some included plugins are: Dictionary def; calculator cal; github tools git

One would need to use plugins if simple shell command is not sufficient in certain complex using scenarios. For example, to handle user inputs or pull data from the web.

  • ok or ok --help to show help menu.
  • ok sync to configure Github gist id and user token for upload settings to github. User token is not needed for download public gist settings but required for create/upload settigns.
  • ok [command] to run plugin commands.
  • ok plugins --help to show help menu for configure plugins.
  • ok plugins -sf or --show-folder show plugins folder.

Plugins

Plugins are single python files and stored under cli/plugins folder. These individual files are read and loaded at runtime.

Basic structure:

import click 
# other imports if needed 

@click.command() # optionally use click.group() to allow multicommands.
@click.option('--option') # add other options or arguments if needed.
def cli(option):
    """
    Documents
    """
    # handle option 

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

huik-module-0.1.2.tar.gz (18.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

huik_module-0.1.2-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

huik_module-0.1.2-py2-none-any.whl (22.0 kB view details)

Uploaded Python 2

File details

Details for the file huik-module-0.1.2.tar.gz.

File metadata

  • Download URL: huik-module-0.1.2.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for huik-module-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a80cc29e4c82c5a4ea2a5efc170d3f28481a9dd91793d4ec42cd56d3e941e262
MD5 d5478f13bce3478836d9d418304456f3
BLAKE2b-256 23663b7f72d1ba2d184dea3eaafa396122b8821c7049210e165d163c9540ca25

See more details on using hashes here.

File details

Details for the file huik_module-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: huik_module-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for huik_module-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30794262a82d7a9732a98dce8baf5a045ec2725894e44677751fc9809358363b
MD5 69c11ae635bcd4fad5567de677fe03cf
BLAKE2b-256 63709234083eb5897ab3296989ed0a52fd700e9074af8962672f409b58fa47ec

See more details on using hashes here.

File details

Details for the file huik_module-0.1.2-py2-none-any.whl.

File metadata

  • Download URL: huik_module-0.1.2-py2-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for huik_module-0.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 93ca375b58ef7428f2cae3eff22e92a892fe64f97c3da13bbfcacb228e5c48b8
MD5 6b8c27fcd0c4bab643c43712301e12ff
BLAKE2b-256 49ee18a696b542963ff33fa541e83ccc64974785cc067dd73d9295eac379bae2

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