Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.1 instead.
Reason given by maintainers: Not working.

Zhusk:

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

Version:

Zhusk Version: 0.1.0

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.0.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.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zhusk-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 f97a48fc0a58dc6b76edf9ec8f6f2f87e9a0b4cb9c5e2c0b821d4c319a23beb2
MD5 3b72864a1221decb87814ffc35edad0c
BLAKE2b-256 cf79dada256c169fe16706007040bcdce6648257cd2a02f7e91b90d7c9f46a91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zhusk-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f831ba6ec42a4c3deaaa4feaef7512c6215ca57e6431534241bc7ab3b05f504c
MD5 e4130def5eef220257cce84da0e59143
BLAKE2b-256 fac293d3f397224f6b4280912f7a26ca9aa033e4f5f31058b64ff9100d0ae299

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

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