Skip to main content

User interface for terminal.

Project description

Pitwi

PyPI GitHub issues Download Version python

Librairy for create user interface in terminal/console with XML, CSS and Python.

Aperçu

Only Python :

from pitwi import Root, Text

(
    Root(width = 45, height = 8)
    .add(Text('Puf', bg='white', fg='black'))
    .add(Text('Paf'), row=2, column=2)
    .run()
)

Python + XML/CSS :

<root width="45" height="8">
    <style>
        #pwik {
            bg: white;
            fg: black;
        }
    </style>
    <text id="pwik">Puf</text>
    <text row="2" column="2">Paf</text>
</root>
from pitwi import parser

parser.file('NAME_OF_YOUR_FILE.xml').run()

Weather

weather

weather.xml

File explorer

file_explorer

file_explorer.xml

Expression

expression

calcul.xml

Ramass'herbe

ramassherbe

rammassherbe.xml

Documentation

Text :

The text is between an opening and closing tag. <tag>text</tag>

The space in the beginning and the end are ignored.

<tag> pantoufle </tag> == <tag>pantoufle</tag>

The character { and } is used to use Python code online. Is same as f-string.

<tag>{f"Pomme {{poire}} fraise"}</tag> == <tag>Pomme {poire} fraise</tag>

The characters <, > is depreciated because XML not supported in text. Use escape character to use it. <tag>Puik \<puf\> paf</tag>

Selection :

Press Tab to select next element and Ctrl+Tab to select previous element.

Colors :

<root>
    <style>
        object {
            item: color;
        }
    </style>
</root>
<root>
    <style>
        .exemple {
            color: white;
            fg: blue;
            bg: red;
            border-color: yellow;
            active-border-color: cyan;
        }
    </style>
</root>

Dark

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • silver

Light

  • gray
  • pink
  • lime
  • banana
  • marlin
  • violet
  • teal
  • white

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pitwi-0.5.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file pitwi-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: pitwi-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.2

File hashes

Hashes for pitwi-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74aabdc01a547c6fa530ec34d1d13f42637557dd0df7e2e3d1fd8e8dc5e94660
MD5 eda02699b63e68746c2cbe90c9b001d9
BLAKE2b-256 4dee0a4506f81a4885cf7490e4861dee9083a3dc59347fb53e5ce29a13963b71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page