Skip to main content

Zhusk:

ZHusk, a library to streamline workflows and assist those who work extensively with the terminal and more.

Version:

Zhusk Version: 0.1.1

Installation:

pip install zhusk

To Update:

pip install --upgrade zhusk

Requirements:

Minimum Python version required: 3.8

Minimum Python version tested: 3.12.3

Libraries Used:

sys

To assist the 'termios' library.

time

For animated typing functions.

platform

To determine which operating system it is.

subprocess

To run commands such as IP discovery.

termios

It is only imported if the system is macOS/Linux and the user employs a function that requires it.

Functions:

block()

This turns off terminal 'ECHO', preventing the terminal from immediately displaying what is typed—everything goes into the keyboard buffer instead; unless used in conjunction with the 'ignore' function, everything previously typed will appear as soon as 'unblock' is used.

Only MacOS and Linux.

Usage example:

import zhusk

zhusk.block()

print("Hello world")

unblock()

Typically used when you want to use an 'input()' function; you can also use 'input_slow(support=True)'—simply include a 'block()' at the beginning of the code, and you won't need to worry about it.

Only MacOS and Linux.

Usage example:

import zhusk
import time

zhusk.block()

print("Hello world")
time.sleep(2) # If you try to type during this time, nothing will happen (if 'block' weren't called, the terminal would end up very messy).

zhusk.unblock()
zhusk.input_slow("Your name: ") # Since 'support=True' was not used, you had to handle the top and bottom lines manually. Apart from that, without using 'ignore()', everything the user typed during those 2 seconds will appear here.
zhusk.block()

ignore()

This clears the user's keyboard buffer, ensuring that multiple characters that had not appeared due to the 'block' function are not displayed upon receiving new 'input'.

Only MacOS and Linux.

Usage example:

import zhusk

zhusk.block()

print("Hello world")
zhusk.ignore()
zhusk.unblock() # Basically, following this logic, if the user jumped onto the keyboard, your program and the input would still appear in an organized way.
input("Your name: ")

clear()

Clears the terminal, quickly and simply.

Windows, MacOS and Linux.

Usage example:

import zhusk

zhusk.clear() # If the guy's terminal was dirty, this would have cleaned it.
print("Hello world")

my_ip()

Shows your public IPV4 or IPV6.

Windows, MacOS and Linux.

Usage example:

import zhusk

print("My cyber program")
print(f"Your IPV4 is: {zhusk.my_ip()}") # Shows IPV4.

print_slow()

It displays text letter by letter in an animated fashion, creating a typing effect that you will likely want to use throughout the entire system.

Windows, MacOS and Linux.

Usage example:

import zhusk

zhusk.print_slow("Hello world")
zhusk.print_slow("Hello world", temp=0.01) # The default 'temp' is 0.02, but you can change it.

input_slow()

It displays text letter by letter in an animated fashion, creating a typing effect; and at the end, it returns an 'input()'.

Windows, MacOS and Linux.

Usage example:

import zhusk

zhusk.input_slow("Your name: ")
zhusk.input_slow("Your country: ", temp=0.01) # The default 'temp' is 0.02, but you can change it too.

General Example (Windows, MacOS, Linux):

import zhusk

zhusk.clear() # Clears terminal.

zhusk.print_slow("\nHello user, this is a security system")
name = zhusk.input_slow("\nType your name: ")
zhusk.print_slow(f"\nSure, {name}.\nYour public IPV4 is: {zhusk.my_ip()}\nYour public IPV6 is: {zhusk.my_ip(ipv4=False, ipv6=True)}")

General Example (MacOS, Linux):

import zhusk

zhusk.block() # Now the user cannot clutter the terminal while your program is running.
zhusk.clear() # Clears terminal.

zhusk.print_slow("\nHello user, this is a security system.")
name = zhusk.input_slow("\nType your name: ", support=True) # Set support to True so the code releases the block(), and reapplies it once the input finishes — that simple.
zhusk.print_slow(f"\nSure, {name}.\nYour public IPV4 is: {zhusk.my_ip()}\nYour public IPV6 is: {zhusk.my_ip(ipv4=False, ipv6=True)}")

Error Handling:

ZHusk only raises errors of type 'ZhuskError'; the recommended approach is to read the error message and act accordingly, but if you'd rather ignore it, you can do so as follows:

import zhusk

try:
    zhusk.my_ip(ipv4=True, ipv6=True) # This triggers ZhuskError; it can only receive IPV4 or IPV6, not both.
except zhusk.ZhuskError:
    pass

License and Author:

This project is licensed under the MIT License. See the LICENSE file for details.

Zhusk Project - By FloppzH

Support:

Discord Contact: floppzh

If you have any problems, questions, suggestions, or anything else, feel free to get in touch.

Links:

Repository: https://github.com/D3LT4-1NCK/ZHusk

Download files

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

Source Distribution

zhusk-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhusk-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zhusk-0.1.1.tar.gz.

File metadata

  • Download URL: zhusk-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for zhusk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 827c6bccd8788980e63dd23feabbe79d3fa17d8ae5fbb49c4f36a6de44613dc4
MD5 96d5fb12de85ad07cff7414db04f7878
BLAKE2b-256 275798701785206a7fdbbc905e4f1b9a3e9e14db925aad7baca39510a1bb7f34

See more details on using hashes here.

File details

Details for the file zhusk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zhusk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for zhusk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e88433367ae04d9866ac4ba971d99d1bb619111765f14349a5d561f1729485c
MD5 c8bd2f9d344f40e33b755c4cf4c50218
BLAKE2b-256 42396b0eff32fe03af4a11e61388b1adec39a71e5cb6e1d0bbddcbfd9b1f8cc9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 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