{"id":37073789,"url":"https://github.com/coldsofttech/pyawsopstoolkit-advsearch","last_synced_at":"2026-01-14T08:39:46.162Z","repository":{"id":252627061,"uuid":"840963070","full_name":"coldsofttech/pyawsopstoolkit-advsearch","owner":"coldsofttech","description":"The pyawsopstoolkit_advsearch module delivers an exhaustive array of advanced search functionalities, tailor-made for seamless integration with AWS","archived":false,"fork":false,"pushed_at":"2024-08-11T18:24:34.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T20:24:16.763Z","etag":null,"topics":["advance-search","amazon-web-services","aws","development","operations","python","search","search-functionality","toolkit","tools","utilities"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coldsofttech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-11T08:23:44.000Z","updated_at":"2024-08-11T18:21:37.000Z","dependencies_parsed_at":"2024-08-11T10:55:59.680Z","dependency_job_id":null,"html_url":"https://github.com/coldsofttech/pyawsopstoolkit-advsearch","commit_stats":null,"previous_names":["coldsofttech/pyawsopstoolkit-advsearch"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coldsofttech/pyawsopstoolkit-advsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldsofttech%2Fpyawsopstoolkit-advsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldsofttech%2Fpyawsopstoolkit-advsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldsofttech%2Fpyawsopstoolkit-advsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldsofttech%2Fpyawsopstoolkit-advsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coldsofttech","download_url":"https://codeload.github.com/coldsofttech/pyawsopstoolkit-advsearch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldsofttech%2Fpyawsopstoolkit-advsearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advance-search","amazon-web-services","aws","development","operations","python","search","search-functionality","toolkit","tools","utilities"],"created_at":"2026-01-14T08:39:45.422Z","updated_at":"2026-01-14T08:39:46.145Z","avatar_url":"https://github.com/coldsofttech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyawsopstoolkit_advsearch\n\nThe **pyawsopstoolkit_advsearch** module delivers an exhaustive array of advanced search functionalities, tailor-made\nfor seamless integration with AWS (Amazon Web Services). Meticulously engineered, these advanced searches are finely\ntuned to meet the distinctive demands inherent to the expansive AWS ecosystem, encompassing a diverse spectrum of\naspects.\n\n## Getting Started\n\nReady to supercharge your AWS operations? Let's get started with **pyawsopstoolkit_advsearch!**\n\n### Installation\n\nInstall **pyawsopstoolkit_advsearch** via pip:\n\n```bash\npip install pyawsopstoolkit_advsearch\n```\n\n## Documentation\n\n- [Constants](#constants)\n- [ec2](#ec2)\n- [iam](#iam)\n\n### Constants\n\nThis package supports various conditions for advanced searches, outlined below as global constants:\n\n- `OR`: Represents the **or** condition.\n- `AND`: Represents the **and** condition.\n- `LESS_THAN`: Represents the less than **\u003c** value.\n- `LESS_THAN_OR_EQUAL_TO`: Represents the less than or equal to **\u003c=** value.\n- `GREATER_THAN`: Represents the greater than **\u003e** value.\n- `GREATER_THAN_OR_EQUAL_TO`: Represents the greater than or equal to **\u003e=** value.\n- `EQUAL_TO`: Represents the equal to **=** value.\n- `NOT_EQUAL_TO`: Represents the not equal to **!=** value.\n- `BETWEEN`: Represents the between range **\u003c x \u003c** value. These constants facilitate the formulation of complex\n  queries, enabling precise and efficient data retrieval within the AWS environment.\n\n### ec2\n\nThis **pyawsopstoolkit_advsearch.ec2** subpackage offers sophisticated search capabilities specifically designed for\nAWS (Amazon Web Services) Elastic Compute Cloud (EC2).\n\n#### SecurityGroup\n\nThe **SecurityGroup** class provides advanced search features related to EC2 security groups.\n\n##### Constructors\n\n- `SecurityGroup(session: Session) -\u003e None`: Initializes a new **SecurityGroup** object.\n\n##### Methods\n\n- `search_security_groups(condition: str = OR, region: str | list = 'eu-west-1', include_usage: bool = False, **kwargs) -\u003e list`:\n  Returns a list of EC2 security groups using advanced search features supported by the specified arguments. For details\n  on supported keyword arguments, please refer to the section below.\n\n##### Properties\n\n- `session`: An `pyawsopstoolkit.session.Session` object providing access to AWS services.\n\n##### `search_security_groups` Supported Keyword Arguments\n\nThe **search_security_groups** method allows you to search for EC2 security groups using various keyword arguments.\nBelow are the supported keyword arguments:\n\n- `description`: Specifies the description of the EC2 security group. Example: `description='test'`.\n- `id`: Specifies the unique identifier of the EC2 security group. Example: `id='sg-12345678'`.\n- `in_use`: Specifies the flag to indicate if the EC2 security group has any associated ENIs. Example: `in_use=True`.\n- `in_from_port`: Specifies the inbound EC2 security group rule entry \"from\" port. Example: `in_from_port=80`.\n- `in_ip_protocol`: Specifies the inbound EC2 security group rule entry protocol. Example: `in_ip_protocol='tcp'`.\n- `in_port_range`: Specifies the inbound EC2 security group rule entry port if it exists within range \"from\" and \"to\".\n  Example: `in_port_range=80`.\n- `in_to_port`: Specifies the inbound EC2 security group rule entry \"to\" port. Example: `in_to_port=443`.\n- `name`: Specifies the name of the EC2 security group. Example: `name='web-servers-sg'`.\n- `out_from_port`: Specifies the outbound EC2 security group rule entry \"from\" port. Example: `out_from_port=80`.\n- `out_ip_protocol`: Specifies the outbound EC2 security group rule entry protocol. Example: `out_ip_protocol='udp'`.\n- `out_port_range`: Specifies the outbound EC2 security group rule entry port if it exists within range \"from\" and \"to\".\n  Example: `out_port_range=443`.\n- `out_to_port`: Specifies the outbound EC2 security group rule entry \"to\" port. Example: `out_to_port=443`.\n- `owner_id`: Specifies the owner ID of the EC2 security group. Example: `owner_id='123456789012'`.\n- `tag_key`: Specifies the tag key associated with the EC2 security group. Example: `tag_key='test_key'`.\n- `tag`: Specifies the tag key and value combination associated with the EC2 security group (dictionary format).\n  Example: `tag={'key': 'test_key', 'value': 'test_value'}`.\n- `vpc_id`: Specifies the VPC ID of the EC2 security group. Example: `vpc_id='vpc-abcdefgh'`.\n\nAll the above arguments support string types and accept regular expression patterns. Additionally,\nthe `in_from_port`, `out_from_port`, `in_to_port`, `out_to_port`, `in_port_range`, and `out_port_range` arguments\nsupport integer types.\n\n###### Usage\n\n```python\nfrom pyawsopstoolkit.session import Session\nfrom pyawsopstoolkit_advsearch.ec2 import SecurityGroup\nfrom pyawsopstoolkit_advsearch import OR\n\n# Create a session using the 'default' profile\nsession = Session(profile_name='default')\n\n# Initialize the EC2 security group object with the session\nsg_object = SecurityGroup(session=session)\n\n# Example searches:\n\n# 1. Search for all EC2 security groups\nprint(sg_object.search_security_groups())\n\n# 2. Search for EC2 security groups with the name matching 'test_sg'\nprint(sg_object.search_security_groups(condition=OR, region='us-east-2', name=r'test_sg'))\n\n# 3. Search for EC2 security groups with the name matching 'test_sg' or description matching 'test'\nprint(sg_object.search_security_groups(condition=OR, region='us-east-2', name=r'test_sg', description=r'test'))\n\n# 4. Search for EC2 security groups that contain the tag key 'test_key'\nprint(sg_object.search_security_groups(tag_key='test_key'))\n\n# 5. Search for EC2 security groups that contain a tag with key 'test_key' and value 'test_value'\nprint(sg_object.search_security_groups(tag={'key': 'test_key', 'value': 'test_value'}))\n\n# 6. Search for EC2 security groups that contain port 80 as an inbound rule entry\nprint(sg_object.search_security_groups(in_from_port=80))\n\n# 7. Search for EC2 security groups that contain 'all' traffic within inbound rule entry protocols\nprint(sg_object.search_security_groups(in_ip_protocol='all'))\n\n# 8. Search for EC2 security groups that are in use and associated with ENIs\nprint(sg_object.search_security_groups(include_usage=True, in_use=True))\n```\n\n### iam\n\nThis **pyawsopstookit_advsearch.iam** subpackage offers sophisticated search capabilities specifically designed for\nAWS (Amazon Web Services) Identity and Access Management (IAM).\n\n#### Role\n\nA class representing advanced search features related to IAM roles.\n\n##### Constructors\n\n- `Role(session: Session) -\u003e None`: Initializes a new **Role** object.\n\n##### Methods\n\n- `search_roles(condition: str = OR, include_details: bool = False, **kwargs) -\u003e list`: Returns a list of IAM roles\n  using advanced search features supported by the specified arguments. For details on supported kwargs, please refer to\n  the section below.\n\n##### Properties\n\n- `session`: An `pyawsopstoolkit.session.Session` object providing access to AWS services.\n\n##### `search_roles` Supported Keyword Arguments\n\nThe **search_roles** function allows you to search for IAM roles using various keyword arguments. Below are the\nsupported keyword arguments:\n\n- `arn`: Specifies the ARN of the IAM role. Example: `arn='arn:aws:iam::111122223333:role/role-name'`.\n- `created_date`: Specifies the created date of the IAM role (datetime format).\n  Example: `created_date={GREATER_THAN: datetime(2024, 10, 15)}`.\n- `description`: Specifies the description of the IAM role. Example: `description='test'`.\n- `id`: Specifies the ID of the IAM role. Example: `id='AIDACKCEVSQ6C2EXAMPLE'`.\n- `last_used_date`: Specifies the last used date of the IAM role (datetime format).\n  Example: `last_used_date={BETWEEN: [datetime(2023, 10, 15), datetime(2024, 10, 15)]}`.\n- `last_used_region`: Specifies the region where the IAM role was last used. Example: `last_used_region='eu-west-1'`.\n- `max_session_duration`: Specifies the maximum session duration of the IAM role (in seconds, integer type).\n  Example: `max_session_duration={LESS_THAN: 3600}`.\n- `name`: Specifies the name of the IAM role. Example: `name='test_role'`.\n- `path`: Specifies the path of the IAM role. Example: `path='/service-role/'`.\n- `permissions_boundary_arn`: Specifies the ARN of the permissions boundary for the IAM role.\n  Example: `permissions_boundary_arn='arn:aws:iam::111122223333:policy/policy-name'`.\n- `permissions_boundary_type`: Specifies the type of permissions boundary for the IAM role.\n  Example: `permissions_boundary_type='Policy'`.\n- `tag_key`: Specifies the tag key associated with the IAM role. Example: `tag_key='test_key'`.\n- `tag`: Specifies the tag key and value combination associated with the IAM role (dictionary format).\n  Example: `tag={'key': 'test_key', 'value': 'test_value'}`.\n\nAll the above arguments support string types and accept regular expression patterns. Additionally,\nthe `max_session_duration`, `created_date`, and `last_used_date` arguments support conditions such as less than, greater\nthan, and between. For more details, please refer to the constants above.\n\n###### Usage\n\n```python\nfrom datetime import datetime\n\nfrom pyawsopstoolkit.session import Session\nfrom pyawsopstoolkit_advsearch.iam import Role\nfrom pyawsopstoolkit_advsearch import OR, AND, LESS_THAN, BETWEEN\n\n# Create a session using the 'default' profile\nsession = Session(profile_name='default')\n\n# Initialize the IAM Role object with the session\nrole_object = Role(session=session)\n\n# Example searches:\n# 1. Search for all IAM roles\nprint(role_object.search_roles())\n\n# 2. Search for IAM roles with the name matching 'test_role'\nprint(role_object.search_roles(condition=OR, name=r'test_role'))\n\n# 3. Search for IAM roles with the name matching 'test_role' or description matching 'test'\nprint(role_object.search_roles(condition=OR, name=r'test_role', description=r'test'))\n\n# 4. Search for IAM roles with both path matching '/service-role/' and name matching 'test'\nprint(role_object.search_roles(condition=AND, path='/service-role/', name='test'))\n\n# 5. Search for IAM roles with a maximum session duration less than 4 hours (14400 seconds)\nprint(role_object.search_roles(max_session_duration={LESS_THAN: 14400}))\n\n# 6. Search for IAM roles last used between October 15, 2023, and October 15, 2024\nprint(role_object.search_roles(last_used_date={BETWEEN: [datetime(2023, 10, 15), datetime(2024, 10, 15)]}))\n\n# 7. Search for IAM roles that contain the tag key 'test_key'\nprint(role_object.search_roles(tag_key='test_key'))\n\n# 8. Search for IAM roles that contain a tag with key 'test_key' and value 'test_value'\nprint(role_object.search_roles(tag={'key': 'test_key', 'value': 'test_value'}))\n```\n\n#### User\n\nA class representing advance search features related with IAM users.\n\n##### Constructors\n\n- `User(session: Session) -\u003e None`: Initializes a new **User** object.\n\n##### Methods\n\n- `search_users(condition: str = OR, include_details: bool = False, **kwargs) -\u003e list`: Returns a list of IAM users\n  using advanced search features supported by the specified arguments. For details on supported kwargs, please refer to\n  the section below.\n\n##### Properties\n\n- `session`: An `pyawsopstoolkit.session.Session` object providing access to AWS services.\n\n##### `search_users` Supported Keyword Arguments\n\nThe `search_users` function allows you to search for IAM users using various keyword arguments. Below are the supported\nkeyword arguments:\n\n- `access_key_id`: Specifies the ID of the IAM user access key. Example: `access_key_id='ABCD'`.\n- `access_key_region`: Specifies the last used region of the IAM user access key.\n  Example: `access_key_region='eu-west-1'`.\n- `access_key_service`: Specifies the last used service of the IAM user access key.\n  Example: `access_key_service='ec2.amazonaws.com'`.\n- `access_key_status`: Specifies the status of the IAM user access key. Example: `access_key_status='Active'`.\n- `arn`: Specifies the ARN of the IAM user. Example: `arn='arn:aws:iam::111122223333:user/test_user'`.\n- `created_date`: Specifies the created date of the IAM user (datetime format).\n  Example: `created_date={GREATER_THAN: datetime(2024, 10, 15)}`.\n- `id`: Specifies the ID of the IAM user. Example: `id='AIDACKCEVSQ6C2EXAMPLE'`.\n- `login_profile_created_date`: Specifies the login profile created date of the IAM user (datetime format).\n  Example: `login_profile_created_date={GREATER_THAN: datetime(2024, 10, 15)}`.\n- `login_profile_password_reset_required`: Specifies the flag of the login profile to check if a password reset is\n  required for the IAM user (boolean format). Example: `login_profile_password_reset_required=False`.\n- `name`: Specifies the name of the IAM user. Example: `name='test_user'`.\n- `password_last_used_date`: Specifies the password last used date of the IAM user (datetime format).\n  Example: `password_last_used_date={BETWEEN: [datetime(2023, 10, 15), datetime(2024, 10, 15)]}`.\n- `path`: Specifies the path of the IAM user. Example: `path='/'`.\n- `permissions_boundary_arn`: Specifies the ARN of the permissions boundary for the IAM user.\n  Example: `permissions_boundary_arn='arn:aws:iam::111122223333:policy/policy-name'`.\n- `permissions_boundary_type`: Specifies the type of permissions boundary for the IAM user.\n  Example: `permissions_boundary_type='Policy'`.\n- `tag_key`: Specifies the tag key associated with the IAM user. Example: `tag_key='test_key'`.\n- `tag`: Specifies the tag key and value combination associated with the IAM user (dictionary format).\n  Example: `tag={'Key': 'test_key', 'Value': 'test_value'}`.\n\nAll the above arguments support string types and accept regular expression patterns. Additionally, the `created_date`\nand `password_last_used_date` arguments support conditions such as less than, greater than, and between. For more\ndetails, please refer to the constants above.\n\n###### Usage\n\n```python\nfrom datetime import datetime\n\nfrom pyawsopstoolkit.session import Session\nfrom pyawsopstoolkit_advsearch.iam import User\nfrom pyawsopstoolkit_advsearch import OR, AND, BETWEEN\n\n# Create a session using the 'default' profile\nsession = Session(profile_name='default')\n\n# Initialize the IAM User object with the session\nuser_object = User(session=session)\n\n# Example searches:\n# 1. Search for all IAM users\nprint(user_object.search_users())\n\n# 2. Search for IAM users with the name matching 'test_user'\nprint(user_object.search_users(condition=OR, name=r'test_user'))\n\n# 3. Search for IAM users with both path matching '/' and name matching 'test'\nprint(user_object.search_users(condition=AND, path='/', name='test'))\n\n# 4. Search for IAM users password last used between October 15, 2023, and October 15, 2024\nprint(user_object.search_users(password_last_used_date={BETWEEN: [datetime(2023, 10, 15), datetime(2024, 10, 15)]}))\n\n# 5. Search for IAM roles that contain the tag key 'test_key'\nprint(user_object.search_users(tag_key='test_key'))\n\n# 6. Search for IAM roles that contain a tag with key 'test_key' and value 'test_value'\nprint(user_object.search_users(tag={'key': 'test_key', 'value': 'test_value'}))\n```\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-advsearch).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldsofttech%2Fpyawsopstoolkit-advsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoldsofttech%2Fpyawsopstoolkit-advsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldsofttech%2Fpyawsopstoolkit-advsearch/lists"}