tasks-loader


Nametasks-loader JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/glizzykingdreko/tasks-loader
SummaryA module for dynamically creating tasks from CSV files with extensive validation features.
upload_time2024-04-16 22:35:28
maintainerNone
docs_urlNone
authorGlizzyKingDreko
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tasks-loader

The `tasks-loader` module is designed to simplify the process of managing and taking actions based on the rows of an input CSV file. 

![Banner](https://i.imgur.com/RwODhsn.jpeg)

This module enables quick and easy loading and adaptation of any CSV file based on the data management needs encountered in various projects. Whether automating task creation, performing data validation, or preprocessing information for further analysis, `tasks-loader` offers a robust foundation for working with CSV data in Python.


## Table of Contents
- [tasks-loader](#tasks-loader)
  - [Table of Contents](#table-of-contents)
  - [Installation](#installation)
  - [Key Features](#key-features)
  - [Task Format Dictionary](#task-format-dictionary)
  - [Examples](#examples)
    - [Example 1: Basic Task Loading](#example-1-basic-task-loading)
    - [Example 2: Advanced Validation with Regex and Lambda](#example-2-advanced-validation-with-regex-and-lambda)
    - [Example 3: Post-processing Data](#example-3-post-processing-data)
    - [Example 4: Ticket / Sneakers Bot-like Validation](#example-4-ticket--sneakers-bot-like-validation)
    - [Example 2: Advanced Validation with Regex and Lambda](#example-2-advanced-validation-with-regex-and-lambda-1)
    - [Example 5: Using Pre-Made Regex Checks with the Patterns Class](#example-5-using-pre-made-regex-checks-with-the-patterns-class)
    - [Example 6: File Check and Creation Handling](#example-6-file-check-and-creation-handling)
  - [Stay in touch with me](#stay-in-touch-with-me)

## Installation

To install `tasks-loader`, run the following command:
```bash
pip install tasks-loader
```

## Key Features

- **Dynamic Task Creation**: Automatically generates tasks from CSV rows, facilitating easy manipulation and processing.
- **Flexible Validation**: Supports extensive validation mechanisms including type checks, regex patterns, lambda functions, and predefined choices.
- **Customizable Default Values**: Enables specifying global or field-specific default values for handling missing or invalid data.
- **Post-processing Hooks**: Allows for data transformation after loading, such as converting units or normalizing strings.
- **Automatic Header Adjustment**: Converts CSV headers to lowercase and replaces spaces with underscores, simplifying attribute access in Python.
- **Iterability and Validation Checks**: Offers built-in support for task validity checks and iteration over tasks, streamlining application control flow.
- **Extensible Design**: Designed for easy extension to include more validation rules, data transformations, or export options.
- **Increasing Task ID**: No need to specify task IDs in the CSV file; the module automatically assigns incremental IDs to each task.

## Task Format Dictionary

The task format dictionary defines how each field in your CSV file is processed. Here’s what you need to know about constructing this dictionary:

- **type**: The expected Python type of the field (e.g., `str`, `int`).
- **required**: If set to `True`, the field must be present and not empty; otherwise, it's considered optional.
- **default**: A default value to use if the field is missing or fails validation.
- **choices**: A list of acceptable values for the field.
- **validation**: A regex pattern or a lambda function for additional validation criteria.
- **post_format**: A function to transform the field value after all other processing steps.

If a task is invalid (e.g., missing required fields, failed validation), it will not be included in the task list. The `global_default` argument in the `Tasks` constructor allows you to specify a fallback value for any field that is not explicitly handled by the task format.

## Examples

Below are examples demonstrating how to use `tasks-loader` with different configurations and CSV files.

### Example 1: Basic Task Loading

**CSV (`basic_tasks.csv`):**

```csv
Name,Email,Price
John Doe,johndoe@example.com,19.99
Jane Smith,,
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "email": {"type": str, "required": True, "default": "no-email@example.com"},
    "price": {"type": float, "required": False, "default": 9.99},
}
```

**Python Code:**

```python
from tasks_loader import Tasks

tasks = Tasks(input_file='basic_tasks.csv', task_format=task_format)

for task in tasks:
    print(task) 
    # Task is going to be a dict like
    # {'id': '001', 'name': 'John Doe', 'email': 'johndoe@example.com', 'price': 19.99}
```

### Example 2: Advanced Validation with Regex and Lambda

**CSV (`advanced_validation.csv`):**

```csv
Name,Email,Role
John Doe,johndoe@example.com,admin
Jane Smith,janesmith@bademail,visitor
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "email": {
        "type": str,
        "required": True,
        "validation": r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
    },
    "role": {
        "type": str,
        "required": True,
        "choices": ["admin", "user", "guest"],
        "validation": lambda x: x in ["admin", "user", "guest"]
    },
}
```

**Python Code:**

```python
from tasks_loader import Tasks

tasks = Tasks(input_file='advanced_validation.csv', task_format=task_format)

for task in tasks:
    print(task)
```

### Example 3: Post-processing Data

**CSV (`post_processing.csv`):**

```csv
Name,DelaySeconds
John Doe,30
Jane Smith,45
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "delay_seconds": {
        "type": int,
        "required": True,
        "post_format": lambda x: x * 1000  # Convert seconds to milliseconds
    },
}
```

**Python Code:**

```python
from tasks_loader import Tasks

tasks = Tasks(input_file='post_processing.csv', task_format=task_format)

for task in tasks:
    print(task)
```

### Example 4: Ticket / Sneakers Bot-like Validation

This example demonstrates a setup tailored for automated tasks commonly used in ticket purchasing or sneaker bot scenarios. The configuration ensures all necessary information for a purchase is validated against specific criteria before proceeding with a task.

**CSV (`ticket_sneakers_bot.csv`):**

```csv
Name,Surname,Mail,URL,Min Price,Max Price,Error Delay, Monitor Delay,Credit Card Number,Credit Card Month,Credit Card Year,Credit Card CVV
John,Doe,johndoe@example.com,https://example.com,50,500,1000,5000,1234567890123456,01,2024,123
Jane,Smith,janesmith@example.com,https://invalid,0,,500,2000,1234567890123456,12,2023,456
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "delay_seconds": {
        "type": int,
        "required": True,
        "post_format": lambda x: x * 1000  # Convert seconds to milliseconds
    },
}
```

**Task Format:**
This setup includes several validation steps to ensure each field meets the requirements for automated purchasing tasks:
```python
import re

task_format = {
    "name": {"type": str, "required": True, "validation": lambda x: isinstance(x, str) and x.strip() != ""},
    "surname": {"type": str, "required": True, "validation": lambda x: isinstance(x, str) and x.strip() != ""},
    "mail": {
        "type": str,
        "required": True,
        "validation": r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
    },
    "url": {
        "type": str,
        "required": True,
        "validation": r"^https?://[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:/[a-zA-Z0-9_./-]+)*$"
    },
    "min_price": {"type": float, "required": False, "default": 0},
    "max_price": {"type": float, "required": False, "default": 10000},
    "error_delay": {"type": int, "required": False, "post_format": lambda x: x // 1000},
    "monitor_delay": {"type": int, "required": False, "post_format": lambda x: x // 1000},
    "credit_card_number": {"type": str, "required": True, "validation": lambda x: len(x) == 16 and x.isdigit()},
    "credit_card_month": {"type": str, "required": True, "validation": r"^(0[1-9]|1[0-2])$"},
    "credit_card_year": {"type": str, "required": True, "validation": r"^\d{4}$"},
    "credit_card_cvv": {"type": str, "required": True, "validation": r"^\d{3}$"},
}
```

**Python Code:**

```python
from tasks_loader import Tasks

tasks = Tasks(input_file='ticket_sneakers_bot.csv', task_format=task_format)

for task in tasks:
    StartTask(**task) # Apply the dict of the task as kwargs
```


**Validation Explained:**

- **Name and Surname**: Must be valid strings that are not just whitespace.
- **Mail**: Uses a regex pattern to validate that the email address is in a proper format.
- **URL**: Validates URLs with a regex pattern to ensure they start with http or https and are generally formatted correctly.
- **Min and Max Price**: Validates that these are floats, with defaults of 0 and 10000 respectively if not specified or invalid.
- **Error and Monitor Delay**: These are expected to be integers representing milliseconds; they are post-processed to convert to seconds.
- **Credit Card Number**: Must be a 16-digit string.
- **Credit Card Month**: Validates with a regex pattern that the month is in MM format, allowing only values from 01 to 12.
- **Credit Card Year**: Must be a 4-digit year in YYYY format.
- **Credit Card CVV**: A 3-digit security code validated with a regex pattern.

This setup is an example of an automated module that initiates tasks based on the validated entries from a CSV file, ensuring each task has all the necessary and correctly formatted information before proceeding. This kind of validation is crucial in scenarios where precise and validated data is essential for the success of automated tasks, such as in ticket purchasing or sneaker bot operations.


### Example 2: Advanced Validation with Regex and Lambda

**CSV (`advanced_validation.csv`):**

```csv
Name,Email,Role
John Doe,johndoe@example.com,admin
Jane Smith,janesmith@bademail,visitor
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "email": {
        "type": str,
        "required": True,
        "validation": r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
    },
    "role": {
        "type": str,
        "required": True,
        "choices": ["admin", "user", "guest"],
        "validation": lambda x: x in ["admin", "user", "guest"]
    },
}
```

**Python Code:**

```python
from tasks_loader import Tasks

tasks = Tasks(input_file='advanced_validation.csv', task_format=task_format)

for task in tasks:
    print(task)
```

### Example 5: Using Pre-Made Regex Checks with the Patterns Class

**CSV (`regex_validation.csv`):**

```csv
Name,Email,Phone,Month
John Doe,johndoe@example.com,+12345678901,January
Jane Smith,janesmith@bademail,+12345,Smarch
```

**Task Format:**

```python
task_format = {
    "name": {"type": str, "required": True},
    "email": {
        "type": str,
        "required": True,
        "validation": Patterns.MAIL
    },
    "phone": {
        "type": str,
        "required": True,
        "validation": Patterns.PHONE
    },
    "month": {
        "type": str,
        "required": True,
        "validation": Patterns.MONTH
    }
}
```

**Python Code:**

```python
from tasks_loader import Patterns

task_format = {
    "name": {"type": str, "required": True},
    "email": {
        "type": str,
        "required": True,
        "validation": Patterns.MAIL
    },
    "phone": {
        "type": str,
        "required": True,
        "validation": Patterns.PHONE
    },
    "month": {
        "type": str,
        "required": True,
        "validation": Patterns.MONTH
    }
}
```

### Example 6: File Check and Creation Handling

If the specified CSV file does not exist, ty can createa new one by calling the function `create_file` with the appropriate headers based on the `task_format` to ensure data consistency.

**Python Code:**

```python
from tasks_loader import Tasks

# Define the CSV file and format
tasks = Tasks(input_file='new_tasks.csv', task_format=task_format)

if tasks.create_file():
    print("File created, please fill it and then restart the script")
    exit(0)
print("File aready created")
```


## Stay in touch with me

For any inquiries or further information, please reach out:

- [GitHub](https://github.com/glizzykingdreko)
- [Twitter](https://mobile.twitter.com/glizzykingdreko)
- [Medium](https://medium.com/@glizzykingdreko)
- [Email](mailto:glizzykingdreko@protonmail.com) 
- [Website](https://glizzykingdreko.github.io)
- [Buy me a coffee ❤️](https://www.buymeacoffee.com/glizzykingdreko)
- Antibot bypass solutions needed? [TakionAPI](https://takionapi.tech/discord)

Feel free to contact for collaborations, questions, or feedback any of my projects.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/glizzykingdreko/tasks-loader",
    "name": "tasks-loader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "GlizzyKingDreko",
    "author_email": "glizzykingdreko@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/24/c5d1325d11781c8c86bfec89fc229cec9cc2bd1ee9a75e112bda61f25f4b/tasks_loader-0.1.1.tar.gz",
    "platform": null,
    "description": "# tasks-loader\n\nThe `tasks-loader` module is designed to simplify the process of managing and taking actions based on the rows of an input CSV file. \n\n![Banner](https://i.imgur.com/RwODhsn.jpeg)\n\nThis module enables quick and easy loading and adaptation of any CSV file based on the data management needs encountered in various projects. Whether automating task creation, performing data validation, or preprocessing information for further analysis, `tasks-loader` offers a robust foundation for working with CSV data in Python.\n\n\n## Table of Contents\n- [tasks-loader](#tasks-loader)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Key Features](#key-features)\n  - [Task Format Dictionary](#task-format-dictionary)\n  - [Examples](#examples)\n    - [Example 1: Basic Task Loading](#example-1-basic-task-loading)\n    - [Example 2: Advanced Validation with Regex and Lambda](#example-2-advanced-validation-with-regex-and-lambda)\n    - [Example 3: Post-processing Data](#example-3-post-processing-data)\n    - [Example 4: Ticket / Sneakers Bot-like Validation](#example-4-ticket--sneakers-bot-like-validation)\n    - [Example 2: Advanced Validation with Regex and Lambda](#example-2-advanced-validation-with-regex-and-lambda-1)\n    - [Example 5: Using Pre-Made Regex Checks with the Patterns Class](#example-5-using-pre-made-regex-checks-with-the-patterns-class)\n    - [Example 6: File Check and Creation Handling](#example-6-file-check-and-creation-handling)\n  - [Stay in touch with me](#stay-in-touch-with-me)\n\n## Installation\n\nTo install `tasks-loader`, run the following command:\n```bash\npip install tasks-loader\n```\n\n## Key Features\n\n- **Dynamic Task Creation**: Automatically generates tasks from CSV rows, facilitating easy manipulation and processing.\n- **Flexible Validation**: Supports extensive validation mechanisms including type checks, regex patterns, lambda functions, and predefined choices.\n- **Customizable Default Values**: Enables specifying global or field-specific default values for handling missing or invalid data.\n- **Post-processing Hooks**: Allows for data transformation after loading, such as converting units or normalizing strings.\n- **Automatic Header Adjustment**: Converts CSV headers to lowercase and replaces spaces with underscores, simplifying attribute access in Python.\n- **Iterability and Validation Checks**: Offers built-in support for task validity checks and iteration over tasks, streamlining application control flow.\n- **Extensible Design**: Designed for easy extension to include more validation rules, data transformations, or export options.\n- **Increasing Task ID**: No need to specify task IDs in the CSV file; the module automatically assigns incremental IDs to each task.\n\n## Task Format Dictionary\n\nThe task format dictionary defines how each field in your CSV file is processed. Here\u2019s what you need to know about constructing this dictionary:\n\n- **type**: The expected Python type of the field (e.g., `str`, `int`).\n- **required**: If set to `True`, the field must be present and not empty; otherwise, it's considered optional.\n- **default**: A default value to use if the field is missing or fails validation.\n- **choices**: A list of acceptable values for the field.\n- **validation**: A regex pattern or a lambda function for additional validation criteria.\n- **post_format**: A function to transform the field value after all other processing steps.\n\nIf a task is invalid (e.g., missing required fields, failed validation), it will not be included in the task list. The `global_default` argument in the `Tasks` constructor allows you to specify a fallback value for any field that is not explicitly handled by the task format.\n\n## Examples\n\nBelow are examples demonstrating how to use `tasks-loader` with different configurations and CSV files.\n\n### Example 1: Basic Task Loading\n\n**CSV (`basic_tasks.csv`):**\n\n```csv\nName,Email,Price\nJohn Doe,johndoe@example.com,19.99\nJane Smith,,\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"email\": {\"type\": str, \"required\": True, \"default\": \"no-email@example.com\"},\n    \"price\": {\"type\": float, \"required\": False, \"default\": 9.99},\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\ntasks = Tasks(input_file='basic_tasks.csv', task_format=task_format)\n\nfor task in tasks:\n    print(task) \n    #\u00a0Task is going to be a dict like\n    # {'id': '001', 'name': 'John Doe', 'email': 'johndoe@example.com', 'price': 19.99}\n```\n\n### Example 2: Advanced Validation with Regex and Lambda\n\n**CSV (`advanced_validation.csv`):**\n\n```csv\nName,Email,Role\nJohn Doe,johndoe@example.com,admin\nJane Smith,janesmith@bademail,visitor\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"email\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": r\"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$\"\n    },\n    \"role\": {\n        \"type\": str,\n        \"required\": True,\n        \"choices\": [\"admin\", \"user\", \"guest\"],\n        \"validation\": lambda x: x in [\"admin\", \"user\", \"guest\"]\n    },\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\ntasks = Tasks(input_file='advanced_validation.csv', task_format=task_format)\n\nfor task in tasks:\n    print(task)\n```\n\n### Example 3: Post-processing Data\n\n**CSV (`post_processing.csv`):**\n\n```csv\nName,DelaySeconds\nJohn Doe,30\nJane Smith,45\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"delay_seconds\": {\n        \"type\": int,\n        \"required\": True,\n        \"post_format\": lambda x: x * 1000  # Convert seconds to milliseconds\n    },\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\ntasks = Tasks(input_file='post_processing.csv', task_format=task_format)\n\nfor task in tasks:\n    print(task)\n```\n\n### Example 4: Ticket / Sneakers Bot-like Validation\n\nThis example demonstrates a setup tailored for automated tasks commonly used in ticket purchasing or sneaker bot scenarios. The configuration ensures all necessary information for a purchase is validated against specific criteria before proceeding with a task.\n\n**CSV (`ticket_sneakers_bot.csv`):**\n\n```csv\nName,Surname,Mail,URL,Min Price,Max Price,Error Delay, Monitor Delay,Credit Card Number,Credit Card Month,Credit Card Year,Credit Card CVV\nJohn,Doe,johndoe@example.com,https://example.com,50,500,1000,5000,1234567890123456,01,2024,123\nJane,Smith,janesmith@example.com,https://invalid,0,,500,2000,1234567890123456,12,2023,456\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"delay_seconds\": {\n        \"type\": int,\n        \"required\": True,\n        \"post_format\": lambda x: x * 1000  # Convert seconds to milliseconds\n    },\n}\n```\n\n**Task Format:**\nThis setup includes several validation steps to ensure each field meets the requirements for automated purchasing tasks:\n```python\nimport re\n\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True, \"validation\": lambda x: isinstance(x, str) and x.strip() != \"\"},\n    \"surname\": {\"type\": str, \"required\": True, \"validation\": lambda x: isinstance(x, str) and x.strip() != \"\"},\n    \"mail\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": r\"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$\"\n    },\n    \"url\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": r\"^https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}(?:/[a-zA-Z0-9_./-]+)*$\"\n    },\n    \"min_price\": {\"type\": float, \"required\": False, \"default\": 0},\n    \"max_price\": {\"type\": float, \"required\": False, \"default\": 10000},\n    \"error_delay\": {\"type\": int, \"required\": False, \"post_format\": lambda x: x // 1000},\n    \"monitor_delay\": {\"type\": int, \"required\": False, \"post_format\": lambda x: x // 1000},\n    \"credit_card_number\": {\"type\": str, \"required\": True, \"validation\": lambda x: len(x) == 16 and x.isdigit()},\n    \"credit_card_month\": {\"type\": str, \"required\": True, \"validation\": r\"^(0[1-9]|1[0-2])$\"},\n    \"credit_card_year\": {\"type\": str, \"required\": True, \"validation\": r\"^\\d{4}$\"},\n    \"credit_card_cvv\": {\"type\": str, \"required\": True, \"validation\": r\"^\\d{3}$\"},\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\ntasks = Tasks(input_file='ticket_sneakers_bot.csv', task_format=task_format)\n\nfor task in tasks:\n    StartTask(**task) # Apply the dict of the task as kwargs\n```\n\n\n**Validation Explained:**\n\n- **Name and Surname**: Must be valid strings that are not just whitespace.\n- **Mail**: Uses a regex pattern to validate that the email address is in a proper format.\n- **URL**: Validates URLs with a regex pattern to ensure they start with http or https and are generally formatted correctly.\n- **Min and Max Price**: Validates that these are floats, with defaults of 0 and 10000 respectively if not specified or invalid.\n- **Error and Monitor Delay**: These are expected to be integers representing milliseconds; they are post-processed to convert to seconds.\n- **Credit Card Number**: Must be a 16-digit string.\n- **Credit Card Month**: Validates with a regex pattern that the month is in MM format, allowing only values from 01 to 12.\n- **Credit Card Year**: Must be a 4-digit year in YYYY format.\n- **Credit Card CVV**: A 3-digit security code validated with a regex pattern.\n\nThis setup is an example of an automated module that initiates tasks based on the validated entries from a CSV file, ensuring each task has all the necessary and correctly formatted information before proceeding. This kind of validation is crucial in scenarios where precise and validated data is essential for the success of automated tasks, such as in ticket purchasing or sneaker bot operations.\n\n\n### Example 2: Advanced Validation with Regex and Lambda\n\n**CSV (`advanced_validation.csv`):**\n\n```csv\nName,Email,Role\nJohn Doe,johndoe@example.com,admin\nJane Smith,janesmith@bademail,visitor\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"email\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": r\"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$\"\n    },\n    \"role\": {\n        \"type\": str,\n        \"required\": True,\n        \"choices\": [\"admin\", \"user\", \"guest\"],\n        \"validation\": lambda x: x in [\"admin\", \"user\", \"guest\"]\n    },\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\ntasks = Tasks(input_file='advanced_validation.csv', task_format=task_format)\n\nfor task in tasks:\n    print(task)\n```\n\n### Example 5: Using Pre-Made Regex Checks with the Patterns Class\n\n**CSV (`regex_validation.csv`):**\n\n```csv\nName,Email,Phone,Month\nJohn Doe,johndoe@example.com,+12345678901,January\nJane Smith,janesmith@bademail,+12345,Smarch\n```\n\n**Task Format:**\n\n```python\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"email\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.MAIL\n    },\n    \"phone\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.PHONE\n    },\n    \"month\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.MONTH\n    }\n}\n```\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Patterns\n\ntask_format = {\n    \"name\": {\"type\": str, \"required\": True},\n    \"email\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.MAIL\n    },\n    \"phone\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.PHONE\n    },\n    \"month\": {\n        \"type\": str,\n        \"required\": True,\n        \"validation\": Patterns.MONTH\n    }\n}\n```\n\n### Example 6: File Check and Creation Handling\n\nIf the specified CSV file does not exist, ty can createa new one by calling the function `create_file` with the appropriate headers based on the `task_format` to ensure data consistency.\n\n**Python Code:**\n\n```python\nfrom tasks_loader import Tasks\n\n# Define the CSV file and format\ntasks = Tasks(input_file='new_tasks.csv', task_format=task_format)\n\nif tasks.create_file():\n    print(\"File created, please fill it and then restart the script\")\n    exit(0)\nprint(\"File aready created\")\n```\n\n\n## Stay in touch with me\n\nFor any inquiries or further information, please reach out:\n\n- [GitHub](https://github.com/glizzykingdreko)\n- [Twitter](https://mobile.twitter.com/glizzykingdreko)\n- [Medium](https://medium.com/@glizzykingdreko)\n- [Email](mailto:glizzykingdreko@protonmail.com) \n- [Website](https://glizzykingdreko.github.io)\n- [Buy me a coffee \u2764\ufe0f](https://www.buymeacoffee.com/glizzykingdreko)\n- Antibot bypass solutions needed? [TakionAPI](https://takionapi.tech/discord)\n\nFeel free to contact for collaborations, questions, or feedback any of my projects.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A module for dynamically creating tasks from CSV files with extensive validation features.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/glizzykingdreko/tasks-loader"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b45b6259fb1782720045604db4f1e019a67cb6f8bf623e3d98809fa40d33d03d",
                "md5": "eed4b256dc3bd08a857f629cc4f9a3a3",
                "sha256": "3ae47a7c5ab691285fee59e6c0d19cadd5e5d2cee326816c9bdd7e2bfe84d23d"
            },
            "downloads": -1,
            "filename": "tasks_loader-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eed4b256dc3bd08a857f629cc4f9a3a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8591,
            "upload_time": "2024-04-16T22:35:25",
            "upload_time_iso_8601": "2024-04-16T22:35:25.793954Z",
            "url": "https://files.pythonhosted.org/packages/b4/5b/6259fb1782720045604db4f1e019a67cb6f8bf623e3d98809fa40d33d03d/tasks_loader-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f24c5d1325d11781c8c86bfec89fc229cec9cc2bd1ee9a75e112bda61f25f4b",
                "md5": "df246ab00643eaf8732dc2a0017baaed",
                "sha256": "de65a05f8676481e5703bd6d4adf3a3530b089e4e937e90cd4eef47cb5cb3a46"
            },
            "downloads": -1,
            "filename": "tasks_loader-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "df246ab00643eaf8732dc2a0017baaed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11300,
            "upload_time": "2024-04-16T22:35:28",
            "upload_time_iso_8601": "2024-04-16T22:35:28.064379Z",
            "url": "https://files.pythonhosted.org/packages/5f/24/c5d1325d11781c8c86bfec89fc229cec9cc2bd1ee9a75e112bda61f25f4b/tasks_loader-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 22:35:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "glizzykingdreko",
    "github_project": "tasks-loader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tasks-loader"
}
        
Elapsed time: 0.28081s