Saravanan666/pypi-org huggingface dataset:
Package: aws-hexagonal-adapters
aws-hexagonal-adaptersAdapters following hexagonal architecture to connect various AWS servicesExample usageS3Download objectfromosimportenvironfromaws_hexagonal_adapters.s3_serviceimportS3ServiceS3_SERVICE=S3Service(region_name=environ["CURRENT_REGION"])# Download fileS3_SERVICE.download(bucket="bucket_name",local_path=f"/tmp/object",remote_path="object")Upload objectfromosimportenvironfromaws_hexagonal_adapters.s3_serviceimportS3ServiceS3_SERVICE=S3Service(region_name=environ["CURRENT_REGION"])# Download fileS3_SERVICE.upload(bucket="bucket_name",local_path=f"/tmp/object_name",remote_path="object_name",extra_args={"StorageClass":"STANDARD_IA"},)List objectsfromosimportenvironfromaws_hexagonal_adapters.s3_serviceimportS3ServiceS3_SERVICE=S3Service(region_name=environ["CURRENT_REGION"])# Download fileS3_SERVICE.list_files(bucket="bucket_name",prefix="folder_name")Delete objectfromosimportenvironfromaws_hexagonal_adapters.s3_serviceimportS3ServiceS3_SERVICE=S3Service(region_name=environ["CURRENT_REGION"])# Download fileS3_SERVICE.delete_object(bucket="bucket_name",key="object_name")Delete objectsfromosimportenvironfromaws_hexagonal_adapters.s3_serviceimportS3ServiceS3_SERVICE=S3Service(region_name=environ["CURRENT_REGION"])objects=["folder/object1.txt","folder/object2.txt","folder/object3.txt"]# Download fileS3_SERVICE.delete_objects(bucket="bucket_name",keys=objects)DynamoDBGet Itemfromosimportenvironfromaws_hexagonal_adapters.dynamo_db_serviceimportDynamoDBServiceDYNAMODB_SERVICE=DynamoDBService(region_name=environ["REGION_NAME"])item=DYNAMODB_SERVICE.get_item(table_name=environ["DYNAMODB_TABLE_NAME"],key={"pk":f'{environ["DYNAMODB_TABLE_ITEM_NAME"]}',"sk":"1"},)Get Itemsfromosimportenvironfromboto3.dynamodb.conditionsimportKeyfromaws_hexagonal_adapters.dynamo_db_serviceimportDynamoDBServiceDYNAMODB_SERVICE=DynamoDBService(region_name=environ["REGION_NAME"])item=DYNAMODB_SERVICE.get_items(table_name=environ["DYNAMODB_TABLE_NAME"],filter_expression=Key("sk").eq("2"),)Scanfromosimportenvironfromaws_hexagonal_adapters.dynamo_db_serviceimportDynamoDBServiceDYNAMODB_SERVICE=DynamoDBService(region_name=environ["REGION_NAME"])item=DYNAMODB_SERVICE.scan_items(table_name=environ["DYNAMODB_TABLE_NAME"],index_name=environ["DYNAMODB_INDEX_NAME"],)SQSfromosimportenvironfromaws_hexagonal_adapters.sqs_serviceimportSQSServiceSQS_SERVICE=SQSService(region_name=environ["REGION_NAME"])messages=SQS_SERVICE.receive_messages(queue_url=environ["SQS_QUEUE_NAME"])
Package: aws-hostname
=============aws-hostname=============Outputs a valid hostname for a given AWS instanceInstallation============Using PIP via PyPI::pip install aws-hostnameUsing PIP via Github::pip install git+git://github.com/josegonzalez/python-aws-hostname.git#egg=aws-hostnameUsage=====CLI Usage is as follows::usage: aws-hostname [-h] [-i EC2_INSTANCE_ID] [-r EC2_REGION][-a AWS_ACCESS_KEY_ID] [-s AWS_SECRET_ACCESS_KEY][-t AWS_TAG] [-n] [-u] [-d]You can also use the equivalent environment variables in place of command arguments.This command will use the instance id and the tag ``aws:autoscaling:groupName`` to construct a valid hostname. It is useful for setting readable hostnames for autoscale groups like so::aws-hostname -r $REGION -a $ACCESS_ID -s $SECRET_KEY -i $INSTANCE_ID > /etc/hostnamehostname -F /etc/hostnameYou can also run it with the -u flag to connect using IAM profile instead of the access/secret key.In cases where it is run against a non-autoscale group node, it will fallback to the ``Name`` attribute of the instance.
Package: awsi
AWS Instance InformationSummaryawsi script can help search for a server in aws and connect to it.It uses boto to connect to AWS and build a register of all the ec2 instances you have access too.It can generate a cache of all servers in the configured regions by callingawsi --refreshIt can then connect to an instance using the instanceId, public ip address or name tag
If more than one server is found (maybe they have the same name) it will show you all of them and require you to use a different
piece of information. ID is unique so this is recommended.Installationpip install awsiConfigurationIn you home directory create a folder called '.awsi'In this folder create a config file called 'config.cfg'The contents of the file should look like the following.[main]profiles: default,work,work2regions: eu-west-1,eu-central-1,us-east-1,us-west-2,us-west-1cache_file: /tmp/awsi_cachewhere profiles refer to your aws cli profiles found in .aws/credentials | .aws/configUsageusage: awsi [-h] [--refresh | --list | --version]
            [search_string [search_string ...]]

positional arguments:
  search_string  ip, instance id or string to find in Name tag

optional arguments:
  -h, --help     show this help message and exit
  --refresh      refresh the cache
  --list         list all instances in the cache
  --version      print version
Package: aws-iam-db
AWS IAM DatabaseThis project creates a local sqlite database of AWS IAM actions using the AWS IAM documentation pages.By default it creates a sqlite database in the current directory callediam.dband stores copies of the AWS documentation pages in the/tmpdirectory.Installpython -m pip install aws-iam-dbUsageUsage: aws-iam-db [OPTIONS]

Options:
  --json-path TEXT                [default: /tmp/actions_data.json]
  --db-path TEXT                  [default: iam.db]
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.Downloading aws docs  [####################################]  100%
Finished downloading docs
Converting docs to json  [####################################]  100%
Finished processing docs to JSON
Creating database  [####################################]  100%
Database created!
Package: aws-iam-login
AWS IAM Loginaws-iam-loginallows you to login using MFA as the IAM user itself. Once logged in your temporary credentials are
stored in the~/.aws/credentialsfile for re-use.ConfigurationYou will need to configure your roles and IAM User credentials in the same places as you are used to. So in your~/.aws/credentialsfile. To make this process as easy as possible you could use the following command:aws-iam-loginmy-profileinitThis command will fetch the ARN of the caller identity. Based on this identity we will determin theusernameandmfa_serialof the IAM User. These will then be stored in the~/.aws/credentialsfile. For example:[my-profile]aws_access_key_id=XXXXXXXaws_secret_access_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXmfa_serial=arn:aws:iam::111122223333:mfa/my-iam-userusername=my-iam-userThe only addition is theusernameandmfa_serialfields.AWS Least privilegedAssuming you have an IAM User that is already configured you will need the following permissions to useaws-iam-login:{"Version":"2012-10-17","Statement":[{"Sid":"AllowSessionTokeUsingMFA","Effect":"Allow","Action":["sts:GetSessionToken"],"Resource":"*","Condition":{"BoolIfExists":{"aws:MultiFactorAuthPresent":"true"}}},{"Sid":"AllowAccessKeyRotation","Effect":"Allow","Action":["iam:ListAccessKeys","iam:CreateAccessKey","iam:UpdateAccessKey","iam:DeleteAccessKey"],"Resource":["arn:aws:iam::111122223333:user/${aws:username}"]}]}UsageWhen you want to make use of the MFA authenticated session of a configured profile. You will need to configure the
following:[profile my-role-1]role_arn=arn:aws:iam::111122223333:role/my-role-1source_profile=my-profile-stsregion=eu-west-1Then when you perform your AWS cli calls you can use theAWS_PROFILE=my-role-1as you are used to. But the first time  it will fail. The reason for this is that themy-profile-stssource profile does not exist (or the credentials are expired).
Perform the following command to login, this command will ask for your MFA Token:aws-iam-loginmy-profileThis authenticates against the AWS API and request temporary credentials from AWS using your MFA Token. These credentials are then stored as<profile-name>-sts.
So the next time you useAWS_PROFILE=my-role-1the credentials will be present and not expired.Because you are already authenticated using MFA there is no need to provide an MFA token when you assume the role.
When you switch a lot between roles you really benefit from not having to type your MFA token each time you switch.Rotating your AccessKey and SecretAccessKeyIt is advised to rotate your credentials regularly.aws-iam-logincan help with that! By executing the following command:aws-iam-loginmy-profilerotateThis command will execute the following actions:List all available keys for the user, when 1 key is active rotation is possible!Create a new AccessKey and SecretAccessKey.Use the newly created keys to deactivate the old keys.Write the new keys to the~/.aws/configurationfile.Delete the old keys.
Package: awsiamvault
aws-iam-vaultHelper to retrieve a secret from Hashicorp Vault using an EC2 instance's IAM role to authenticate.Use on an AWS EC2 instance with a role that has access to the Vault path to be retrieved.Install:pip install awsiamvaultUse:fromawsiamvaultimportread_secretsecret=read_secret(region,vault_url,path)Test:pip install test/requirements-test.txtnosetests -v --with-cover --cover-erase --cover-tests --cover-package=awsiamvault
Package: aws-iatk
AWS Integrated Application Test Kit (IATK):warning:AWS Integrated Application Test Kit is under Public PreviewAWS Integrated Application Test Kit (IATK), a new open-source test library that makes it easier for developers to create tests for cloud applications with increased speed and accuracy. With AWS IATK, developers can quickly write tests that exercise their code and its AWS integrations against an environment in the cloud, making it easier to catch mistakes early in the development process. IATK includes utilities to generate test events, validate event delivery and structure in Amazon EventBridge Event Bus, and assertions to validate call flow using AWS X-Ray traces.The AWS IATK is available for Python3.8+Documentation:https://awslabs.github.io/aws-iatk/Getting StartedFor a detailed walkthrough, see the tutorial orexamples.Installpip3 install aws-iatkGetting HelpThe best way to interact with our team is through Github. You can open anissue.ContributingWe welcome community contributions and pull requests. SeeCONTRIBUTING.mdfor information on how to set up a development environment and submit code.SecuritySeeCONTRIBUTINGfor more information.LicenseThis project is licensed under the Apache-2.0 License.
Package: aws-ic
aws-icA wrapper for EC2 Instance Connect to make a ssh connection to keyless EC2 instances more streamlined and secure.RequirementsPython3 w/ pipProper IAM PermissionsSetuppip install awc-icConfigure AWS credentialsUsageaws-ic takes two ordered arguments:aws-ic <ssh_user> <instance_id>Example:aws-ic ec2-user i-abcd1234
Package: aws-identity-manager
AWS-Identity-ManagerCommand line tool to store credentials for multiple AWS accounts and
quickly switch between them.InstallationTo install using pip:pip install aws-identity-managerOr download thelatest
releaseand install by running:python setup.py installUsageStart the interactive command line tool:awsidentityThen use the following commands:saveSave credentials (if any) found in your existing config
files for later useaddAllows you to add a new set of credentials (identity)editMake changes to existing identitychangeSelect one of your stored identies and modifies (or
creates) the configuration files for most AWS client librariesimportImport identities from a csv file downloaded from the IAM
Console (created whenever you add new users)Additional InfoAll of the credentials are saved by default in your home directory:.aws-identity-manager/identities.jsonThe scripts are designed to keep the permissions of this as well as the
modified config files secured and only accessible to the current user.
Before any changes are made to any existing AWS config files, they are
backed up:~/.aws/credentials.bakThis is only done if the backup filename doesn’t already exist though.
In other words, it would be a good idea to have your credentials
somewhere safe before running the script.
Package: awsimagetag
## ProjectAuto tagging of aws AMIs based on AMI Name prefix## Runtime Requirementspython3## Dependenciesboto3skew# Dependencies - Testunittest2## Usage as srcpython3 -m awsimagetag.core -r us-west-2 –verbose## Creat Dists./setup.py sdist –formats=gztar,zip## Usageawsamitag -r us-west-2 [-d] [-v]## Arguments-r –region   aws ec2 region endpoint-d –dry-run  will just display target amis-v –verbose  switch to enable verbose logging level## Upload to PiPy
twine upload (–skip-existing) dist/aws-auto-tag-ami-VERSION.tar.gz or zip## Author@japzio## CreditsTrustArc, Inc.## LicenseApache License
Version 2.0, January 2004http://www.apache.org/licenses/https://opensource.org/licenses/Apache-2.0
Package: aws-in-docker
aws_in_dockerMock EC2 with this moto fork + launch instances in Docker.Usage# TODOContributingContributing SetupClone the project locallyInstall the corresponding.python-versionusing something likepyenvCreate a virtual environment named.venvwithpython -m venv .venvActivate the virtual environment withsource .venv/bin/activateInstallpoetryInstallinvokewithpip install invokeRunpoetry install --no-rootRuninvoke setupContributing TestsRunpoetry run invoke testsContributing All Checks (including tests)Runpoetry run invoke hooksBuild And Publish to PyPIpoetrybuild
poetrypublish
Package: aws.inlineuserpref
IntroductionSince Plone 3.1.5, a site manager can enable or disable globally inline editing
(KSS) to all users or nobody. Enabling inline editing is fair to users ho got a
fast computer and a modern browser.Content authors in lots of organizations who have Plone powered intranets have
old computers and/or cannot install a modern browser, mostly stuck with IE6,
thus cannot use inline editing unless it bloats their computer.aws.inlineuserprefprovides a user control panel that let members choose if
they prefer or not using inline editing, such users with decent computers and
recent browser can carry on enjoying inline editing, while others with old
computers and browsers cans disable inline editing.Copyright and licenseCopyright (c) 2009 - Alter Way SolutionsThis software is subject to the provisions of the GNU General Public License,
Version 2.0 (GPL).  A copy of the GPL should accompany this distribution.
THIS SOFTWARE IS PROVIDED “AS IS” AND ANY AND ALL EXPRESS OR IMPLIED
WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
FOR A PARTICULAR PURPOSESee thedocs/LICENSE.txtfile that comes with this product.RequirementsPlone 3.1.5 or later.InstallationWith zc.buildoutRecommanded installation for production sites. Add these lines to yourbuildout.cfg[buildout]
...
eggs =
    ...
    aws.inlineuserpref
    ...

[instance]
recipe = plone.recipe.zope2instance
...
zcml =
    ...
    aw.inlineuserpref
    aw.inlineuserpref-overridesDevelopmentDevelopers of this package should use thebuildout.cfgthat comes in the
subversion bundle. SeeSubversion repositorybelow.In the Plone siteInstallaws.inlineuserprefas usually either with the quick installer or the
setup tool.UpgradingIf you upgradedaws.inlineuserpreffrom a previous version, upgrades may be
available. Open in ZMI the “Upgrades” tab of the “portal_setup” tool and look if
upgrades are available foraws.inlineuserpref:defaultprofile.Usage for content authorsThe control panel is available from the user’s preferences panel. Its usage is
obvious and self explanative.How toDefault KSS preference should be “off” for any new userI didn’t make a control panel for this. Just open thePropertiestab of theportal_memberdataobject of your Plone site, and uncheck theenable_inline_editingproperty.Subversion repositoryhttps://svn.plone.org/svn/collective/aws.inlineuserprefSupportAsk for support toAlter Way Solutions support.CreditsDeveloper :Gilles LenfantSponsor :EDFTo doPlone 4 compatiblity.Changelog1.0.0Initial release
Package: aws_inventory
# aws_inventoryA dynamic AWS inventory for Ansible -https://pypi.org/project/aws_inventory/Install examples:pip install aws_inventorypip install git+https://github.com/zahna/aws_inventory.git#egg=masterpip install -e git+https://github.com/zahna/aws_inventory.git#egg=mastergit clonehttps://github.com/zahna/aws_inventory.git#egg=masterpip install -e /path/to/aws_inventory## Config file optionsFirst, see the examples/ directory for example files that use aws_inventory.Hostnames in the config file can use tags or metadata.Metadata examples:EC2 tags such as “Name”InstanceIdPublicDnsNamePublicIpAddressPrivateIpAddressPrivateDnsName## Using an AWS profile credentialsaws_inventory can use an AWS profile’s credentials. If the environment variable AWS_PROFILE is set, aws_inventory will use it.
Package: awsiotclient
aws-iot-device-client-pythonThe AWS IoT Device Client provides device-side functionality for AWS IoT services such as jobs, device shadow, and simple pubsub.InstallationMinimum RequirementsPython 3.7.1+Install from PyPIpython3-mpipinstallawsiotclientInstall from sourcegitclonehttps://github.com/whill-labs/aws-iot-device-client-python
python3-mpipinstall./aws-iot-device-client-pythonUsageCreate MQTT connectionfromawsiotclientimportmqtt# Construct connection parametersconn_params=mqtt.ConnectionParams()# Required paramsconn_params.endpoint=<your_endpoint_url>conn_params.cert=<path_to_your_certificate>conn_params.key=<path_to_your_private_key>conn_params.root_ca=<path_to_your_root_ca># Optional paramsconn_params.client_id=<client_id># default "mqtt-" + uuid4()conn_params.signing_region=<signing_region># default "ap-northeast-1" (Tokyo Region)conn_params.use_websocket=<True/False># default False# Initialize connectionmqtt_connection=mqtt.init(conn_params)connect_future=mqtt_connection.connect()connect_future.result()Use AWS IoT named shadowNote that usage of classic shadow client is similar to named shadow client.without delta (one-way communication from device to cloud)fromawsiotclientimportmqtt,named_shadow# <create mqtt connection here as described above>my_client=named_shadow.client(mqtt_connection,thing_name="my_thing",shadow_name="my_shadow")my_value=dict(foo="var")my_clinet.change_reported_value(my_value)with delta (two-way communication from/to device and cloud)fromawsiotclientimportmqtt,named_shadowdefmy_delta_func(thing_name:str,shadow_name:str,value:Dict[str,Any])->None:print("my_client invokes this callback when it receives delta message")print(f"thing_name:{thing_name}, shadow_name:{shadow_name}, value:{value}")# <create mqtt connection here as described above>my_client=named_shadow.client(mqtt_connection,thing_name="my_thing",shadow_name="my_shadow",delta_func=my_delta_func,)my_value=dict(foo="var")my_client.change_reported_value(my_value)# <wait until the client receives delta>Use AWS IoT jobsfromawsiotclientimportmqtt,named_shadowdefjob_runner(id:str,document:dict):print("my_client invokes this callback when it receives job document")print(f"job id:{id}, document:{document}")# <create mqtt connection here as described abovejob_client=jobs.client(mqtt_connection,thing_name="my_thing",job_func=job_runner)# <wait until the client receives job>LicenseThis library is licensed under the Apache 2.0 License.AcknowledgmentsAWS IoT Device SDK v2 for Python
Package: awsiot-credentialhelper
AWS IoT Core Credential Provider Session HelperThis package provides an easy way to create arefreshableBoto3 Session using theAWS IoT Core credential provider.Package documentationFeaturesAutomatic refresh ofBoto3 credentialsthrough requests to the AWS IoT Core credential provider. No need to manage or maintain refresh times.Uses the underlyingAWS CRT Pythonbindings for querying the credential provider instead of the Python standard library. This provides support for both certificate and private keys as filesoras environment variables.Extensible to using other TLS methods such as PKCS#11 hardware security modules (see Advanced section).Only requires four function calls to create a session helper, Boto3 session, Boto3 client, and then client API calls.RequirementsPython 3.8 - 3.11. Support not include for 3.7 as that version will be end of life in June, 2023. If 3.7 supportisimportant, please open an issue to discuss.InstallationYou can installAWS IoT Core Credential Provider Session HelperviapipfromPyPI:python3 -m pip install awsiot-credentialhelperUsagePrior to use, ensure all cloud-side resources for IAM and AWS IoT Core have been properly created and configured. Then, with the AWS IoT registered X.509 certificate and corresponding private key (e.g.,iot_thing.pemandiot_thing.pem.key), you can create and use the helper as follows:fromawsiot_credentialhelper.boto3_sessionimportBoto3SessionProvider# Create boto3 session objectboto3_session=Boto3SessionProvider(endpoint="your_endpoint.credentials.iot.us-west-2.amazonaws.com",role_alias="your_aws_iot_role_alias_name",certificate="iot_thing.pem",private_key="iot_thing.pem.key",thing_name="iot_thing",).get_session()# Use in regular Boto3 chained operations, such as returning caller identityprint(boto3_session.client("sts").get_caller_identity()){'UserId':'AROA...F3D:4686c...0a0d','Account':'1234567890','Arn':'arn:aws:sts::1234567890:assumed-role/iam_role_name/4686c...0a0d','ResponseMetadata':{'RequestId':'cc04...10bc','HTTPStatusCode':200,'HTTPHeaders':{'x-amzn-requestid':'cc04...10bc','content-type':'text/xml','content-length':'554','date':'Tue, 21 Feb 2023 21:18:23 GMT'},'RetryAttempts':0}}# Or by creating a service client and making API callsiot=boto3_session.client("iot")result=iot.list_things()Please see thepackage documentationfor more details and advanced use.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theApache 2.0 license.
Details on third party packages used by this package can be foundhere.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.CreditsThis project template was generated from a fork of@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: awsiotsdk
AWS IoT Device SDK v2 for PythonThis document provides information about the AWS IoT Device SDK v2 for Python. This SDK is built on theAWS Common RuntimeJump To:InstallationSamplesGetting HelpFAQAPI DocsMQTT5 User GuideInstallationMinimum RequirementsPython 3.7+Step-by-step instructionsInstall from PyPIMacOS and Linux:python3 -m pip install awsiotsdkWindows:python -m pip install awsiotsdkInstall from source# 1. Create a workspace directory to hold all the SDK filesmkdirsdk-workspacecdsdk-workspace# 2. Clone the repository. You could select the version of the SDK you desire to use.gitclone-b<SDK_VERSION>https://github.com/aws/aws-iot-device-sdk-python-v2.git# 3. (Optional) Setup the version number of your local build. The default version#    for awsiotsdk is set to "1.0.0-dev", you can set the version number of the#    local build in "aws-iot-device-sdk-python-v2/awsiot/__init__.py"sed-i"s/__version__ = '1.0.0-dev'/__version__ = '<SDK_VERSION>'/"\aws-iot-device-sdk-python-v2/awsiot/__init__.py# 4. Install using Pip (use 'python' instead of 'python3' on Windows)python3-mpipinstall./aws-iot-device-sdk-python-v2SamplesSamples READMEGetting HelpThe best way to interact with our team is through GitHub. You can open adiscussionfor guidance questions or anissuefor bug reports, or feature requests. You may also find help on community resources such asStackOverFlowwith the tag#aws-iotor if you have a support plan withAWS Support, you can also create a new support case.Please make sure to check out our resources too before opening an issue:FAQAPI DocsIoT Guide(source)Check for similarIssuesAWS IoT Core DocumentationDev BlogIntegration with AWS IoT Services such asDevice ShadowandJobsis provided by code that been generated from a model of the service.Contributions GuidelinesLicenseThis library is licensed under theApache 2.0 License.Latest released version: v1.21.0