Saravanan666/pypi-org huggingface dataset:
Package: promemoria
[promemoria]Intuitive Python based tool to create reminders in the shell.promemoriais a Python based tool to help you stay organized and on top of your tasks! Quicklycreate reminders in the shellwith the ability toset a title, description, priority and dateto make sure you never forget anything.Main featuresCreate and manage reminders directly from the shell.Import the latestIssuesandPull Requestsas reminders from a public GitHub repository.Automatically checks for expired reminders when opening a new shell.Installationpromemoriacan be installed fromPyPIby:python3 -m pip install --upgrade promemoriaUsagepromemoriafeatures a small and simple-to-use set of commands.These commands can be easily retrieved at any moment by issuingpromemoria help[^1][^2][^3][^1]: Shouldn'tpromemoriawork, trypython3 -m promemoria.[^2]: A color coded output will serve you better than this example.[^3]: Referring to version 1.1.0[promemoria]

Available commands.
-------------------

promemoria Shows the list of active reminders.
    --all Shows every reminder.

promemoria new Creates a new reminder
    -t title, string.
    -de description, string. 
    -da date, string, ISO 8601 compliant.
    -ti time, string.
    -p priority, integer, [1-3].

promemoria delete Deletes the specified reminder
    -i index, integer.

promemoria toggle Toggles the specified reminder
    -i index, integer.

promemoria clear Deletes every reminder

GitHub integration.
-------------------

promemoria gh Imports issues and pull requests from GitHub
    -r public repo, string [user/repo].
    -u user, string.
    --pulls Imports pull requests instead of issues.Expired reminders checkThe automatic check can be enabled by issuing the following command[^4]:[^4]: Linux and macOS only, bash and zsh only.promemoria-check enableExamplesQuickly check your reminderspromemoriawhich results in:[promemoria]

You have 1 reminder(s).
-----------------------

◯ [1] Go get some groceries. !
      2023-07-12 08:30Creating a reminderpromemoria new -t "Christmas" -de "It's Christmas\!" -da "2023-12-25" -p 3which results in:[promemoria]

Reminder created succesfully!
-----------------------------

◯ Christmas !!!
  It's Christmas!
  2023-12-25Import from a GitHub repositorypromemoria gh -r "python/cpython" -u "sobolevn"which results[^5] in:[^5]: An example from the officialPythonrepository.[promemoria]

Imported 1 issue(s).
____________________

◯ New warning: "'_Py_IsInterpreterFinalizing' undefined; assuming extern returning in" !!
  https://api.github.com/repos/python/cpython/issues/106406Toggling a reminderpromemoria toggle -i 1which results[^2][^6] in:[^6]: The mark changes and the title gets dimmed.[promemoria]

You toggled a reminder.
-----------------------

● Christmas !!!
  It's Christmas!
  2023-12-25
Package: promesque
promesqueis a configurable Prometheus exporter for results of Elasticsearch queries.Installationpip3 install promesqueUsagepromesque path/to/some/config.yml --log-level infoRefer toexporter_es.ymlas an example for such a config.
The supported fields are explained below.Configuration FileConfiguration file is in a yaml format with single configuration scope (metrics).Each item inmetricsscope define a metric and must have following attributes:description: description of a metric (what it does)data_path: jsonpath to data buckets in Elasticsearch response to build metrics from (default:$)value_path: jsonpath to metric value within data bucketlabels: inner scope withname: referencefor each metric:name: name of label exposed by exporterreference: jsonpath to label value within data bucketurl: url to Elasticsearch cluster (include index)query: query in json format; musteitherbe inclosed in single quotes (e.g.'{ "query":{...}}')orwritten inYAML block notationwith proper indentation, e.g.,es_query: |
  {
    "query": {
      ...
    }
  }
