# Tom's Toolbox
A small toolbox for future proyects
You can install this shit with ```pip install Tom-Toolbox```
This library contains a quick way to color the words in the file ansi_colors.py,some useful tools,in tools.py
## Modules
### - Ansi Colors
This is a Python module that provides color codes for text in the terminal. It has three classes, namely c, bg, and bc, each of which has methods to return color codes for different colors.
c Class
The c class has methods for foreground color codes, which means the color of the text.
`black()`
This method returns the color code for black text.
`red()`
This method returns the color code for red text.
`green()`
This method returns the color code for green text.
`yellow()`
This method returns the color code for yellow text.
`blue()`
This method returns the color code for blue text.
`magenta()`
This method returns the color code for magenta text.
`cyan()`
This method returns the color code for cyan text.
`white()`
This method returns the color code for white text.
#### `bg` Class
The bg class has methods for background color codes, which means the color behind the text.
`black()`
This method returns the color code for a black background.
`red()`
This method returns the color code for a red background.
`green()`
This method returns the color code for a green background.
`yellow()`
This method returns the color code for a yellow background.
`blue()`
This method returns the color code for a blue background.
`magenta()`
This method returns the color code for a magenta background.
`cyan()`
This method returns the color code for a cyan background.
`white()`
This method returns the color code for a white background.
#### `bc` Class
The bc class has methods for bright and colored text.
`black()`
This method returns the color code for bright and black text.
`red()`
This method returns the color code for bright and red text.
`green()`
This method returns the color code for bright and green text.
`yellow()`
This method returns the color code for bright and yellow text.
`blue()`
This method returns the color code for bright and blue text.
`magenta()`
This method returns the color code for bright and magenta text.
`cyan()`
This method returns the color code for bright and cyan text.
`white()`
This method returns the color code for bright and white text.
#### Example Usage
Here is an example of how to use the color codes in a Python script:
```
from Toolbox.ansi_colors import *
print(c.blue("Hello, World!"))
print(bg.red("Error: File not found"))
print(bc.green("SUCCESS: Operation completed"))
```
This will print "Hello, World!" in blue color, "Error: File not found" with a red background, and "SUCCESS: Operation completed" in bright and green color.
### - Pacman
The documentation would be [here](https://github.com/Tom5521/PY-PackArch) since this is a library within another one.
### - Tools
#### Functions:
##### `sys(command)`
Executes a shell command using the subprocess.run() method. The input parameter command is expected to be a string representing the shell command to be executed.
##### `command_read(command)`
Executes a shell command using the subprocess.run() method and returns the output of the command as a string. The input parameter command is expected to be a string representing the shell command to be executed.
##### `git_clone(link, route="")`
Clones a git repository using the git clone command. The input parameter link is expected to be a string representing the link to the git repository. The input parameter route is optional and expected to be a string representing the path to the directory where the repository will be cloned.
##### `clear()`
Clears the console using the clear command.
##### `wget(link)`
Downloads a file from a URL using the wget command. The input parameter link is expected to be a string representing the URL of the file to be downloaded.
##### `mkfs(format, partition, condition="")`
Creates a file system on a partition using the mkfs command. The input parameters format and partition are expected to be strings representing the format of the file system and the partition to be formatted, respectively. The input parameter condition is optional and expected to be a string representing additional conditions for the mkfs command.
##### `fetches(option)`
Displays system information using various tools depending on the input parameter option. The valid values for option are "neo", "one", and "fresh". If the input parameter option is not one of the valid values, a message will be displayed indicating that no option was selected.
##### `cowsay(text, cow="", condition="")`
Displays a message using an ASCII art of a cow and the cowsay command. The input parameter text is expected to be a string representing the message to be displayed. The input parameter cow is optional and expected to be a string representing the name of the ASCII art to be used. The input parameter condition is optional and expected to be a string representing additional conditions for the cowsay command.
##### `analize_dir(dir = "")`
Displays the content of a directory using various shell commands. The input parameter dir is optional and expected to be a string representing the path to the directory to be analyzed. The os.listdir() method is used to display the content of the directory, the sys("ls -la") command is used to display the content of the directory with details, and the sys("ls -a") command is used to display the content of the directory, including hidden files.
##### `read_file(file)`
Reads the content of a file and returns it as a string. The input parameter file is expected to be a string representing the path to the file to be read.
##### `makepkg(route ="")`
Creates a package using the makepkg command. The input parameter route is optional and expected to be a string representing the path to the directory where the package will be created. The makepkg -si command is used to create and install the package.
Raw data
{
"_id": null,
"home_page": "https://github.com/Tom5521/Toolbox",
"name": "Tom-Toolbox",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Tom5521",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/31/f5/a5d31d3ac8084aa30f7b7f3bece1a37353b43e134f6a74dd2d8a078ffd7a/Tom-Toolbox-0.0.1.post2.tar.gz",
"platform": null,
"description": "# Tom's Toolbox\nA small toolbox for future proyects\n\nYou can install this shit with ```pip install Tom-Toolbox```\n\nThis library contains a quick way to color the words in the file ansi_colors.py,some useful tools,in tools.py\n\n## Modules\n### - Ansi Colors\n\nThis is a Python module that provides color codes for text in the terminal. It has three classes, namely c, bg, and bc, each of which has methods to return color codes for different colors.\nc Class\n\nThe c class has methods for foreground color codes, which means the color of the text.\n`black()`\n\nThis method returns the color code for black text.\n`red()`\n\nThis method returns the color code for red text.\n`green()`\n\nThis method returns the color code for green text.\n`yellow()`\n\nThis method returns the color code for yellow text.\n`blue()`\n\nThis method returns the color code for blue text.\n`magenta()`\n\nThis method returns the color code for magenta text.\n`cyan()`\n\nThis method returns the color code for cyan text.\n`white()`\n\nThis method returns the color code for white text.\n#### `bg` Class\n\nThe bg class has methods for background color codes, which means the color behind the text.\n`black()`\n\nThis method returns the color code for a black background.\n`red()`\n\nThis method returns the color code for a red background.\n`green()`\n\nThis method returns the color code for a green background.\n`yellow()`\n\nThis method returns the color code for a yellow background.\n`blue()`\n\nThis method returns the color code for a blue background.\n`magenta()`\n\nThis method returns the color code for a magenta background.\n`cyan()`\n\nThis method returns the color code for a cyan background.\n`white()`\n\nThis method returns the color code for a white background.\n#### `bc` Class\n\nThe bc class has methods for bright and colored text.\n`black()`\n\nThis method returns the color code for bright and black text.\n`red()`\n\nThis method returns the color code for bright and red text.\n`green()`\n\nThis method returns the color code for bright and green text.\n`yellow()`\n\nThis method returns the color code for bright and yellow text.\n`blue()`\n\nThis method returns the color code for bright and blue text.\n`magenta()`\n\nThis method returns the color code for bright and magenta text.\n`cyan()`\n\nThis method returns the color code for bright and cyan text.\n`white()`\n\nThis method returns the color code for bright and white text.\n#### Example Usage\n\nHere is an example of how to use the color codes in a Python script:\n```\nfrom Toolbox.ansi_colors import *\n\nprint(c.blue(\"Hello, World!\"))\nprint(bg.red(\"Error: File not found\"))\nprint(bc.green(\"SUCCESS: Operation completed\"))\n\n```\nThis will print \"Hello, World!\" in blue color, \"Error: File not found\" with a red background, and \"SUCCESS: Operation completed\" in bright and green color.\n\n### - Pacman\nThe documentation would be [here](https://github.com/Tom5521/PY-PackArch) since this is a library within another one.\n\n### - Tools\n#### Functions:\n##### `sys(command)`\n\nExecutes a shell command using the subprocess.run() method. The input parameter command is expected to be a string representing the shell command to be executed.\n##### `command_read(command)`\n\nExecutes a shell command using the subprocess.run() method and returns the output of the command as a string. The input parameter command is expected to be a string representing the shell command to be executed.\n##### `git_clone(link, route=\"\")`\n\nClones a git repository using the git clone command. The input parameter link is expected to be a string representing the link to the git repository. The input parameter route is optional and expected to be a string representing the path to the directory where the repository will be cloned.\n##### `clear()`\n\nClears the console using the clear command.\n##### `wget(link)`\n\nDownloads a file from a URL using the wget command. The input parameter link is expected to be a string representing the URL of the file to be downloaded.\n##### `mkfs(format, partition, condition=\"\")`\n\nCreates a file system on a partition using the mkfs command. The input parameters format and partition are expected to be strings representing the format of the file system and the partition to be formatted, respectively. The input parameter condition is optional and expected to be a string representing additional conditions for the mkfs command.\n##### `fetches(option)`\n\nDisplays system information using various tools depending on the input parameter option. The valid values for option are \"neo\", \"one\", and \"fresh\". If the input parameter option is not one of the valid values, a message will be displayed indicating that no option was selected.\n##### `cowsay(text, cow=\"\", condition=\"\")`\n\nDisplays a message using an ASCII art of a cow and the cowsay command. The input parameter text is expected to be a string representing the message to be displayed. The input parameter cow is optional and expected to be a string representing the name of the ASCII art to be used. The input parameter condition is optional and expected to be a string representing additional conditions for the cowsay command.\n##### `analize_dir(dir = \"\")`\n\nDisplays the content of a directory using various shell commands. The input parameter dir is optional and expected to be a string representing the path to the directory to be analyzed. The os.listdir() method is used to display the content of the directory, the sys(\"ls -la\") command is used to display the content of the directory with details, and the sys(\"ls -a\") command is used to display the content of the directory, including hidden files.\n##### `read_file(file)`\n\nReads the content of a file and returns it as a string. The input parameter file is expected to be a string representing the path to the file to be read.\n##### `makepkg(route =\"\")`\n\nCreates a package using the makepkg command. The input parameter route is optional and expected to be a string representing the path to the directory where the package will be created. The makepkg -si command is used to create and install the package.\n",
"bugtrack_url": null,
"license": "",
"summary": "A collection of utilities for python 3.10 and above",
"version": "0.0.1.post2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "645952c35cd2d61574edfd32cdcda78e9381faf3aa744e5d892da9a827c9a3f5",
"md5": "2db9e70ccae22ff888052eb0c2a65918",
"sha256": "117a3c076ffd67051774876ffd80ae0c803894173da3aeff8dee01249d1a0288"
},
"downloads": -1,
"filename": "Tom_Toolbox-0.0.1.post2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2db9e70ccae22ff888052eb0c2a65918",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6122,
"upload_time": "2023-04-14T08:52:57",
"upload_time_iso_8601": "2023-04-14T08:52:57.206307Z",
"url": "https://files.pythonhosted.org/packages/64/59/52c35cd2d61574edfd32cdcda78e9381faf3aa744e5d892da9a827c9a3f5/Tom_Toolbox-0.0.1.post2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "31f5a5d31d3ac8084aa30f7b7f3bece1a37353b43e134f6a74dd2d8a078ffd7a",
"md5": "ef02e2d0e7dcbee79381757a07751560",
"sha256": "bd6e2daadfe6e1cd8cc14b2f3364068f2d18682b9d08a97f3de4e00ae5f13d7c"
},
"downloads": -1,
"filename": "Tom-Toolbox-0.0.1.post2.tar.gz",
"has_sig": false,
"md5_digest": "ef02e2d0e7dcbee79381757a07751560",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5505,
"upload_time": "2023-04-14T08:52:59",
"upload_time_iso_8601": "2023-04-14T08:52:59.406857Z",
"url": "https://files.pythonhosted.org/packages/31/f5/a5d31d3ac8084aa30f7b7f3bece1a37353b43e134f6a74dd2d8a078ffd7a/Tom-Toolbox-0.0.1.post2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-14 08:52:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Tom5521",
"github_project": "Toolbox",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tom-toolbox"
}