# flatwhite
## Overview
This project contains several modules designed to handle tasks such as file handling, format validation, and project structure creation. Below is a detailed description of each module and their respective functions.
## Modules and Functions
### `file_handler.py`
This module provides functions to manage files, including organizing and deleting them based on file types or extensions.
- **`handle_files(directory, action='organize', types=None, additional_ext=None)`**
- **Description:** Organizes or deletes files in a directory based on their types or additional extensions.
- **Parameters:**
- `directory (str)`: Path of the directory to process.
- `action (str)`: Action to perform ('organize' or 'delete'). Default is 'organize'.
- `types (list)`: List of file types to organize or delete (e.g., `['pics', 'sounds', 'docs']`).
- `additional_ext (str)`: Additional file extensions to include, provided as a comma-separated string.
- **Returns:** None.
- **`list_directory_structure(root_dir, indent_level=0)`**
- **Description:** Recursively lists the directory structure starting from the root directory.
- **Parameters:**
- `root_dir (str)`: The root directory to start listing from.
- `indent_level (int)`: The current indentation level for pretty printing. Default is 0.
- **Returns:** None.
### `format_validator.py`
This module contains a function to validate different formats such as email, phone number, password, and custom regex patterns.
- **`validate_input(input_value, validate_type, regex_pattern=None)`**
- **Description:** Validates an input based on the specified type (email, phone, password, or custom regex).
- **Parameters:**
- `input_value (str)`: The input to validate.
- `validate_type (str)`: The type of validation ('email', 'phone', 'password', 'regex').
- `regex_pattern (str)`: Custom regex pattern to use if `validate_type` is 'regex'.
- **Returns:** `bool`: Returns `True` if valid, otherwise `False`.
### `project_structure.py`
This module helps in creating basic project folder structures based on project type.
- **`create_project_structure(project_type='web')`**
- **Description:** Creates a basic folder and file structure for a web project.
- **Parameters:**
- `project_type (str)`: The type of project. Default is 'web'.
- **Returns:** None.
## Usage
Here are examples showing how to use the modules and their respective functions.
```python
from flatwhite import create_project_structure, validate_input, handle_files
# Example usage for creating a web project structure
create_project_structure('web')
# Example usage for validating an email
is_valid_email = validate_input('example@example.com', validate_type='email')
# Example usage for organizing files in a directory
handle_files('/path/to/directory', action='organize', types=['pics', 'docs'])
Raw data
{
"_id": null,
"home_page": "https://github.com/Ferref/flatwhite",
"name": "flatwhite",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Ferenc Kov\u00e1cs",
"author_email": "kovacsferenc026@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b6/16/d43a171f88f431c0f6461edb05095c4e35cd72f0b2b2d88d4847d6a07b28/flatwhite-0.4.0.tar.gz",
"platform": null,
"description": "# flatwhite\r\n\r\n## Overview\r\n\r\nThis project contains several modules designed to handle tasks such as file handling, format validation, and project structure creation. Below is a detailed description of each module and their respective functions.\r\n\r\n## Modules and Functions\r\n\r\n### `file_handler.py`\r\n\r\nThis module provides functions to manage files, including organizing and deleting them based on file types or extensions.\r\n\r\n- **`handle_files(directory, action='organize', types=None, additional_ext=None)`**\r\n - **Description:** Organizes or deletes files in a directory based on their types or additional extensions.\r\n - **Parameters:**\r\n - `directory (str)`: Path of the directory to process.\r\n - `action (str)`: Action to perform ('organize' or 'delete'). Default is 'organize'.\r\n - `types (list)`: List of file types to organize or delete (e.g., `['pics', 'sounds', 'docs']`).\r\n - `additional_ext (str)`: Additional file extensions to include, provided as a comma-separated string.\r\n - **Returns:** None.\r\n\r\n- **`list_directory_structure(root_dir, indent_level=0)`**\r\n - **Description:** Recursively lists the directory structure starting from the root directory.\r\n - **Parameters:**\r\n - `root_dir (str)`: The root directory to start listing from.\r\n - `indent_level (int)`: The current indentation level for pretty printing. Default is 0.\r\n - **Returns:** None.\r\n\r\n### `format_validator.py`\r\n\r\nThis module contains a function to validate different formats such as email, phone number, password, and custom regex patterns.\r\n\r\n- **`validate_input(input_value, validate_type, regex_pattern=None)`**\r\n - **Description:** Validates an input based on the specified type (email, phone, password, or custom regex).\r\n - **Parameters:**\r\n - `input_value (str)`: The input to validate.\r\n - `validate_type (str)`: The type of validation ('email', 'phone', 'password', 'regex').\r\n - `regex_pattern (str)`: Custom regex pattern to use if `validate_type` is 'regex'.\r\n - **Returns:** `bool`: Returns `True` if valid, otherwise `False`.\r\n\r\n### `project_structure.py`\r\n\r\nThis module helps in creating basic project folder structures based on project type.\r\n\r\n- **`create_project_structure(project_type='web')`**\r\n - **Description:** Creates a basic folder and file structure for a web project.\r\n - **Parameters:**\r\n - `project_type (str)`: The type of project. Default is 'web'.\r\n - **Returns:** None.\r\n\r\n## Usage\r\n\r\nHere are examples showing how to use the modules and their respective functions.\r\n\r\n```python\r\nfrom flatwhite import create_project_structure, validate_input, handle_files\r\n\r\n# Example usage for creating a web project structure\r\ncreate_project_structure('web')\r\n\r\n# Example usage for validating an email\r\nis_valid_email = validate_input('example@example.com', validate_type='email')\r\n\r\n# Example usage for organizing files in a directory\r\nhandle_files('/path/to/directory', action='organize', types=['pics', 'docs'])\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for validating formats and handling files.",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/Ferref/flatwhite"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3b7ac4b3900ede81bacb40c13c260464394c3dbe1cfac2526cfde5a3c7b849c",
"md5": "510979de8f89703795e3f3b1923e3c0b",
"sha256": "9adfeb80fd1d66cf41a58518670837333f82d4ab2840400c32b642bafd3a0594"
},
"downloads": -1,
"filename": "flatwhite-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "510979de8f89703795e3f3b1923e3c0b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6905,
"upload_time": "2024-09-09T15:45:14",
"upload_time_iso_8601": "2024-09-09T15:45:14.857920Z",
"url": "https://files.pythonhosted.org/packages/b3/b7/ac4b3900ede81bacb40c13c260464394c3dbe1cfac2526cfde5a3c7b849c/flatwhite-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b616d43a171f88f431c0f6461edb05095c4e35cd72f0b2b2d88d4847d6a07b28",
"md5": "ef9c15cbeccd80e0b870a281815f99da",
"sha256": "4e1efc176e81f6f526d0264789f558172542c8ee7f26673e79a356813713826c"
},
"downloads": -1,
"filename": "flatwhite-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "ef9c15cbeccd80e0b870a281815f99da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5410,
"upload_time": "2024-09-09T15:45:16",
"upload_time_iso_8601": "2024-09-09T15:45:16.235341Z",
"url": "https://files.pythonhosted.org/packages/b6/16/d43a171f88f431c0f6461edb05095c4e35cd72f0b2b2d88d4847d6a07b28/flatwhite-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-09 15:45:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ferref",
"github_project": "flatwhite",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "flatwhite"
}