Package: prometheus-async
prometheus-asyncprometheus-asyncadds support for asynchronous frameworks to the officialPython clientfor thePrometheusmetrics and monitoring system.CurrentlyasyncioandTwistedon Python 3.7 and later are supported.It works by wrapping the metrics from the official client:importasynciofromaiohttpimportwebfromprometheus_clientimportHistogramfromprometheus_async.aioimporttimeREQ_TIME=Histogram("req_time_seconds","time spent in requests")@time(REQ_TIME)asyncdefreq(request):awaitasyncio.sleep(1)returnweb.Response(body=b"hello")Even forsynchronousapplications, the metrics exposure methods can be useful since they are more powerful than the one shipped with the official client.
For that, helper functions have been added that run them in separate threads (asyncio-only).The source code is hosted onGitHuband the documentation onRead The Docs.
Package: prometheus-aws-configservice-exporter
Prometheus exporter for AWS ConfigCreditsHeavily based uponSpreaker's Guard Duty exporterFeaturesExports the number of compliant and non-compliant resources from AWS Config, labelled by region and resource typeSupports multiple AWS regionsExported metricsThe exporter exports the following metrics:Metric nameTypeLabelsDescriptionaws_config_exporter_upgaugeNoneAlways1: can be used to check if the exporter is runningaws_config_current_resourcesguageregion,resource_typeThe total number of resources recorded by AWS Configaws_config_compliant_resourcesguageregion,resource_typeThe number of compliant resources recorded by AWS Configaws_config_noncompliant_resourcesguageregion,resource_typeThe number of non-compliant resources recorded by AWS Configaws_config_scrape_errors_totalcounterregionThe total number of scrape errorsHow to run itYou have two options to run it:Manually install and run theprometheus-aws-configservice-exporterPython packagepip3 install prometheus-aws-configservice-exporter

prometheus-aws-configservice-exporter --region us-east-1Use theDocker image available on Docker hubdocker run --env AWS_ACCESS_KEY_ID="id" --env AWS_SECRET_ACCESS_KEY="secret" airwalkconsulting/prometheus-aws-configservice-exporter --region us-east-1The cli supports the following arguments:ArgumentRequiredDescription--region REGION [REGION ...]yesAWS Config region (can specify multiple space separated regions)--throttle SECONDSThe number of seconds to wait between AWS Config API requests. Float, eg0.5. Defaults to1.0--exporter-hostThe host at which the Prometheus exporter should listen to. Defaults to127.0.0.1--exporter-portThe port at which the Prometheus exporter should listen to. Defaults to9100--log-level LOG_LEVELMinimum log level. Accepted values are:DEBUG,INFO,WARNING,ERROR,CRITICAL. Defaults toINFORequired IAM privilegesIn order to successfully run, this application requires the following IAM privileges:{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid":    "ConfigServiceGetOnly",
      "Effect": "Allow",
      "Action": [
        "config:Get*",
      ],
      "Resource": "*"
    }
  ]
}DevelopmentRun the development environment:docker-compose build dev && docker-compose run --rm devRun tests in the dev environment (Warning: See TODO.md):python3 -m unittestLicenseThis software is released under theMIT license.
Package: prometheus-aws-guardduty-exporter
Prometheus exporter for AWS GuardDutyFeaturesExports the number of current (unarchived) findings from AWS GuardDuty, splitted by region and severitySupports multiple AWS regionsExported metricsThe exporter exports the following metrics:Metric nameTypeLabelsDescriptionaws_guardduty_exporter_upgaugeNoneAlways1: can be used to check if it's runningaws_guardduty_current_findingsgaugeregion,severityThe current number of unarchived findingsaws_guardduty_scrape_errors_totalcounterregion,severityThe total number of scrape errorsHow to run itYou have two options to run it:Manually install and run theprometheus-aws-guardduty-exporterPython packagepip3 install prometheus-aws-guardduty-exporter

prometheus-aws-guardduty-exporter --region us-east-1Use theDocker image available on Docker hubdocker run --env AWS_ACCESS_KEY_ID="id" --env AWS_SECRET_ACCESS_KEY="secret" spreaker/prometheus-aws-guardduty-exporter --region us-east-1The cli supports the following arguments:ArgumentRequiredDescription--region REGION [REGION ...]yesAWS GuardDuty region (can specify multiple space separated regions)--exporter-hostThe host at which the Prometheus exporter should listen to. Defaults to127.0.0.1--exporter-portThe port at which the Prometheus exporter should listen to. Defaults to9100--log-level LOG_LEVELMinimum log level. Accepted values are:DEBUG,INFO,WARNING,ERROR,CRITICAL. Defaults toINFORequired IAM privilegesIn order to successfully run, this application requires the following IAM privileges:{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid":    "ListDetectorsAndGetFindingsStatisticsInAnyRegion",
      "Effect": "Allow",
      "Action": [
        "guardduty:ListDetectors",
        "guardduty:GetFindingsStatistics"
      ],
      "Resource": "*"
    }
  ]
}DevelopmentRun the development environment:docker-compose build dev && docker-compose run --rm devRun tests in the dev environment:python3 -m unittestLicenseThis software is released under theMIT license.
Package: prometheus-build-info
Prometheus BuildInfoPython library for adding a buildinfo metric to your Prometheus-enabled applications.UsageInstallationpip install prometheus-build-infomake-build-info utilityThe make-build-info utility can be used during building or packaging to create a prom_build_info.json file that stores the
relevant build information that this library publishes.make-build-info --help
Usage: make-build-info [OPTIONS] APPNAME BRANCH REVISION VERSION

Options:
  --help  Show this message and exit.Alternatively, running the utility when environment variables exist with the same name as the arguments listed above will
have the same effect.Manual creation of prom_build_info.jsonIf this suits your build process better, you can manually create prom_build_info.json during the build. It has the following
format:{
"appname": "test_app",
"branch": "master",
"revision": "abcdef",
"version": "1.0.1"
}Adding the metric to your appEnsure that prom_build_info.json is in your application working directory. Importprometheus_build_info.metricsinto a code file that will be run during or after application initialisation.
Package: prometheus-client-utils
Utils for prometheus-clientPoetry plugin to set package version based on git tag.FunctionalityPush clientspushgatewaystatsdInstallationpipinstallprometheus-client-utilsCollectorsAsyncioCollectorfromprometheus_clientimportREGISTRYfromprometheus_client_utils.collectorsimportAsyncioCollectorcollector=AsyncioCollector()REGISTRY.register(self.collector)Push clientsPushGatewayClientimportasynciofromrandomimportrandintfromprometheus_clientimportREGISTRY,Counter,Histogramfromprometheus_client_utils.collectorsimportAsyncioCollectorfromprometheus_client_utils.push_clientsimportPushGatewayClientm_count=Counter('iters','count')m_histogram=Histogram('iters_time','histogram')semaphore=asyncio.Semaphore(50)@m_histogram.time()asyncdefinner():asyncwithsemaphore:m_count.inc()awaitasyncio.sleep(randint(0,10))asyncdefmain():loop=asyncio.get_running_loop()REGISTRY.register(AsyncioCollector(loop))push_client=PushGatewayClient('localhost','test')push_client.schedule_push(5,loop)foriinrange(10000):awaitasyncio.sleep(i/100)loop.create_task(inner())if__name__=='__main__':asyncio.run(main())ContributeIssue Tracker:https://gitlab.com/rocshers/python/poetry-git-version-plugin/-/issuesSource Code:https://gitlab.com/rocshers/python/poetry-git-version-pluginBefore adding changes:makeinstall-devAfter changes:makeformattest
Package: prometheus-coin-scrapper
prometheus coin scraper : A simple metric provider for prometheusThis provide a set of metric for all cryptocurencies listed onhttps://coin360.com/andhttp://coinmarketcap.com/A lot of values are generated from this scrapper ~10000 values today (27/12/2018)How to useInstall the pip packagepip install prometheus_coin_scraperto start the metric server that will serve all metrics you can use the following commandpython -m prometheus_coin_scraper [webport]In-code usageThis module is also usable inside you code and will produce very simple webserver that is by default reachable onhttp://localhost:8000/and displays all metrics in a prometheus compatible formatfromprometheus_coin_scraper.PrometheusClientimportPrometheusClientPrometheusClient(port=8000)This class start and run the web server. As it is a blocking call you might need to start it in a Threadfromprometheus_coin_scraper.PrometheusClientimportPrometheusClientfromthreadingimportThreaddeffunc():PrometheusClient(port=8000)Thread(target=func).start()Information on collected Metricscoin_scrapper_fetch_time: The time spent fetching all currencies valuescoin_scrapper_gauge_update_time: The time spent updating all prometheus Gauges valuescoin_scrapper_last_update: Last update timecoin_scrapper_currencies_number: The current number currencies in the Indexcoin_scrapper_coin_value_usd: Coin value in USDThere are three labelssymbol: The currency symbol (BTC, LTC, XRP, ...)name: The currency name (Bitcoin, Litecoin, Ripple, ...)source: The name of the source for the currency value (coin360.com, ...)coin_scrapper_coin_value_btc:  Coin value in BTCThere are three labelssymbol: The currency symbol (BTC, LTC, XRP, ...)name: The currency name (Bitcoin, Litecoin, Ripple, ...)source: The name of the source for the currency value (coin360.com, ...)coin_scrapper_coin_last_platform_updateLast update of the coin on the sourceThere are three labelssymbol: The currency symbol (BTC, LTC, XRP, ...)name: The currency name (Bitcoin, Litecoin, Ripple, ...)source: The name of the source for the currency value (coin360.com, ...)coin_scrapper_coin_changes: Calculated changes of the coin over time (1h, 24h, 7d)There are three labelssymbol: The currency symbol (BTC, LTC, XRP, ...)name: The currency name (Bitcoin, Litecoin, Ripple, ...)source: The name of the source for the currency value (coin360.com, ...)interval: The interval for the calculated value (1h, 24h or 7d)
Package: prometheus-couchbase-exporter
This Prometheus exporter runs configured queries against Couchbase and exports the results as Prometheus gauge metrics.Installation instructions:Install viapip:$ pip install prometheus-couchbase-exporterSee ``pip`` installation instructions at http://www.pip-installer.org/en/latest/installing.htmlUsage example:By default, it will bind to port 9119, query Couchbase on 127.0.0.1:8091 and run queries configured in an external moduleStatsMetrics.
You can change these defaults as required by passing in options:$ prometheus-couchbase-exporter -c <couchbase host:port> -p <port to listen>
Package: prometheus-dirsize-exporter
prometheus-dirsize-exporterExport directory size metrics efficiently.Why?When providing multi-user interactive computing services (with a HPC cluster
or with JupyterHub), it's very helpful to know the home directory sizes of
each user over time. However, as NFS is often used, runningduconstantly
takes a long time, uses too many IOPS that we may not have many of, and is
plain inefficient.This project provides a way to keep track of directory sizes with abudgetedamount of IOPS. You can ask it to take however much time it needs but not
use more than 100 IOPS, and it will do that. We do not necessarily need very
up to date directory size metrics, so this is ok.InstallationInstall the package from PyPI:pipinstallprometheus-dirsize-exporterRunningYou can start the process from the commandline:dirsize-exporter<path-to-parent-directory><iops-budget><wait-time-in-minutes>For example, to export metrics about directories under/home, using no more
than 200 IO operations per second, updating every 60minutes, you would run:dirsize-exporter/home20060You can check out the metrics by hittinghttp://localhost:8000. The port can
be controlled via a--portargument.Metrics recordedThe following metrics are recorded for all top level subidrectories of the
parent directory:Total Size (in bytes)Last Modified (including all the descendents)Total Number of Entries (Files, directories & symlinks)Processing Time required to gather this information
This is only reported if--enable-detailed-processing-time-metricflag is
passed, to prevent possible explosion of stored size of prometheus metrics
when collected. This information is also not particularly useful outside
of debugging this exporter, and as it varies each run, compresses poorly.Last updatedLimitationsAs directory contents might change in the course of a single run as we wait
for budgets to become available, information about a directory may not be
exactly correct immediately.Because we do not spread the IOPS through time, the IO usage is 'spiky' -
all IOPS get done at the beginning of a second, and then it goes silent.
If you have a big IOPS budget, this can cause performance degradation.
Package: prometheus-distributed-client
Prometheus Distributed ClientPurpose and principleprometheus-distributed-clientis aimed at shorted lived process that can exposePrometheusmetrics through HTTP.Advantages over PushgatewayThe prometheus project provides several ways of publishing metrics. Either you publish them directly like theofficial clientallows you to do, or you push them to apushgateway.The first method implies you've got to keep your metrics in-memory and publishs them over http.
The second method implies that you'll either have a pushgateway per process or split your metrics over all your processes to avoid overwriting your existing pushed metrics.prometheus-distributed-clientallows you to have your short lived process push metrics to a database and have another process serving them over HTTP. One of the perks of that approach is that you keep consistency over concurrent calls. (Making multiple counter increment from multiple process will be acknowledge correctly by the database).Code examplesprometheus-distributed-clientuses the base of theofficial clientbut replaces all write and read operation by database call.Declaring and using metricsfromprometheus-distributed-clientimportset_redis_conn,Counter,Gauge# we use the official clients internal architecturefromprometheus_clientimportCollectorRegistry# set your own registryREGISTRY=CollectorRegistry()# declare metrics from prometheus-distributed-clientCOUNTER=Counter('counter_metric_name','metric documentation',[labels],registry=REGISTRY)GAUGE=Gauge('gauge_metric_name','metric documentation',[labels],registry=REGISTRY)# increment a counter and set a value for a gaugeCOUNTER.labels('label_value').inc()GAUGE.labels('other_label_value').set(12)Serving the metricsprometheus-distributed-clientuse the registry system from the official client and is de facto compatible with it. If you want to register regular metrics alongside the one fromprometheus-distributed-clientit is totally feasible.
Here is a little example of how to serv metrics fromprometheus-distributed-client, but you can also refer to thedocumentation of the official client.# with flaskfromflaskimportFlaskfromprometheus_clientimportgenerate_latest# get the registry you declared your metrics infrommetricsimportREGISTRYapp=Flask()@app.route('/metrics')defmetrics():returngenerate_latest(REGISTRY)
Package: prometheus-exporter
Prometheus ExporterA simple prometheus exporter library using:aiohttpzenlibFeaturesasync via aiohttpdetailed loggingtoml configoptional cachingComponentsLabelsTheLabelsdict represents a collection of labels and ensures added labels are strings.The__str__method is overridden so that when printed, the object returns a formatted label string for exporting.copy()ensures the copy is also a Labels type, and has a logger from the same parent.MetricTheMetricclass represents a prometheus metric.It must be defined with a name, and defaults to the value0.Optionally the following parameters can be passed:metric_type(untyped) Prometheus metric typehelp(None) The metric help stringlabels(Labels()) Label dictionary for the metric.check_filter(label_filter)can be used to pass a label filter to the metric, returningTrueif the labels match.__str__is overridden to print out a proper metric string based on the contents of the object.ExporterTheExporteris responsible for collecting and exporting metrics.The following arguments can be used:config_file(config.toml) The config file for the exporter.labels(Labels()) Label dictionary for the exporter, passed to created metrics.listen_ip(127.0.0.1) The IP address to run the exporter on.listen_port(9999) The port to listen on.Once created the exporter can be started with:start()Requests to/metricsare handled byhandle_metrics(request).
Package: prometheus-flask-instrumentator
Prometheus Flask InstrumentatorSmall package to instrument your Flask app transparently.pip install prometheus-flask-instrumentatorFast Trackfromprometheus_flask_instrumentatorimportInstrumentatorInstrumentator().instrument(app).expose(app)With this the Flask app is instrumented and all Prometheus metrics can be
scraped via the/metricsendpoint.The exporter includes the single metrichttp_request_duration_seconds.
Basically everything around it can be configured and deactivated. These
options include:Status codes are grouped into2xx,3xxand so on.Requests without a matching template are grouped into the handlernone.Renaming of labels and the metric.Regex patterns to ignore certain routes.Decimal rounding of latencies.See theExample with all parametersfor all possible options or check
out the documentation itself.Example with all parametersfromprometheus_flask_instrumentatorimportPrometheusFlaskInstrumentatorPrometheusFlaskInstrumentator(should_group_status_codes=False,should_ignore_untemplated=False,should_group_untemplated=False,should_round_latency_decimals=True,excluded_handlers=["admin",# Unanchored regex."^/secret/.*$"],# Full regex example.buckets=(1,2,3,4,),metric_name="flask_http"label_names=("flask_method","flask_handler","flask_status",),round_latency_decimals=3,).instrument(app).expose(app,"/prometheus_metrics")It is important to notice that you don't have to use theexpose()method if
adding the endpoint directly to the Flask app does not suit you. There are many
other ways to expose the metrics.The defaults are the following:should_group_status_codes:bool=True,should_ignore_untemplated:bool=False,should_group_untemplated:bool=True,should_round_latency_decimals:bool=False,excluded_handlers:list=["/metrics"],buckets:tuple=Histogram.DEFAULT_BUCKETS,metric_name:str="http_request_duration_seconds",label_names:tuple=("method","handler","status",),round_latency_decimals:int=4,Prerequesitespython = "^3.6"(tested with 3.6 and 3.8)flask = "^1"(tested with 1.1.2)prometheus-client = "^0.8.0"(tested with 0.8.0)DevelopmentDeveloping and building this package on a local machine requiresPython Poetry. I recommend to run Poetry in
tandem withPyenv. Once the repository is
cloned, runpoetry installandpoetry shell. From here you may start the
IDE of your choice.For formatting, theblack formatteris used.
Runblack .in the repository to reformat source files. It will respect
the black configuration in thepyproject.toml.