Skip to main content

Python library simplifying system script management with handy functions like clearing the console, setting the window title, and detecting the operating system (Windows, Linux, macOS).

Project description

contsys

Python library simplifying system script management with handy functions like clearing the console, setting the window title, and detecting the operating system (Windows, Linux, macOS).

By G-Azon 🇫🇷

Features

  • CMD:

    • CMD.clear clears the console screen.
    • CMD.title([TITLE]) changes the title of the console screen to the specified title.
  • system:

    • system.iswin32() returns True if the current OS is Windows, and return False if the current OS is not Windows.
    • system.linux() returns True if the current OS is Linux Based, and return False if the current OS is not Linux Based.
    • system.isdarwin() returns True if the current OS is MacOS, and return False if the current OS is not MacOS.
    • system.isadmin() returns True if the script is executed as root, and returns False if the script is not executed as root.
    • system.runasadmin([TARGET], [ARGS]) run the specified python script as root.
  • monitor:

    • monitor.cpu_usage() returns the current cpu usage in percent.
    • monitor.ram_usage() returns the current virtual memory usage in percent.

Installation

You can install contsys using pip:

pip install contsys

License

This project is under the MIT License.

Contact

If you have any trouble or you want to suggest an improvement you can contact me at G-Azon782345@protonmail.com

Changelog

  • 1.2.4

    • Fixed monitor.cpu_usage() & monitor.ram_usage()
  • 1.2.3

    • Changed monitor.cpu_usage() & monitor.ram_usage() : they now return the percentage as a number, without the percent symbol.
  • 1.2.2

    • Added version the 1.2.1 in the changelog. (i forgotten it)
    • Improved the changelog by bolding change types.
    • Fixed an issue where the SSH indicator was still displayed even when ssh_indicator was not specified and the program was not running over an SSH connection.
  • 1.2.1

    • Added an option to CMD.title(): it now displays an indicator if the program is running over an SSH connection. This can be disabled by setting ssh_indicator = False.
  • 1.2.0

    • Added system.isadmin() system.runasadmin()
  • 1.1.3

    • Added the MIT license in LICENSE
  • 1.1.2

    • Small improvements in the description in the Changelog section
  • 1.1.1

    • Added monitor.cpu_usage() monitor.ram_usage().
    • Added the changelog section.
    • Added a new required dependency: psutil
  • 1.0.2

    • Added a better description.
  • 1.0.1

    • Added system.iswin32() system.islinux() system.isdarwin().
  • 1.0.0

    • The first version of contsys.
    • Added CMD.clear() CMD.title().

Project details


Download files

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

Source Distribution

contsys-1.2.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

contsys-1.2.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file contsys-1.2.4.tar.gz.

File metadata

  • Download URL: contsys-1.2.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for contsys-1.2.4.tar.gz
Algorithm Hash digest
SHA256 e67d37b8bfb4ac4885eda4283b2bea22dc630fe13bae5bc961f411e4dfca0c43
MD5 380e280b27c78510413c72c022e61bc4
BLAKE2b-256 d66887e34498ac5dc1550f7046d373379d2f7841948e2455f1d5926e694d8c4b

See more details on using hashes here.

File details

Details for the file contsys-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: contsys-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for contsys-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dc6a6349073c6c26655ac2b534d2600308884a660d7b2b6dbc2681b6528441bc
MD5 04d96b306688861c44ceafbd3aa428c6
BLAKE2b-256 55d4a114ed926d69e17e71b3c94f07b0413de8796843faaddd177e6e891e8d25

See more details on using hashes here.

Supported by

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