Skip to main content

✨ Ter-FX 2.0.0

Build beautiful terminal applications with ease.

Ter-FX is a lightweight, beginner-friendly Python package for building modern terminal applications. Whether you're creating shell emulators, installers, command-line tools, automation scripts, or games, Ter-FX provides colorful output, logging, terminal effects, system utilities, and command decorators to make development simple.


Features

  • 🎨 ANSI color support
  • 🖨️ Colored terminal printing
  • ⌨️ Interactive input
  • 🔢 Number input validation
  • 🔒 Hidden password input
  • 📍 Centered text
  • ⌛ Typewriter effect
  • 🌀 Animated spinners
  • 📊 Progress bars
  • ⏳ Loading screens
  • 📝 Logging utilities
  • 💻 Built-in system utilities
  • 🧩 Command decorator
  • ⚡ Lightweight
  • 🐍 Pure Python

Installation

pip install ter-fx

Quick Start

from terfx import console

console.printin("Hello, World!", "green")

Output

Hello, World!

Importing

Import everything:

from terfx import *

Or import only what you need:

from terfx import console, log, sys, cmd

Console

Print Text

console.printin("Hello!", "green")

Typewriter Effect

console.printout(
    "Welcome to Ter-FX!",
    "cyan",
    speed=0.03
)

User Input

name = console.input(
    "Enter your name: ",
    "yellow"
)

Number Input

age = console.numinput(
    "Enter your age: "
)

Supports both integers and decimal numbers.


Password Input

password = console.passinput(
    "Password: "
)

Center Text

console.printcenter(
    "Welcome!",
    "magenta"
)

Effects

Spinner

console.spinner(
    "Loading",
    3,
    "cyan"
)

Loading Screen

console.loadscr(
    "Installing",
    5,
    "green"
)

Progress Bar

for i in range(101):
    console.progress(i, 100)

Log

Info

log.info("Connecting...")

Success

log.success("Connected!")

Warning

log.warning("Low memory!")

Error

log.error("Connection failed!")

Debug

log.debug("Variable x = 42")

Sys

The new sys module provides simple wrappers around common operating system tasks.

Run Commands

sys.cmd("ipconfig")

Capture command output:

output = sys.cmd(
    "ipconfig",
    capture=True
)

print(output)

Clear Terminal

sys.clear()

Current Directory

print(sys.cwd())

Change Directory

sys.chdir("Documents")

List Files

print(sys.listdir())

Check if a File Exists

if sys.exists("hello.txt"):
    log.success("File found!")

Create a Folder

sys.mkdir("Projects")

Rename

sys.rename(
    "old.txt",
    "new.txt"
)

Copy

sys.copy(
    "main.py",
    "backup.py"
)

Move

sys.move(
    "backup.py",
    "Archive/"
)

Command Decorator

Ter-FX includes the @cmd decorator for creating clean command handlers.

from terfx import cmd

@cmd
def hello(parts):
    print(parts[0])
    print(parts[1])
    print(parts.rest)

hello(["hello", "world"])

Output

hello
world
['world']

The decorator automatically converts the argument list into a Part object.

Part provides:

Property Description
parts[0] First argument
parts[1] Second argument
parts.count Number of arguments
parts.rest Remaining arguments
len(parts) Number of arguments

Example:

@cmd
def install(parts):

    if parts.count < 2:
        log.error("No package supplied.")
        return

    package = parts[1]

    if package == "dir":
        log.success("Installing directory package...")

Available Colors

black
red
green
yellow
blue
magenta
cyan
white

Example

console.printin(
    "Blue Text",
    "blue"
)

Complete Example

from terfx import *

console.printcenter(
    "Ter-FX 2.0 Demo",
    "cyan"
)

name = console.input(
    "Enter your name: ",
    "green"
)

console.printout(
    f"Welcome {name}!",
    "yellow"
)

console.spinner(
    "Loading",
    2
)

for i in range(101):
    console.progress(i, 100)

sys.clear()

log.success("Finished!")

Requirements

  • Python 3.9+
  • Windows
  • Linux
  • macOS

Roadmap

Planned features:

  • Tables
  • Boxes
  • Menus
  • Terminal UI Widgets
  • RGB Colors
  • Cursor Control
  • Text Styling
  • Better CLI Framework
  • More Decorators
  • File Utilities
  • Networking Utilities

Contributing

Contributions are welcome!

You can help by:

  • Reporting bugs
  • Suggesting new features
  • Improving documentation
  • Optimizing performance
  • Creating examples

License

This project is licensed under the MIT License.


Author

Faizan-ur-Rahim

Created with ❤️ using Python.

Metadata

Release files for Ter-FX 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Ter-FX 1.1.0
File Size Uploaded
ter_fx-1.1.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Ter-FX 1.1.0
File Interpreter ABI Platform
ter_fx-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / ter_fx-1.1.0.tar.gz

Download URL ter_fx-1.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7433b28686800ffec3413e4513a36c5ff7ff6a186dfe0a881500e5bd4538e326
BLAKE2b-256 checksum
How to use checksums
8d797bab445c5139b5654f8ffd2ff369deadec95f9eafbd45af8acd03bda9f48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / ter_fx-1.1.0-py3-none-any.whl

Download URL ter_fx-1.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f253291b233a3ea1e81cb51992f4adc180c060e90b9941bc798f3768f8f834f9
BLAKE2b-256 checksum
How to use checksums
a1c0fef4034e46b6f1d93d25accca11dffa6ffe53b346d6a049523eaaf22b46a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page