GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dhondta/python-tinyscript: Devkit for quickly building CLI tools with Python

BranchesTags
Open more actions menu

Latest commit

 

History

909 Commits
909 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
src/tinyscript
src/tinyscript
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.readthedocs.yml
.readthedocs.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

TinyScript Tweet

Make a CLI tool with very few lines of code.

PyPi Read The Docs Build Status Coverage Status Python Versions Known Vulnerabilities License

This library is aimed to provide useful features and helpers in order to shorten the number of required lines of code for writing simple and nice-looking command-line interface tools. It is based on argparse and is considered a development kit, on the contrary of popular frameworks like cement, click or docopt, as it is not aimed to reinvent the wheel in yet another paradigm.

pip install tinyscript

💡 Philosophy

This library is built with the DRY (Don't Repeat Yourself) and KISS (Keep It Stupid Simple) philosophies in mind ; the whole machinery of Tinyscript holds in its star import (from tinyscript import *) and its initialization (with the initialize function).

It is aimed to shorten required code by setting a few things while loaded:

  • a proxy parser (coming from the star import) collects arguments definitions and formats help at initialization, preventing from rewriting the whole bunch of code needed to declare an ArgumentParser (and define its epilog, and so forth)
  • a main (colored) logger is preconfigured and can be tuned through two constants so that we don't care for writing a bunch of code needed to configure logging
  • preimports (while a bit anti-Pythonic, we confess) of common libraries also reduces the quantity of code required
  • among these, some modules are enhanced with new functions and classes that are not natively foreseen

Leveraging this allows to create very short scripts with only the real code that matters, reducing the code to be rewritten to create efficient, nice-looking and sophisticated CLI tools.

Note that, while star imports should be avoided according to Python's style guide (see PEP8), it is deliberately extensively used and covering a huge scope in order to shorten code length. This "anti-pattern" pays off after creating a few tools, when we can realize it shortens parts of the code that are often repeated from a tool to another (e.g. for shaping tool's help message).

😎 Usage

It is designed to be as simple and straightforward to use as possible. In order to learn and use it, you only need your browser (for consulting the documentation), a text editor and a good Python Interpreter (e.g. IDLE) for using auto-completion or an IDE like PyCharm to get helpers suggested.

The point is that you will use:

  • features, enabled by setting flags in the "master" function called ìnitialize
  • helpers, grouped under the "master" submodule called ts
  • reporting objects from the global scope

Please see the example tools herebelow for examples of usage of features, helpers and reporting.

⏩ Quick Start

Create from template

Edit source

Run your tool

🔍 Example tools

Security

  • AppMemDumper (Windows forensics)
  • Bots Scheduler (Web security services job scheduler)
  • DroneSploit (startup script)
  • Evil Pickle Creation Tool (Python evil pickle generation tool)
  • Malicious Macro Tester (malicious VB macro detection)
  • Paddinganograph (base32/64 padding-based steganography)
  • PDF Passwords Bruteforcer (bruteforce tool)
  • Solitaire Cipher (encryption)
  • StegoEMD (Exploiting Modification Direction))
  • StegoLSB (Least Significant Bit)
  • StegoPIT (Pixel Indicator Technique)
  • StegoPVD (Pixel Value Differencing)
  • STIX Report Generator
  • WLF (Word List Filter)

Utils

  • Audio Assembler
  • Documentation Text Masker
  • Email Origin
  • Loose Comparison Input Generator (PHP Type Juggling)
  • PDF Preview Generator
  • Recursive Compression
  • WebGrep (Web text search)
  • Zotero CLI

👏 Supporters

Stargazers repo roster for @dhondta/python-tinyscript

Forkers repo roster for @dhondta/python-tinyscript

Back to top

About

Devkit for quickly building CLI tools with Python

Topics

clicli-toolkitctf-toolsdevelopmentdevkitprogrammingpythonradtinyscript

Resources

Readme
GPL-3.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

56 stars

Watchers

3 watching

Forks

9 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.