Socket
Socket
Sign inDemoInstall

repple

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    repple

Quick and dirty fdisk-like REPLs


Maintainers
1

Readme

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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc