Saravanan666/pypi-org huggingface dataset:
Package: aws-apimatic
Getting startedHow to BuildYou must have Python2 >=2.7.9or Python3 >=3.4installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc.
These dependencies are defined in therequirements.txtfile that comes with the SDK.
To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps athttps://pip.pypa.io/en/stable/installing/.Python and PIP executables should be defined in your PATH. Open command prompt and typepip --version.
This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.Using command line, navigate to the directory containing the generated files (includingrequirements.txt) for the SDK.Run the commandpip install -r requirements.txt. This should install all the required dependencies.How to UseThe following section explains how to use the AwsApimatic SDK package in a new project.1. Open Project in an IDEOpen up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.Click onOpenin PyCharm to browse to your generated SDK directory and then clickOK.The project files will be displayed in the side bar as follows:2. Add a new Test ProjectCreate a new directory by right clicking on the solution name as shown below:Name the directory as "test"Add a python file to this project with the name "testsdk"Name it "testsdk"In your python file you will be required to import the generated python library using the following code linesfromaws_apimatic.aws_apimatic_clientimportAwsApimaticClientAfter this you can write code to instantiate an API client object, get a controller object and  make API calls. Sample code is given in the subsequent sections.3. Run the Test ProjectTo run the file within your test project, right click on your Python file inside your Test project and click onRunHow to TestYou can test the generated SDK and the server with automatically generated test
cases. unittest is used as the testing framework and nose is used as the test
runner. You can run the tests as follows:From terminal/cmd navigate to the root directory of the SDK.Invokepip install -r test-requirements.txtInvokenosetestsInitializationAPI client can be initialized as following.client=AwsApimaticClient()Class ReferenceList of ControllersAWSECommerceServiceBindingControllerAWSECommerceServiceBindingControllerGet controller instanceAn instance of theAWSECommerceServiceBindingControllerclass can be accessed from the API Client.awse_commerce_service_binding_controller=client.awse_commerce_service_bindingcreate_item_searchTODO: Add a method descriptiondefcreate_item_search(self,body)ParametersParameterTagsDescriptionbodyRequiredTODO: Add a parameter descriptionExample Usagebody=ItemSearchRequestMsg()result=awse_commerce_service_binding_controller.create_item_search(body)Back to List of Controllers
Package: awsarchive
awsarchiveis a Python toolkit for archiving files usingAWSservices.The goal of this project is to provide best practice methods for archiving files
using the products provided byAWS. This project will provide both command
line utilities and Python API’s.Used AWS ServicesCommand line utilitiesContributeFurther Documentation:http://awsarchive.readthedocs.org/Used AWS Servicesawsarchivemakes use of the following AWS services:GlacierSimpleDBThe project assumes that you have a single AWS access and secret key that can be
used across the AWS services used.Command line utilitiesawsarchivecan be accessed via the command line usingawsarchivefollowed
by the command you wish to perform.To list all the commands available do:$awsarchive--helpor to get help for a specific command do:$awsarchive<command>--helpCommandsDescriptionglacierMove files toGlacier.Contributeawsarchiveis an open-source software originally written byBillyShambrookand released under the MIT licence. The project is hosted onGithub, where
everyone is welcome to contribute, ask for help or simply give feedback. Please
fork project, add your changes and open a pull request.
Package: aws-arn-delete
aws-arn-deleteAmbitious attempt at deleting AWS resources by using Amazon Resource Name (ARN) formatInstalling:)DevelopingUsing BatectThis project useshttps://github.com/charleskorn/batectas a default method of developing. Batect allows you to develop locally on your development machine without the need of installing all dependencies or setting up a virtual environment yourself. Batect is also integrated into the CI process so you can replicate the same steps done on buildingRequirementsDocker 17.06 or newerJava 8 or newerMac OS X and Linux:curlWindows: Windows 10 OSSetting up environmentMac OS / Linux./batect <command>Windows.\batect.cmd <command>Useful Flags + Commands$ ./batect --help
<help prompt>

$ ./batect --list-tasks
Available tasks:
- development-envNot using BatectFeel free to set up your development in your own way, however no support will be given setting up the project as it has been developed usingBatect, it is also integrated into CI. We suggest to consider using it as it can help to contribute to the shared development environment as a whole, minimal setup is needed
Package: aws-arns
☁️ Welcome toaws_arnsDocumentationAmazon Resource Names (ARNs) Python library. It parses / constructs ARN in Python, and provide more human intuitive interface to access AWS Resource attributes like aws service name, aws account id, aws region, resource type, resource id, resource name, short name, long name, etc …Seeusage examples.Installaws_arnsis released on PyPI, so all you need is:$pipinstallaws_arnsTo upgrade to latest version:$pipinstall--upgradeaws_arns
Package: awsassume
Execute AWS CLI commands after assuming rolePrerequisitePython 3.6 or aboveAWS CLI or equivalent AWS supported CLIInstallInstall using pip$ pip install awsassumeInstall using setup script$ python setup.py installUsageusage: awsassume [-h] -a ROLE_ARN -n ROLE_SESSION_NAME [--no-cache]
                 [-r REGION] [-c COMMAND [COMMAND ...]]

Execute AWS CLI commands after assuming role

optional arguments:
  -h, --help            show this help message and exit
  --no-cache            Disable caching of the assumed role response
  -r REGION, --region REGION
                        The region to be associated with the client
  -c COMMAND [COMMAND ...], --command COMMAND [COMMAND ...]
                        The AWS CLI command to execute after assuming role

required arguments:
  -a ROLE_ARN, --role-arn ROLE_ARN
                        The ARN of the role to assume
  -n ROLE_SESSION_NAME, --role-session-name ROLE_SESSION_NAME
                        An identifier for the assumed role sessionCachingBy default, the assumed role response will be cached to~/.awsassume/cacheand used until it expires.
The cache will expire one hour after the assume role request is successful.If caching of the assumed role response is undesirable, use the--no-cacheflag to disable caching of the assumed role response.Example$ awsassume -a arn:aws:iam::0123456789012:role/assume_role_test -n sessionname --no-cacheRegionThe-ror--regionoption can be used to set theAWS_DEFAULT_REGIONenvironment variable.Example$ awsassume -a arn:aws:iam::0123456789012:role/assume_role_test -n sessionname -r ap-southeast-1CommandThe-cor--commandoption can be used to pass the AWS CLI that is to be executed after successfully assuming role.
The command will be executed with the following environment variables set to the credentials returned by the assumed role response.AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENAWS_DEFAULT_REGION(only if the-ror--regionoption is set)Example$ awsassume -a arn:aws:iam::0123456789012:role/assume_role_test -n sessionname -c aws s3 lsIf the-cor--commandoption is omitted, the output of the program can be evaluated to export the following environment variables to the current shell.AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENAWS_DEFAULT_REGION(only if the-ror--regionoption is set)Example$ `awsassume -a arn:aws:iam::0123456789012:role/assume_role_test -n sessionname`DevelopmentClone the repository$ git clone https://github.com/zulhilmizainuddin/aws-assume.gitCreate and activate virtual environment$ python -m venv ./venv
$ source ./venv/bin/activateInstall into development environment$ python setup.py developRun unit test with pytest$ python setup.py testRun typing checking with mypy$ mypy awsassumePublishing to PyPICreate source and binary distribution$ python setup.py sdist bdist_wheelUpload to PyPI$ twine upload dist/*
Package: aws-assume
AWS Assume daemonThis script automatically assumes every 15 minutes the specified role using a
Yubikey as MFA (multi factor authentication) and updates~/.aws/credentials.As long as you've got your yubikey connected to your computer you'll never
have to enter a second factor authentication code for the aws cli. As other
tools / libraries (boto3) use~/.aws/credentialsas well you don't have to
enter a token for these either.UsageYou can install aws_assume using pip (pip install aws_assume), I recommend
to install aws_assume using poetry (poetry install aws_assume) or in a
virtualenv.Your~/.aws/credentialsshould contain your credentials and a profile with
the the keysaws_access_key_id,aws_secret_access_keyandaws_session_token.For example:~/.aws/credentials[default]aws_access_key_id=...(your key id)...aws_secret_access_key=...(your access key)...[profile]aws_access_key_id=...(placeholder, can be anything)...aws_secret_access_key=...(placeholder, can be anything)...aws_session_token=...(placeholder, can be anything)...Your~/.aws/credentialswill be updated in place, only the specified profile
section should be touched (your comments will be safe).Older versions are rotated up to 5 items.Next_assumeshould be started with the following arguments:_assume--rolearn...--oath_slot=...--serialnumber=...--profile_name=...--access-key-id=...--secret-access-key=...--mfa-session-duration=...ArgumentDescription--rolearnarn of the role you'd like to assume--oath_slotoath slot on your yubikey--serialnumberserial number of your MFA--profile_nameprofile used in~/.aws/credentials--access-key-idaccess key (as obtained from IAM console)--secret-access-keysecret access key (as obtained from IAM console)--mfa-session-durationduration (in seconds) for MFA session--credentials-sectionyou can specify a different section than default in~/.aws/credentialsYou should only run one_assumeprocess per profile, I use systemd for
starting_assume, by using the following unit file:~/.config/systemd/user/aws_assume@.service[Unit]Description=Amazon Web Services token daemon[Service]Type=simpleExecStart=%h/bin/_assume --rolearn='...%i...' --oath_slot=... --serialnumber=... --profile_name='...%i...' --access-key-id='...' --secret-access-key='...'Restart=on-failure[Install]WantedBy=default.targetAnd reload systemd usingsystemctl --user daemon-reload, start_assumeusingsystemctl --user start aws_assume@...If you're not so fortunate to have systemd you can also use something likesupervisordto start_assume.~/supervisord.conf[supervisord][supervisorctl]serverurl=unix:///home/user/supervisord.sock[unix_http_server]file=/home/user/supervisord.sock[rpcinterface:supervisor]supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface[program:assume-...]command=/home/user/bin/_assume --rolearn=... --oath_slot=... --serialnumber=... --profile_name=... --access-key-id=... --secret-access-key=...autorestart=trueStart supervisord usingsupervisord -c supervisor.confand start assume usingsupervisorctl -c supervisor.conf start assume-....
Package: aws-assume-role
aws-assume-roleA helper tool to easily assume AWS RolesInstallationInstall:pip3 install aws-assume-roleExample usages:Print to your terminal:aws-assume-role --role-name="test_role" --account-id="123456789012"Export to current terminal:eval $(aws-assume-role --role-name="test_role" --account_id="123456789012")ContributingContributions are warmly welcomed! You can fork this project and file a PR if you want!
Package: aws-assume-role-otp
aws-assume-role-otpAWS Assume Role OTP allows you to assume a role on AWS at the same time it generates the MFA token.Installationpip install aws-assume-role-otpUsageaws-assume-role-otpAdd roleaws-assume-role-otp--add-roleRemove roleaws-assume-role-otp--remove-roleFirst time configurationThe first time you run this tool, it will ask you to inform:AWS Access Key IDAWS Secret Access KeySerial MFA Secret.How to register deviceMFA ARNRoles and profilesBuild locallypip install build
python -m build
pip install dist/aws_assume_role_otp-0.3-py3-none-any.whlChangelog[0.3] - 2023-10-02AddedAllow to add or remove roles
Package: aws-authenticate-inline
AWS Authenticate InlineThis module provides a convenient way to authenticate to AWS in a notebooking environment like Jupyter Notebook or Google Colab.Simply import the module, then proceed as normal with (for example) thebotocoreorboto3packages. Ifbotocoreisn't able to find valid credentials via~/.aws, or environment variables, or via the instance's IAM role, then it will prompt you for credentials.
Package: awsauthenticationlib
A library providing pre signed urls and valid sessions for some aws services that still do not present an api.Documentation:https://awsauthenticationlib.readthedocs.org/en/latestDevelopment WorkflowThe workflow supports the following stepslinttestbuilddocumentuploadgraphThese actions are supported out of the box by the corresponding scripts under _CI/scripts directory with sane defaults based on best practices.
Sourcing setup_aliases.ps1 for windows powershell or setup_aliases.sh in bash on Mac or Linux will provide with handy aliases for the shell of all those commands prepended with an underscore.The bootstrap script creates a .venv directory inside the project directory hosting the virtual environment. It uses pipenv for that.
It is called by all other scripts before they do anything. So one could simple start by calling _lint and that would set up everything before it tried to actually lint the projectOnce the code is ready to be delivered the _tag script should be called accepting one of three arguments, patch, minor, major following the semantic versioning scheme.
So for the initial delivery one would call$ _tag –minorwhich would bump the version of the project to 0.1.0 tag it in git and do a push and also ask for the change and automagically update HISTORY.rst with the version and the change provided.So the full workflow after git is initialized is:repeat as necessary (of course it could be test - code - lint :) )codelinttestcommit and pushdevelop more through the code-lint-test cycletag (with the appropriate argument)buildupload (if you want to host your package in pypi)document (of course this could be run at any point)Important InformationThis template is based on pipenv. In order to be compatible with requirements.txt so the actual created package can be used by any part of the existing python ecosystem some hacks were needed.
So when building a package out of thisdo notsimple call$ python setup.py sdist bdist_eggas this will produce an unusable artifact with files missing.Instead use the provided build and upload scripts that create all the necessary files in the artifact.Project FeaturesProvides pre signed urls to the aws consoleProvides valid python requests session object for SSOProvides valid python requests session object for Control TowerHistory0.0.1 (18-05-2020)First code creation0.0.1 (24-07-2020)First Release0.0.2 (27-07-2020)Better Exception Handling added0.0.3 (16-10-2020)Bumped dependencies0.1.0 (02-12-2020)bumped requests0.2.0 (06-01-2021)Implemented control tower authentication session.0.3.0 (25-01-2021)Fixed aws sso session generation issue0.4.0 (28-01-2021)Implemented explicit region setting.0.5.0 (01-04-2021)Implemented billing session retrieval.
Package: aws_authenticator
OverviewLogin to AWS using CLI named profiles, IAM access key credentials, or SSO.PrerequisitesPython >= 3.6aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1boto3 (https://pypi.org/project/boto3/) >= 1.17.78Conditional ArgumentsIf authenticating with named profiles:AWSCLI profile nameIf authenticating with IAM acccess key credentials:AWS access key idAWS secret access keyIf authenticating with SSO:AWS account IDAWS SSO Permission Set (role) nameAWS SSO login URLUsageInstallation:pip3installaws-authenticator# orpython3-mpipinstallaws-authenticatorIn Python3 authenticating with named profiles:importaws_authenticatorauth=aws_authenticator.AWSAuthenticator(profile_name="<profile-name>",)session=auth.profile()client=session.client("<service-name>")In Python3 authenticating with IAM access key credentials:importaws_authenticatorauth=aws_authenticator.AWSAuthenticator(access_key_id="<access-key-id>",secret_access_key="<secret-access-key>",)session=auth.iam()client=session.client("<service-name>")In Python3 authenticating with SSO:importaws_authenticatorauth=aws_authenticator.AWSAuthenticator(sso_url="<sso-url>",sso_role_name="<sso-role-name>",sso_account_id="<sso-account-id>",)session=auth.sso()client=session.client("<service-name>")Testing ExamplesTesting SSO-based login in Python3:importaws_authenticatorauth=aws_authenticator.AWSAuthenticator(sso_url="<sso-url>",sso_role_name="<sso-role-name>",sso_account_id="<sso-account-id>",)session=auth.sso()client=session.client("sts")response=client.get_caller_identity()print(response)Testing profile-based login as a script in BASH:python[/path/to/]aws_authenticator\-mprofile\-p<profile-name>
Package: aws-azuread-login
aws_azuread_loginPython 3.6+ library to enable ADFS auth against AWSInstallationpip install aws-azuread-loginUsageimportaws_azuread_loginimportbotocoreimportjson# authenticate against azuread application urlroles=aws_azuread_login.authenticate(os.environ['AWS_AZUREAD_ENTRY_URL']# get creds one by oneforroleinroles:try:print(f'Getting credentials for role{role.role_name}in account{role.account}...')credentials=role.get_credentials()client=credentials.get_client('ec2')response=client.describe_instances()print(json.dumps(response['Reservations'],indent=2,default=str))exceptbotocore.exceptions.ClientErrorase:print(f'\t👎 Error getting credentials, skipping:{type(e)},{str(e)}')# get them all at once ('sts.AssumeRole' role errors are handled by aws_azuread_login)multiple_credentials=aws_azuread_login.get_multiple_credentials(roles)forcredentialsinmultiple_credentials:client=credentials.get_client('ec2')response=client.describe_instances()print(json.dumps(response['Reservations'],indent=2,default=str))# get clients in different regionsforcredentialsinmultiple_credentials:client=credentials.get_client('ec2')response=client.describe_regions()forregioninresponse['Regions']:region_name=region['RegionName']print(f'Creating client for region{region_name}...')client=credentials.get_client('ec2',region_name=region_name)response=client.describe_instances()print(json.dumps(response['Reservations'],indent=2,default=str))# control the session duration, e.g. 12 hours (default is 1 hour)credentials=roles[0].get_credentials(duration_seconds=60*60*12)multiple_credentials=aws_azuread_login.get_mutiple_credentials(roles,duration_seconds=60*60*12)
Package: aws-backup-client
Installation$pipinstallaws-backup-clientExampleCurrently, we use the following:EC2 AMI Image$ec2-ami-backup--instance-id=i-xxxxxxxx--instance-id=i-yyyyyyyy\>--instance-name=name1--instance-name=*name2*\>--instance-tag=key/value--instance-tag=key2/*value2*\>--image-description='weekly backup image'\>--image-max-number=2\>--image-expiration='14days'\>--aws-access-key-id=AKIXXXXXXXXXXXXXXXX\>--aws-secret-access-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\>--aws-region=ap-northeast-1\>--aws-time-diff='9hours'\>--client-time-diff='9hours'\>--client-time-format='%Y-%m-%dT%H-%M-%S'\>--log-level=10\>--reboot\>--prefix='weekly-'\>--dry-run>--keep-snapshotFollowing least any one input is required:–instance-id–instance-name–instance-tagWarningv0.0.4it has limited input as described above.renamed commandec2ami-backuptoec2-ami-backup.v0.0.6–keep-snapshot: It does not remove the snapshot that related to ami.
Package: aws-batch-helpers
AWS Batch HelpersHelpers for running jobs on AWS BatchFree software: MIT licenseDocumentation:https://aws-batch-helpers.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2021-08-05)First release on PyPI.
Package: aws-bucket-creator
AWS Bucket CreatorFeaturesaws-bucket-creator creates a bucket, sets tags, logging, encryption, lifecycle, and policyInstallationaws-bucket-creator is on PyPI so all you need is:.. code:: console$ pip install aws-bucket-creatorDemonstrationExampleGetting help.. code:: console$ bucket-creator create --help
Usage: bucket-creator upsert [OPTIONS]primary function for creating a bucket :return:Options:
  -i, --ini TEXT  INI file with needed information  [required]
  -v, --version   Print version and exit
  --debug         Turn on debugging
  --help          Show this message and exit... code:: consolebucket-creator upsert -i config/my.iniOptions* acl can be: 'private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read','bucket-owner-full-control'
* aes-256 encryption is turned-on by default, and can not be turned off for security reasons
* public_read access can not be turned on for security reasons
* default days before going to standard-ia is 30
* default days before going to glacier is 365Example Ini file.. code:: console[environment]
region = us-east-1
profile = my_aws_profile

[tags]
ResourceOwner = not_me
Project = some project
DeployedBy = me


[parameters]
bucket_name = test-bucket
acl = bucket-owner-full-control
public_write_access = True
logging_enabled = True
days_to_glacier = 365
days_to_standard_ia = 30
event_lambda_arn = arn:aws:lambda:us-east-1:123456789:function:my-lambda
notification_prefix = input/
notification_suffix = .jpg
bucket_policy = {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowRoot",
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "arn:aws:iam::123456789:root"
                ]
            },
            "Action": ["s3:*"],
            "Resource": [
                "arn:aws:s3:::test-bucket/*",
                "arn:aws:s3:::test-bucket"
            ]
        },
        {
            "Sid": "IPAllow",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::test-bucket/*",
                "arn:aws:s3:::test-bucket"
            ],
            "Condition" : {
                "IpAddress" : {
                    "aws:SourceIp": "192.128.1.1/32"
                },
                "NotIpAddress" : {
                    "aws:SourceIp": "192.168.1.1/32"
                }
            }
        }
    ]
  }