🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

repple

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repple

Quick and dirty fdisk-like REPLs

0.3.4
PyPI
Maintainers
1

Repple

Quick and dirty opinionated fdisk-style REPLs

  • Whitespace-separated command and arguments
  • Except unary string functions
  • Selector prompt
from repple import Repple
r = Repple()
r['a'] = (lambda x: print(x+1), "Adds one to first argument and prints it")
r['A'] = lambda x: print(x+2)
def variadic_fn(*args):
  print(*[a+1 for a in args])

r.main()

Command: h
        q               Exits the program
        h               Show this help
        a <x>           Adds one to first argument and prints it
        A <x>
        b <args>
Command: a 1
2
Command: A 1
3
Command: b 1 2
2 3

Selector

from repple import Repple
r = Repple()
r['a'] = lambda: print(Repple.selector(['a','b','c']))
r.main()

Command: a
        1: a
        2: b
        3: c
Select your items: 1 3
['a', 'c']

Unary string function

from repple import Repple
r = Repple()
r.add_string_func('p', lambda x: print(x))
r.main()

Command: p Hello world!
Hello world!

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts