Saravanan666/pypi-org huggingface dataset:
Package: cloudview
cloudviewView instance information on EC2, Azure, GCE & OpenStack.Support for other cloud service providers may be easily added thanks toApache LibcloudDocker image available atghcr.io/ricardobranco777/cloudview:latestUsageUsage: cloudview [OPTIONS]
Options:
    -c, --config FILE                   path to clouds.yaml
    -l, --log debug|info|warning|error|critical
                                        logging level
    -o, --output none|text|html|json    output type
    -p, --port PORT                     run a web server on port PORT
    -r, --reverse                       reverse sort
    -s, --sort name|time|state          sort type
    -S, --states error|migrating|normal|paused|pending|rebooting|reconfiguring|running|starting|stopped|stopping|suspended|terminated|unknown|updating
                                        filter by instance state
    -T, --time TIME_FORMAT              time format as used by strftime(3)
    -V, --version                       show version and exit
    -v, --verbose                       be verbose
    --insecure                          insecure modeRequirementsDocker or Podman to run the Docker image or:Python 3.8+ to run installed by pipApache Libcloudclouds.yamlEditexamples/clouds.yamlwith the relevant information and runchmod 600 /path/to/clouds.yaml.NOTES:The key names are not arbitrary and are the names of the arguments passed to the class factory of each provider in libcloud.If this file is not present,cloudviewwill try to get the information from the standardAWS_*,AZURE_*,GOOGLE_*&OS_environment variables.To run stand-alone:pip3 install --user cloudview
cloudview [OPTIONS]To run with Docker or Podman:docker run --rm [OPTIONS] -v /path/to/clouds.yaml:/clouds.yaml:ro ghcr.io/ricardobranco777/cloudview -c /clouds.yamlNOTES:Make sure you also mount the path to the JSON file holding the GCE credentials with the same path mentioned inclouds.yamlFor private Openstack you'd also want to mount the CA's certificates and add-e REQUESTS_CA_BUNDLE=/path/to/certs.pemRun the web server with Docker Compose:If you have a TLS key pair, put the certificates incert.pem, the private key inkey.pemand the file containing the passphrase to the private key inkey.txt.  Then edit thedocker-compose.ymlfile to mount the directory to/etc/nginx/sslin the container like this:- "/path/to/tls:/etc/nginx/ssl:ro".  Set and export theNGINX_HOSTenvironment variable with the FQDN of your host.For HTTP Basic Authentication, create a file namedauth.htpasswdin the same directory with the TLS key pair.If you don't have a TLS key pair, a self-signed certificate and a random password for logging in will be generated.  You can see the latter withdocker compose logs.  The user istest.After runningdocker compose build&docker compose up -dyou can browse tohttps://localhost:8443DebuggingFor debugging you can set theLIBCLOUD_DEBUGenvironment variable to a path like/dev/stderrAdditional informationEC2AzureGCEOpenstackSimilar projectspublic cloud watch
Package: cloudViewer
CloudViewer is an open-source library that supports rapid development of software
that deals with 3D data. The CloudViewer frontend exposes a set of carefully selected
data structures and algorithms in both C++ and Python. The backend is highly
optimized and is set up for parallelization. We welcome contributions from the
open-source community.If you use CloudViewer in an academic project, please cite our paper:@article{Zhou2018,
    author    = {Asher},
    title     = {{CloudViewer}: {A} Modern Library for {3D} Data Processing},
    journal   = {arXiv:?},
    year      = {2020},
}Core features3D data structures3D data processing algorithmsScene reconstructionSurface alignment3D visualizationPhysically based rendering (PBR)3D machine learning support with PyTorch and TensorFlowGPU acceleration for core 3D operationsAvailable in C++ and PythonSupported platformsThe package has been tested on:Ubuntu 18.04 and 20.04Windows 10 64-bitmacOS High Sierra and aboveWith Python versions:
* 3.5
* 3.6
* 3.7
* 3.8ResourcesWebsite:www.erow.cnCode:www.erow.cnDocument:www.erow.cn/docsLicense:The MIT license
Package: cloudVis
Wordcloud ScriptsDescriptionThis is a collection of scripts that manipulate report data files (downloaded from Susmon front-end) and other report data files created by researchers to create counts of the top words create word clouds.Key scripts:main.py - Main program loop that determines actions to be taken and calls relevant methods
esg.py - ESG word clouds. Works from the standard report data file downloaded from the database and from a bespoke report created by research
netzero.py - Net Zero word clouds and word counts. Works from a filtered report file provide by research
Other modules contain common fuctions used by both scriptsInstallationScripts are written in Python 3. Libraries and version identified in requirements.txtThere are two control files that must be in place for the scripts to run:stopwords.csv - generic words and phrases to be excluded from word clouds
phrases.csv - word combinations that should be treated as phrases in word cloudsThese files can be uploaded and updated via the main code loop as decribed below.UsageThe code is run as follows:python -m src.clouds.main <input file> <action "create"/"update"> [--resource <"phrases"/"stopwords">] [--sector <sector name>] [--classification <"Environmental", "Social", "Governance">]When used with the action argument "create", the program will use the "input file" to generate word clouds as follows:if <input file> name contains "NZ", or "Net Zero" a set of Net Zero word clouds will be created
otherwise
if a <sector name> is supplied, word clouds will be generated for each brand owners in that sector and each classification. In addition word clouds will be created for all brand owners comnined for each classification and for all brand owners across all classifications. The input file in this case should be a standard report data file downloaded from the database
if no <sector name> is supplied and a <classification> other than "All" has been supplied, a word cloud will be created for the <classification> supplied for all brands in the input file combined. The input file in this case should be one provided for this purpose by the research team.
if no <sector name> is supplied and a <classification> of "All" has been supplied, a word cloud will be created for the all classifications and all brands in the input file combined. The input file in this case should be one provided for this purpose by the research team.When used with the action argument "update", the program will use the "input file" to update one of the two control files as determined by the resource argument "phrases", or "stopwords".Support[to be written]
Package: cloudvision
Arista CloudVision Python LibraryThe Arista CloudVision Python library provides access to Arista's CloudVision
APIs for use in Python applications.DocumentationAPI Documentation for this library can be foundhere.Documentation for CloudVision's Resource APIs can be foundhere.Documentation for generic access to CloudVision can be found atCloudVision Connector.InstallationInstall via pip:pipinstall--upgradecloudvisionOr from source:pythonsetup.pyinstallRequirementsCloudVision Resource APIs: Python 2.7+ or Python 3.7+CloudVision Connector: Python 3.7+Examples: Python 3.7+Resource APIsCloudvision APIs are state based, resource-oriented APIs modeled inProtobufand accessed overgRPCusing a standardized set of RPC verbs.CloudVision is a powerful platform that processes and stores tremendous amounts of network data. It knows the topology of the network, device configuration, interface activity and other network events. These APIs allow access to fleet-wide data access and control, forming a management-plane with consistent usage.For example, consider the following script that gets all existing and then watches for new CloudVision events of critical severity and notifies an administrator when raised and notes it on the event:importtimeimportgoogle.protobuf.wrappers_pb2importgrpcfromarista.event.v1importmodels,services# setup credentials as channelCredentialswithgrpc.secure_channel("www.arista.io:443",channelCredentials)aschannel:event_stub=services.EventServiceStub(channel)event_annotation_stub=services.EventAnnotationConfigServiceStub(channel)event_watch_request=services.EventStreamRequest(partial_eq_filter=[models.Event(severity=models.EVENT_SEVERITY_CRITICAL)],)forrespinevent_stub.Subscribe(event_watch_request):print(f"Critical event{resp.title.value}raised at{resp.key.timestamp}")# send alert here via email, webhook, or incident reporting tool# then make a note on the event indicating an alert has been sentnow_ms=int(time.time()*1000)notes_to_set={now_ms:models.EventNoteConfig(note=google.protobuf.wrappers_pb2.StringValue(value="Administrator alerted",),),}annotation_config=models.EventAnnotationConfig(key=resp.key,notes=models.EventNotesConfig(notes=notes_to_set,),)event_note_update=services.EventAnnotationConfigSetRequest(value=annotation_config)event_annotation_stub.Set(event_note_update)CloudVision ConnectorCloudVision Connector is a Python implementation of a GRPC client for CloudVision. It takes care
of getting and publishing data and datasets, and also provides utilities for data
representation.Getting startedThis is a small example advertising a few of the GRPC client capabilities.
This example prints info from all devices streaming into CloudVision.targetDataset="analytics"path=["DatasetInfo","Devices"]# No filtering done on keys, accept allkeys=[]ProtoBufQuery=CreateQuery([(path,keys)],targetDataset)withGRPCClient("my-cv-host:9900")asclient:fornotifBatchinclient.Get([query]):fornotifinnotifBatch["notifications"]:# Get timestamp for all update here with notif.TimestampPrettyPrint(notif["updates"])
Package: cloudwanderer
Documentation:CloudWanderer.ioGitHub:https://github.com/CloudWanderer-io/CloudWandererA Python package which allows you to enumerate and store your AWS Resources in AWS Neptune (or Gremlin for local execution) in order to be able to ask questions like:What EC2 instances do I have that are in Public Subnets that have roles and are accessible from the internet?How old are my IAM users access keys?What lambda functions do I have that are connected to VPCs that have access to the internet via a NAT gateway?How many untagged VPCs do I have across all regions?What does it do?What the aboveYouTube videoto see an example of what you can do with CloudWanderer.Installationpip install cloudwandererLocal QuickstartSpin up a localGremlin Graph Database serverand a Jupyter Notebook.$ git clone https://github.com/CloudWanderer-io/docker-graph-notebook.git
$ cd docker-graph-notebook
$ docker-compose upLook in the output for something that looks like:jupyter-notebook_1  |     Or copy and paste one of these URLs:
jupyter-notebook_1  |         http://localhost:8888/?token=88dc054886e3ea73480de91066937a33c9bc8bd484eb395cOpen the URL in question in a tab in your browser.Open up Pythonin your preferred IDEand import and initialiseCloudWanderer>>> import logging
>>> from cloudwanderer import CloudWanderer
>>> from cloudwanderer.storage_connectors import GremlinStorageConnector
>>> storage_connector = GremlinStorageConnector(
...     endpoint_url="ws://localhost:8182"
... )
>>> wanderer = CloudWanderer(storage_connectors=[storage_connector])
>>> logging.basicConfig(level='INFO')Get all the resources from your AWS account and save them to your local Gremlin graph database.>>> wanderer.write_resources()Go to the Jupyter Notebook link you opened earlier and,create a new notebook by hitting ‘new’on the top right, and type the following into a new cell to get a list of VPCs.%%gremlin
g.V().hasLabel('aws_ec2_vpc').out().path().by(valueMap(true))Voila!You can learn more Gremlin (the language that’s supported by the local setup here) by readingKevin Lawrence’s amazing book on GremlinOR you can get stuck in to the much more straightforward OpenCypher language by following theNeptune Quickstart guide.
Package: cloudwatch-alarms-to-teams
CloudWatch Alarm to Chat Platforms CDK ConstructThis construct creates an SNS topic and Lambda used to translate CloudWatch alarms into notifications set to various chat platforms. Currently only Microsoft Teams is supported.Example:# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826importaws_cdk.coreascdkimportaws_cdk.aws_s3ass3fromaws_cdk.aws_lambdaimportRuntimeimportaws_cdk.aws_lambda_pythonas_lambdaimportaws_cdk.aws_cloudwatchascloudwatchimportaws_cdk.aws_cloudwatch_actionsascw_actionsimportcloudwatch_alarms_to_teamsasnotificationsimportpathaspathimportaws_cdk.aws_eventsaseventsimportaws_cdk.aws_events_targetsastargetsfromaws_cdk.assertimportcount_resourcesclassTestCdkConstructStack(cdk.Stack):def__init__(self,scope,id,*,description=None,env=None,stackName=None,tags=None,synthesizer=None,terminationProtection=None,analyticsReporting=None):super().__init__(scope,id,description=description,env=env,stackName=stackName,tags=tags,synthesizer=synthesizer,terminationProtection=terminationProtection,analyticsReporting=analyticsReporting)failure_lambda=_lambda.PythonFunction(self,"FailureLambda",entry=path.join(__dirname,"..","functions","failureLambda"),runtime=Runtime.PYTHON_3_8)rule=events.Rule(self,"Schedule",schedule=events.Schedule.rate(cdk.Duration.minutes(1)))rule.add_target(targets.LambdaFunction(failure_lambda))errors=failure_lambda.metric_errors()errors.with(period=cdk.Duration.minutes(1))alarm=errors.create_alarm(self,"Alarm",alarm_name="Example Lambda Alarm",alarm_description="This alarm will trigger when the lambda fails 2 out of 3 times in a given period",threshold=2,evaluation_periods=3,period=cdk.Duration.minutes(1))notify=notifications.CloudwatchAlarmsToTeamsConstruct(self,"Notification",webhook_url="https://test.webhook.office.com/webhookb2/example-webhook-goes-here")notify.add_alarm_to_teams_notification(alarm)Example Notification in TeamsAPIFor specific API usage see theAPI Docs
Package: cloudwatch-alarm-to-slack
Cloudwatch Alarm to Slack NotifierA python library to send cloudwatch alarm notifications to Slack.UsageInstall the package.pip install cloudwatch_alarm_to_slackIt is expected this will be used as a part of a lambda.from cloudwatch_alarm_to_slack.entrypoint import CloudwatchAlarmNotifier

def lambda_handler(event, context):
    CloudwatchAlarmNotifier.handle_event(event)It is required the following environment variable be set:SLACK_BOT_TOKEN: Bot token of the slack app which should have thechat:writepermissions.SLACK_CHANNEL: ID of the Slack channel to which notification should be sent to.If there is another usecase, please open an issue and let me know :)
Package: cloudwatch-auto-retention
Cloudwatch Auto RetentionCloudwatch Auto Retention is an AWS CDK construct library that will check once a month if you have any Cloudwatch Log Groups in the region it is deployed with a never-expire retention and auto-fix this to one month. This is a cost-optimization as Cloudwatch Logs have a very high storage cost. If you need Cloudwatch logs for longer you should set an automated S3 export (cloudwatch-logs-s3-export is in the works 😚).Getting startedTypeScriptInstallationNPMnpm install --save cloudwatch-auto-retentionyarnyarn add cloudwatch-auto-retentionUsage# Example automatically generated from non-compiling source. May contain errors.import*ascdkfrom'@aws-cdk/core';import{CloudwatchAutoRetention}from'cloudwatch-auto-retention';import{RetentionDays}from'aws-cdk-lib/aws-logs';import{Schedule}from'aws-cdk-lib/aws-events';constmockApp=newcdk.App();conststack=newcdk.Stack(mockApp,'<your-stack-name>');newCloudwatchAutoRetention(stack,'cloudwatch-auto-retention');//WithretentionsetnewCloudwatchAutoRetention(stack,'cloudwatch-auto-retention',{retention:RetentionDays.ONE_MONTH});//WithschedulefortheLambdafunctionsetnewCloudwatchAutoRetention(stack,'cloudwatch-auto-retention',{schedule:Schedule.cron({minute:'0',hour:'1',day:'1'})});PythonInstallation$pipinstallcloudwatch-auto-retentionUsageimportaws_cdk.coreascdkfromcdk_cloudwatch_auto_retentionimportCloudwatchAutoRetentionapp=cdk.App()stack=cdk.Stack(app,"<your-stack-name>")CdkCloudwatchAutoRetention(stack,"cloudwatch-auto-retention")OverviewA Cloudwatch cron rule will trigger a Lambda that will go over all Cloudwatch Log Groups and check if the retention is never-expire. If so, it will change it to one month default or whatever you set asretention.
Package: cloudwatch-metrics-buffer
cloudwatch-metrics-bufferThis is a wrapper library for publishing metrics toAWS CloudWatch.While playing around with lambdas and serveless frameworks, I needed a library to help me with publishing metrics to CloudWatch in easy and elegant way. I wanted to avoid boilerplate code that polutes all my methods. Ideally, I would decorate my function to measure execution time or count. After unsuccessful search, I implemented my own.This wrapper will buffer metrics first, then send them in batches. It supportstimeitandcountdecorators for metricating functions in elegant way. Though publishing metrics is batched, there is no guaranty ClouWatch will swallow everything. If you send >150 TPS(can happen easily if you scale out with Lambdas), you might get throttled. Read CloudWatch documentation for limits and pricing consideration.Installationpip install cloudwatch-metrics-bufferUsagePost metrics explicitlyfromcwmetricsimportCloudWatchMetricsBuffercw=CloudWatchMetricsBuffer('Some Namespace')# buffer single metrics value to buffercw.put_value('total_calls',5)# metric without units of value 5cw.put_value('latency',11.25,unit='Milliseconds')# metric with unit specifiedcw.put_value('latency',11.25,dimensions={'HTTP Method':'GET'},unit='Milliseconds')# same latency with specified dimensioncw.put_value('home-page',1,timestamp=datetime.datetime(2019,10,10,14,0,0))# metric on exact time# buffer statistic value; use this if you are gathering your statistics along the way in your appcw.put_statistic('metric',sample_count=50,sum=10000,minimum=0,maximum=500)# send all to Cloudwatchcw.send()Post metrics using decoratorsfromcwmetricsimportCloudWatchMetricsBuffercw=CloudWatchMetricsBuffer('Some Namespace')# send value of for metric for each execution@cw.count('count_metric1')deffunc():...func()You can also decorate function multiple times. Publishing to CloudWatch is executed after outer decorator finishes:# measure execution time in milliseconds and count request@cw.timeit('api')@cw.timeit('api',dimensions={'HTTP Method':'GET'})@cw.count('requests',dimensions={'HTTP Method':'GET'})defprocess_api_request():...# CW will receive 3 metric valuesprocess_api_request()This will also work:@cw.timeit('api')@cw.timeit('api',dimensions={'HTTP Method':'GET'})@cw.count('requests',dimensions={'HTTP Method':'GET'})@cw.count('requests')defprocess_api_request():...authenticate()...@cw.timeit('auth')@cw.count('auth requests')defauthenticate():...# all metrics (total of 6) are buffered and sent after method was executedprocess_api_request()
Package: cloudwatch-metrics-client
cloudwatch-metrics-clientPython CloudWatch metrics Client library utilising asyncio (along with sync variant)This is yet another Python CloudWatch client. While there are alternatives, they are
either not supporting asyncio or not actively maintained.https://github.com/awslabs/cloudwatch-fluent-metricshttps://github.com/peterdemin/awsmeThe client collects whatever metrics you feed it with and reports to CloudWatch regularly, though
you can use it for ad-hoc reporting as wellNOTE: aioboto3 is not in the requirements, in case you only need sync version. If running under Python 3.6, you'll
need async_generator>=1.10 as wellUsage:importasynciofromcloudwatch_metrics_client.aiocloudwatchimportCloudWatchAsyncMetrics,CloudWatchAsyncMetricReporterasyncdefsetup():reporter=CloudWatchAsyncMetricReporter(report_interval=REPORTINTERVAL)# secondsCloudWatchAsyncMetrics.with_namespace('<YOUR NAMESPACE').with_reporter(reporter)# .with_client(aioboto3_cloudwatch_client) is you're not happy with default clientawaitreporter.run()@CloudWatchAsyncMetrics.monitored_taskasyncdefprocess_request(request):# processing logic...## request_type = ...# request_specific_data =# Set details on monitored callCloudWatchAsyncMetrics\.with_monitored_dimension('TypeOfRequest',request_type)\.with_monitored_dimension('SpecificAttribute',request_specific_data)# Put particular metricawaitCloudWatchAsyncMetrics.put_metric(MetricName='particular-metric-name',Unit='Count',Dimensions={'Kind':'metric-kind','Sort':'metric-sort'},Value=value)# Record statistical valueawaitCloudWatchAsyncMetrics.put_statistic(MetricName='particular-metric-name',Unit='Count',Dimensions={'Kind':'metric-kind','Sort':'metric-sort'},Value=value# Elapsed time will be recordedElapsed time of each call ofprocess_requestcoroutine will be recorded in internal data structure and aggregated
statistics will be regularly sent to CloudWatch.
Individual metrics could be collected withput_metriccall - they too would be stored for a while and then sent
to CloudWatch.put_metrickeeps each unique value and sends list of them along with number of occurrencies of each
value,put_statisticsonly sends aggregated data over a bunch of metrics - Sum, SampleCount, Min and Max
(Seehttps://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch.html#CloudWatch.Client.put_metric_datafor details)Reporter has asyncflushmethod for flushing metric data still not sent to CloudWatch. If regular reporting is not
needed, just don't callruncoro and instead callflushwhen it is time to report metrics.Sync version works in the very same way, it utilises separate thread for reporting.fromcloudwatch_metrics_client.cloudwatchimportCloudWatchSyncMetrics,CloudWatchSyncMetricReporterdefsetup():reporter=CloudWatchSyncMetricReporter(report_interval=REPORTINTERVAL)# secondsCloudWatchSyncMetrics.with_namespace('<YOUR NAMESPACE').with_reporter(reporter)reporter.run()@CloudWatchSyncMetrics.monitored_taskdefprocess_request(request):# Same here, but with CloudWatchSync*