Git Product home page Git Product logo

naughtty's Introduction

NaughTTY

CircleCI codecov Documentation Status

NaughTTY is a CLI tool and Python package for running commands in a pseudo-terminal.

Full documentation is published at naughtty.readthedocs.io.

Installation

NaughTTY requires Python 3.8 or later and a compatible operating system.

pip install naughtty

NaughTTY requires the host operating system to support forking and pseudo-terminals. GNU/Linux is good. At the time of writing, Windows is not.

Basic CLI usage

naughtty APP > output-with-escape-codes.txt
naughtty APP | APP-THAT-USES-ESCAPE-CODES

For example:

naughtty pipenv --help > help.txt
naughtty pipenv --help | less

Full documentation is published at naughtty.readthedocs.io.

Basic Python usage

from naughtty import NaughTTY

ntty = NaughTTY(["pipenv", "--help"])
ntty.execute()
print(ntty.output)
Usage: \033[39m\033[1mpipenv\033[39m\033[22m [OPTIONS] COMMAND [ARGS]...

\033[39m\033[1mOptions:\033[39m\033[22m
  --where                         Output project home information.
  --venv                          Output virtualenv information.
  --py                            Output Python interpreter information.
  --envs                          Output Environment Variable options.
  --rm                            Remove the virtualenv.
  --bare                          Minimal output.
  --completion                    Output completion (to be executed by the
                                \033[33m\033[1m  shell\033[39m\033[22m).
...

Full documentation is published at naughtty.readthedocs.io.

๐Ÿ‘‹ Hello!

Hello! I'm Cariad Eccleston and I'm an independent/freelance software engineer. If my work has value to you, please consider sponsoring.

If you ever raise a bug, request a feature or ask a question then mention that you're a sponsor and I'll respond as a priority. Thank you!

naughtty's People

Contributors

cariad avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.