{"id":21116,"library":"delegator-py","title":"delegator","description":"Subprocesses for Humans 2.0, built on top of pexpect and shiv. Latest version 0.1.1 (unmaintained). No recent releases since 2015.","status":"deprecated","version":"0.1.1","language":"python","source_language":"en","source_url":"https://github.com/kennethreitz/delegator","tags":["subprocess","shell","pexpect","command-line"],"install":[{"cmd":"pip install delegator-py","lang":"bash","label":"default"}],"dependencies":[{"reason":"core dependency for subprocess handling","package":"pexpect","optional":false},{"reason":"core dependency for command dispatch","package":"shiv","optional":false}],"imports":[{"note":"direct function import may cause name collisions; import module and use delegator.run()","wrong":"from delegator import run","symbol":"delegator","correct":"import delegator"}],"quickstart":{"code":"import delegator\n\n# Run a command and get output\nc = delegator.run('echo hello')\nprint(c.out)  # hello\n\n# Interactive command with timeout\ntry:\n    c = delegator.run('python', timeout=3)\n    c.expect('>>>')\n    c.writeline('print(1+1)')\n    c.expect('2')\n    print(c.after)\nexcept Exception as e:\n    print(f\"Error: {e}\")","lang":"python","description":"Basic usage: run non-blocking subprocesses with output capture and interactivity."},"warnings":[{"fix":"Migrate to subprocess.run() or invoke.","message":"Library is no longer maintained. Consider using json, subprocess, or invoke instead.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure you call .block() or access .out after the process completes.","message":"delegator.run() returns a Command object immediately, not waiting for the process to finish. Access .block() or .out/.err to synchronize.","severity":"gotcha","affected_versions":"all"},{"fix":"Use on Unix-like systems or test thoroughly on Windows.","message":"On Windows, pexpect may not work; delegator may behave differently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install via pip install delegator-py, then use import delegator and delegator.run().","cause":"Incorrect import: trying to import run directly or wrong module name.","error":"AttributeError: module 'delegator' has no attribute 'run'"},{"fix":"Do not pass block=True; instead call .block() on the returned Command object.","cause":"delegator.run() does not have a block argument; it returns immediately.","error":"TypeError: run() got an unexpected keyword argument 'block'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}