pyawsopstoolkit-validators


Namepyawsopstoolkit-validators JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/coldsofttech/pyawsopstoolkit-validators.git
SummaryThis package provides a comprehensive set of validation classes specifically crafted for use with AWS (Amazon Web
upload_time2024-08-10 20:10:29
maintainerNone
docs_urlNone
authorcoldsofttech
requires_pythonNone
licenseMIT
keywords aws toolkit operations tools development python validation utilities amazon-web-services
VCS
bugtrack_url
requirements setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyawsopstoolkit_validators

The **pyawsopstoolkit_validators** package provides a comprehensive set of validation classes specifically crafted for
use with AWS (Amazon Web Services). These validators are meticulously designed to cater to the unique requirements
within the AWS ecosystem, covering a wide array of aspects such as AWS Resource Names (ARNs), Policy Statements, and
more. By leveraging these validators, developers can ensure that their AWS-related inputs and configurations adhere to
the necessary standards and formats, thereby enhancing the reliability and security of their applications deployed on
AWS.

## Getting Started

Ready to supercharge your AWS operations? Let's get started with **pyawsopstoolkit_validators!**

### Installation

Install **pyawsopstoolkit_validators** via pip:

```bash
pip install pyawsopstoolkit_validators
```

## Documentation

### account_validator

The **account_validator** package provides methods to validate AWS account information, ensuring accuracy and
consistency in account details. It includes constants and methods for validating account numbers.

#### Constants

- `NUMBER_PATTERN`: Regular expression pattern for validating account numbers. The pattern ensures that the account
  number consists of exactly 12 digits.

#### Methods

- `number(value: str, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:
  Validates if the given AWS account number is valid.

#### Usage

```python
from pyawsopstoolkit_validators.account_validator import number

# Validate account numbers
print(number('123456789012'))  # Output: True
print(number('123'))  # Output: False
```

#### References

- [AWS Documentation: DescribeAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DescribeAccount.html)

### arn_validator

The **arn_validator** package validates AWS ARNs (Amazon Resource Names) according to the AWS ARN format. This package
provides methods to validate various aspects of ARNs, including the partition, service, region, account ID, and resource
ID.

#### Constants

- `ARN_PATTERN`: Regular expression pattern for AWS ARNs.

#### Methods

- `arn(value: Union[str, list], raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:
  Validates if the given ARN(s) match the ARN pattern.

#### Usage

```python
from pyawsopstoolkit_validators.arn_validator import arn

# Validate ARNs
print(arn('arn:aws:ec2:us-east-1:123456789012:vpc/vpc-0e9801d129EXAMPLE', False))  # Output: True
print(arn('arn::iam:us-east-1:123456789012:user', False))  # Output: False
```

#### References

- [AWS Documentation: ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html)

### policy_validator

The **policy_validator** package validates AWS IAM policy documents. This package provides methods to validate various
aspects of IAM policies, ensuring their correctness and compliance.

#### Constants

- `VERSION_PATTERN`: Regular expression pattern for validating version strings in policies.
- `EFFECT_PATTERN`: Regular expression pattern for validating effect strings in policies.
- `PRINCIPAL_PATTERN`: Regular expression pattern for validating principal strings in policies.

#### Methods

- `policy(value: dict, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:
  Validates if the given policy dictionary is valid.

#### Usage

```python
from pyawsopstoolkit_validators.policy_validator import policy

# Validate IAM policy documents
print(policy(
    {
        "Version": "2012-10-17",
        "Id": "1",
        "Statement": {
            "Sid": "1",
            "Principal": "*",
            "Effect": "Allow",
            "Action": "*",
            "Resource": "*",
            "Condition": {
                "Bool": {
                    "aws:SecureTransport": "true"
                }
            }
        }
    }, False
))  # Output: True
print(policy(
    {
        "Version": "2012-10-17",
        "Id": "1"
    }, False
))  # Output: False
```

#### References

- [AWS Documentation: IAM Policy Grammar](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_grammar.html)

### region_validator

The **region_validator** packages validates AWS regions. This package provides methods to validate various aspects of
AWS, such as region code.

#### Constants

- `REGION_PATTERN`: Regular expression pattern used to validate region codes.

#### Methods

- `region(value: str, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:
  Validates if the given region code is valid.

#### Usage

```python
from pyawsopstoolkit_validators.region_validator import region

# Validate region codes
print(region('eu-west-1', False))  # Output: True
print(region('Ohio', False))  # Output: False
```

#### References

- [AWS Documentation: DescribeAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DescribeAccount.html)

# License

Please refer to the [MIT License](LICENSE) within the project for more information.

# Contributing

We welcome contributions from the community! Whether you have ideas for new features, bug fixes, or enhancements, feel
free to open an issue or submit a pull request on [GitHub](https://github.com/coldsofttech/pyawsopstoolkit-validators).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/coldsofttech/pyawsopstoolkit-validators.git",
    "name": "pyawsopstoolkit-validators",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "aws, toolkit, operations, tools, development, python, validation, utilities, amazon-web-services",
    "author": "coldsofttech",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# pyawsopstoolkit_validators\n\nThe **pyawsopstoolkit_validators** package provides a comprehensive set of validation classes specifically crafted for\nuse with AWS (Amazon Web Services). These validators are meticulously designed to cater to the unique requirements\nwithin the AWS ecosystem, covering a wide array of aspects such as AWS Resource Names (ARNs), Policy Statements, and\nmore. By leveraging these validators, developers can ensure that their AWS-related inputs and configurations adhere to\nthe necessary standards and formats, thereby enhancing the reliability and security of their applications deployed on\nAWS.\n\n## Getting Started\n\nReady to supercharge your AWS operations? Let's get started with **pyawsopstoolkit_validators!**\n\n### Installation\n\nInstall **pyawsopstoolkit_validators** via pip:\n\n```bash\npip install pyawsopstoolkit_validators\n```\n\n## Documentation\n\n### account_validator\n\nThe **account_validator** package provides methods to validate AWS account information, ensuring accuracy and\nconsistency in account details. It includes constants and methods for validating account numbers.\n\n#### Constants\n\n- `NUMBER_PATTERN`: Regular expression pattern for validating account numbers. The pattern ensures that the account\n  number consists of exactly 12 digits.\n\n#### Methods\n\n- `number(value: str, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:\n  Validates if the given AWS account number is valid.\n\n#### Usage\n\n```python\nfrom pyawsopstoolkit_validators.account_validator import number\n\n# Validate account numbers\nprint(number('123456789012'))  # Output: True\nprint(number('123'))  # Output: False\n```\n\n#### References\n\n- [AWS Documentation: DescribeAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DescribeAccount.html)\n\n### arn_validator\n\nThe **arn_validator** package validates AWS ARNs (Amazon Resource Names) according to the AWS ARN format. This package\nprovides methods to validate various aspects of ARNs, including the partition, service, region, account ID, and resource\nID.\n\n#### Constants\n\n- `ARN_PATTERN`: Regular expression pattern for AWS ARNs.\n\n#### Methods\n\n- `arn(value: Union[str, list], raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:\n  Validates if the given ARN(s) match the ARN pattern.\n\n#### Usage\n\n```python\nfrom pyawsopstoolkit_validators.arn_validator import arn\n\n# Validate ARNs\nprint(arn('arn:aws:ec2:us-east-1:123456789012:vpc/vpc-0e9801d129EXAMPLE', False))  # Output: True\nprint(arn('arn::iam:us-east-1:123456789012:user', False))  # Output: False\n```\n\n#### References\n\n- [AWS Documentation: ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html)\n\n### policy_validator\n\nThe **policy_validator** package validates AWS IAM policy documents. This package provides methods to validate various\naspects of IAM policies, ensuring their correctness and compliance.\n\n#### Constants\n\n- `VERSION_PATTERN`: Regular expression pattern for validating version strings in policies.\n- `EFFECT_PATTERN`: Regular expression pattern for validating effect strings in policies.\n- `PRINCIPAL_PATTERN`: Regular expression pattern for validating principal strings in policies.\n\n#### Methods\n\n- `policy(value: dict, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:\n  Validates if the given policy dictionary is valid.\n\n#### Usage\n\n```python\nfrom pyawsopstoolkit_validators.policy_validator import policy\n\n# Validate IAM policy documents\nprint(policy(\n    {\n        \"Version\": \"2012-10-17\",\n        \"Id\": \"1\",\n        \"Statement\": {\n            \"Sid\": \"1\",\n            \"Principal\": \"*\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"*\",\n            \"Resource\": \"*\",\n            \"Condition\": {\n                \"Bool\": {\n                    \"aws:SecureTransport\": \"true\"\n                }\n            }\n        }\n    }, False\n))  # Output: True\nprint(policy(\n    {\n        \"Version\": \"2012-10-17\",\n        \"Id\": \"1\"\n    }, False\n))  # Output: False\n```\n\n#### References\n\n- [AWS Documentation: IAM Policy Grammar](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_grammar.html)\n\n### region_validator\n\nThe **region_validator** packages validates AWS regions. This package provides methods to validate various aspects of\nAWS, such as region code.\n\n#### Constants\n\n- `REGION_PATTERN`: Regular expression pattern used to validate region codes.\n\n#### Methods\n\n- `region(value: str, raise_error: Optional[bool] = True, custom_error_message: Optional[str] = None) -> bool`:\n  Validates if the given region code is valid.\n\n#### Usage\n\n```python\nfrom pyawsopstoolkit_validators.region_validator import region\n\n# Validate region codes\nprint(region('eu-west-1', False))  # Output: True\nprint(region('Ohio', False))  # Output: False\n```\n\n#### References\n\n- [AWS Documentation: DescribeAccount](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DescribeAccount.html)\n\n# License\n\nPlease refer to the [MIT License](LICENSE) within the project for more information.\n\n# Contributing\n\nWe welcome contributions from the community! Whether you have ideas for new features, bug fixes, or enhancements, feel\nfree to open an issue or submit a pull request on [GitHub](https://github.com/coldsofttech/pyawsopstoolkit-validators).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This package provides a comprehensive set of validation classes specifically crafted for use with AWS (Amazon Web",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/coldsofttech/pyawsopstoolkit-validators.git"
    },
    "split_keywords": [
        "aws",
        " toolkit",
        " operations",
        " tools",
        " development",
        " python",
        " validation",
        " utilities",
        " amazon-web-services"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4d45675487eaf40d6de30d27be53aee3254ff2b19e00420f93e9e4ff46b9d1b",
                "md5": "ef63b195479338cdff1bf58aa099120b",
                "sha256": "c66060b2d2b92bbda1749a5ba8e7af49c7a7c1bdf14a26b35dfd8f3e850a899c"
            },
            "downloads": -1,
            "filename": "pyawsopstoolkit_validators-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef63b195479338cdff1bf58aa099120b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12964,
            "upload_time": "2024-08-10T20:10:29",
            "upload_time_iso_8601": "2024-08-10T20:10:29.396150Z",
            "url": "https://files.pythonhosted.org/packages/c4/d4/5675487eaf40d6de30d27be53aee3254ff2b19e00420f93e9e4ff46b9d1b/pyawsopstoolkit_validators-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-10 20:10:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "coldsofttech",
    "github_project": "pyawsopstoolkit-validators",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "setuptools",
            "specs": [
                [
                    "~=",
                    "72.1.0"
                ]
            ]
        }
    ],
    "lcname": "pyawsopstoolkit-validators"
}
        
Elapsed time: 1.28885s