Saravanan666/pypi-org huggingface dataset:
Package: ops-lib-mysql
Juju Operator Framework Charm Interface for MySQL & MariaDB RelationsTo use this interface in yourJuju Operator Frameworkcharm,
instructcharmcraftto embed
it into your built Operator Framework charm by adding ops-lib-mysql to
yourrequirements.txtfile::ops
ops-lib-mysqlYour charm needs to declare its use of the interface in itsmetadata.yamlfile:requires:db:interface:mysqllimit:1# Most charms only handle a single MySQL Application.Your charm needs to bootstrap it and handle events:fromopslib.mysqlimportMySQLClient,MySQLRelationEventclassMyCharm(ops.charm.CharmBase):_state=ops.framework.StoredState()def__init__(self,*args):super().__init__(*args)self._state.set_default(db_available=False,db_conn_str=None,db_host=None,db_port=None,db_name=None,db_user=None,db_password=None,db_root_password=None,)self.db=MySQLClient(self,'db')# 'db' relation in metadata.yamlself.framework.observe(self.db.on.database_changed,self._on_database_changed)def_on_database_changed(self,event:MySQLRelationEvent):self._state.db_available=event.is_available# Boolean flagself._state.db_conn_str=event.connection_string# host={host} port={port} ...self._state.db_host=event.hostself._state.db_port=event.portself._state.db_name=event.databaseself._state.db_user=event.userself._state.db_password=event.passwordself._state.db_root_password=event.root_password
Package: ops-lib-pgsql
Juju Operator Framework Charm Interface for PostgreSQL RelationsTo use this interface in yourJuju Operator Frameworkcharm,
instructcharmcraftto embed
it into your built Operator Framework charm by adding ops-lib-pgsql to
yourrequirements.txtfile::ops
ops-lib-pgsqlYour charm needs to declare its use of the interface in itsmetadata.yamlfile:requires:db:interface:pgsqllimit:1# Most charms only handle a single PostgreSQL Application.Your charm needs to bootstrap it and handle events:pgsql=ops.lib.use("pgsql",1,"postgresql-charmers@lists.launchpad.net")classMyCharm(ops.charm.CharmBase):_state=ops.framework.StoredState()def__init__(self,*args):super().__init__(*args)self._state.set_default(db_conn_str=None,db_uri=None,db_ro_uris=[])self.db=pgsql.PostgreSQLClient(self,'db')# 'db' relation in metadata.yamlself.framework.observe(self.db.on.database_relation_joined,self._on_database_relation_joined)self.framework.observe(self.db.on.master_changed,self._on_master_changed)self.framework.observe(self.db.on.standby_changed,self._on_standby_changed)def_on_database_relation_joined(self,event:pgsql.DatabaseRelationJoinedEvent):ifself.model.unit.is_leader():# Provide requirements to the PostgreSQL server.event.database='mydbname'# Request database named mydbnameevent.extensions=['citext']# Request the citext extension installedelifevent.database!='mydbname':# Leader has not yet set requirements. Defer, incase this unit# becomes leader and needs to perform that operation.event.defer()returndef_on_master_changed(self,event:pgsql.MasterChangedEvent):ifevent.database!='mydbname':# Leader has not yet set requirements. Wait until next event,# or risk connecting to an incorrect database.return# The connection to the primary database has been created,# changed or removed. More specific events are available, but# most charms will find it easier to just handle the Changed# events. event.master is None if the master database is not# available, or a pgsql.ConnectionString instance.self._state.db_conn_str=Noneifevent.masterisNoneelseevent.master.conn_strself._state.db_uri=Noneifevent.masterisNoneelseevent.master.uri# You probably want to emit an event here or call a setup routine to# do something useful with the libpq connection string or URI now they# are available.def_on_standby_changed(self,event:pgsql.StandbyChangedEvent):ifevent.database!='mydbname':# Leader has not yet set requirements. Wait until next event,# or risk connecting to an incorrect database.return# Charms needing access to the hot standby databases can get# their connection details here. Applications can scale out# horizontally if they can make use of the read only hot# standby replica databases, rather than only use the single# master. event.stanbys will be an empty list if no hot standby# databases are available.self._state.db_ro_uris=[c.uriforcinevent.standbys]
Package: opsmatcal
opsmatcalA python package for calibrating opensees uniaxial materials using genetic algorithm.InstallationUse the package managerpipto install opsmatcal.pip install opsmatcalUsageImport opsmatcal in your Python code like this:importopsmatcal.matcalibrateasomcSupportEmailTelegram ChannelInstagramDocumentation1- Download from:Documentation2- Use getDoc() method of opsmatcal.matcalibrate module:omc.getDoc()AuthorOktay Alizadeh Arasi
Master of Science in Structural EngineeringLicenseOSI Approved : MIT License
Package: opsml-cli
Opsml-cliThis package provides a python-installable CLI written inRustfor interacting withopsml.InstallationUsing Poetrypoetryaddopsml-cliUsing Pippipinstallopsml-cliCommandsTo get a list of commands, runopsml-cli help.Listing Cards$opsml-clilist-cards--registrymodelDownloading Model#Downloadmodelonly$opsml-clidownload-model--name{{model}}--repository{{repository}}--version{{version}}# name repository version$opsml-clidownload-model--uid{{uid}}# model from uid#Downloadonnxversionofmodel$opsml-clidownload-model--namemodel--repository{{repository}}--version1.0.0--onnx#Downloadmodelandpreprocessor(ifavailable)opsml-cli download-model --name model -- version 1.0.0 --repository {{repository}} --onnx --preprocessorContributingIf you'd like to contribute, be sure to check out ourcontributing guide!Thanks goes to these phenomenalprojects and peopleand people for creating a great foundation to build from!
Package: opsmodel
opsmodelA python library for creating openseespy models.InstallationUse the package managerpipto install opsmodel.pip install opsmodelUsageImport opsmodel in your Python code(openseespy project) like this:importopsmodel.modelasomdSupportEmailTelegram ChannelInstagramDeveloperOkhtai Alizadeh Arasi
Master of Science in Structural EngineeringLicenseOSI Approved : MIT License
Package: ops-py-azure-key-vault-alert
azure-key-vault-alertDescriptionGenerates aKey Vaultreport table and summary table for one moreKey Vaultsusingops-py-azure-key-vault-reportThe result is posted to a webhook url (WEBHOOK_REPORT).
An additional empty notify may also be post secondary webhook url (WEBHOOK_NOTIFY)The result may be posted to a Slack webhook (Slack App or Slack Workflow) or to MS Teams webhook.The post requests are handled byops-py-message-handler.SlackIf the url of the webhook containsslack.comthe report will be posted toSlack.Slack AppIf the webhook containsslack.com/servicesa payload for a Slack App will be generated in the following format:{"text": "*title*\n```result```"}Slack WorkflowIf the webhook containsslack.com, but not theslack.com/servicespart, a payload for a Slack Workflow will
be generated. The Workflow will have to be set up to accept aTitlevariable and aTextvariable.MS TeamsIf the url of the webhookdoes notcontainslack.coma payload for MS Teams will be generated. The payload will
also contain a html table of the report (if any). If nothing to report, only a summary will be posted asfacts.Installationpip install ops-py-azure-key-vault-alertUsageExport the webhook url(s) as environment variables:WEBHOOK_REPORTThe result is posted to the value of this webhook. E.g.:export WEBHOOK_REPORT="https://hooks.slack.com/workflows/T02XYZ..."WEBHOOK_NOTIFYWhen the result has been posted, an additional POST is performed to the value of this webhook. E.g.:export WEBHOOK_NOTIFY="https://hooks.slack.com/workflows/T02ZYX..."Provide the list of Key Vaults after the-v/--vaults' command line argument (space separated), e.g.:python3 azure_key_vault_alert -v kv-prod kv-dev kv-qaOther valid arguments:--expire_thresholdIf this argument is provided and followed by an int value,
the record will only be reported if days to the record's Expiration Date is below the threshold.--include_no_expirationIf this argument is provided, the report will also include the records which has noExpiration Dateset.The default behavior is simply to ignore the record which does not have aExpiration Dateset.--include_allIf this argument is provided, the report will include all the records (verbose).--titleThe title of the message posted in Slack or MS Teams (Default: Azure Key Vault report)--record_typesList of record types to check for. E.g. certificate secretValid types are: certificate secret key (Default is all: certificate secret key)--slack_split_charsIf the Slack message is above this value it will be split into multiple posts (default: 3500).Each post will then include a maximum of 3500 characters.--teams_max_charsThe max characters the report can have due to the MS Teams payload size limits (default: 17367).If the message is above this threshold then only the facts (summary) will be posted to MS Teams.The HTML table will in this case not be included.--stdout_onlyOnly print report to stdout. No POST to the Message Handler
Package: ops-py-example-code
example-codeThis example code is simply to demonstrate how Open Source Python code should be written, documented and structured.The file structure should be organized as of the following:src/
├─ requirements.txt
├─ simple_service/
│  ├─ __init__.py
│  ├─ simple_service.py
README.md
LICENSEHow the code should be written and documentedThe code should include comments and proper documentation.Use DocstringsPlease refer to the documentation in thesimple_service.pyfile of this package and toDocumenting Python Code: A Complete Guide.To write proper and understandable code, for you and for others to read, you may also refer toHow to Write Beautiful Python Code With PEP 8How to build and distribute the codePlease refer to theops-py-generate-pyprojectdocumentation.
Package: ops-py-generate-pyproject
generate-pyprojectBefore you beginPlease refer to theexample-codeif you are planning on writing a Python package and distribute it tohttps://pypi.orgUsageInstall this package:pip install ops-py-generate-pyprojectExport the VERSION and PROJECT_NAME environment variablesThe PyPI project name and version, e.g.:export VERSION=1.2.3
export PROJECT_NAME=my-fabulous-projectsRun the codeBe sure to be in the directory where thesrcdir of you code is located. Then run the following:python3 -m generate_pyproject.generate_pyprojectWhen executing the above code, the following files should then be generated in thesrc/my-fabulous-projectsdirectory:setup.pypyproject.tomlBuild the pip packageBe sure to be inside thesrcdirectory and then run:python -m buildUpload to pypi.orgBe sure to be inside thesrcdirectory and then run:python -m twine upload --verbose dist/*
Package: ops-py-message-handler
ops-py-message-handlerDescriptionPosts a payload / message to an url (webhook).Installationpip install ops-py-message-handlerUsageSlack WorkflowNote: In the example code below a Slack Automation Workflow has already been built. The message part of the Slack Workflow has been defined to receive aTitleand aTextvariable.
Export your slack webhook:export WEBHOOK="12345blablabla...."Example code:#!/usr/bin/env python

import os
from message_handler import message_handler as mh

WEBHOOK = os.getenv("WEBHOOK")
heading = "This is the heading"
message = "This is the message"

handler = mh.MessageHandler(WEBHOOK)
handler.build_payload(Title=heading, Text=message)
handler.post_payload()
response_code = handler.get_response_code()
print(response_code)Slack AppExport your slack webhook:export WEBHOOK="12345blablabla...."Example code:#!/usr/bin/env python

import os
from message_handler import message_handler as mh

WEBHOOK = os.getenv("WEBHOOK")
heading = "This is the heading"
message = "This is the message"
payload = {"text": f"*{heading}*\n```{message}```"}

handler = mh.MessageHandler(WEBHOOK)
handler.set_payload(payload)
handler.post_payload()
response_code = handler.get_response_code()
print(response_code)MS TeamsExport your MS Teams webhook:export WEBHOOK="12345blablabla...."Example code:#!/usr/bin/env python

import os
from message_handler import message_handler as mh

WEBHOOK = os.getenv("WEBHOOK")
payload = {
  "@type": "MessageCard",
  "@context": "http://schema.org/extensions",
  "themeColor": "0076D7",
  "summary": "-",
  "sections": [
    {
      "activityTitle": "Super Secret Key Vault",
      "activitySubtitle": "",
      "activityImage": "",
      "facts": [],
      "markdown": True
    },
    {
      "startGroup": True,
      "text": """<table bordercolor='black' border='2'>
    <thead>
    <tr style='background-color : Teal; color: White'>
        <th>Secret Name</th>
        <th>Last Updated</th>
        <th>Expiration</th>
        <th>Comment</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>SuperSecret</td>
        <td>2023-10-31</td>
        <td>2024-06-25</td>
        <td>Will expire in 201 days. Updated 37 days ago.</td>
    </tr>
    </tbody>
</table>"""
    }
  ]
}

handler = mh.MessageHandler(WEBHOOK)
handler.set_payload(payload)
handler.post_payload()
response_code = handler.get_response_code()
print(response_code)
Package: opsramp-analytics-utils
OpsRamp Analytics UtilitiesThis is the SDK for writing OpsRamp analytics apps. It is based ondash, and it has a number of utility functions.It containsanalysis wrapper project.It is published onPypiHow to publish on PypiAfter make updates on SDK, modify the version insetup.py.python setup.py sdist bdist_wheel
python -m twine upload dist/*

Note: if above command not works, then use below command
python -m twine upload --skip-existing dist/*To upgrade the sdk for your apppip install --no-cache-dir --upgrade opsramp-analytics-utils
Package: opsramp-analytics-utils-server-status
OpsRamp Analytics UtilitiesThis is the SDK for writing OpsRamp analytics apps. It is based ondash, and it has a number of utility functions.It containsanalysis wrapper project.It is published onPypiHow to publish on PypiAfter make updates on SDK, modify the version insetup.py.python setup.py sdist bdist_wheel
python -m twine upload dist/*

Note: if above command not works, then use below command
python -m twine upload --skip-existing dist/*To upgrade the sdk for your apppip install --no-cache-dir --upgrade opsramp-analytics-utils
Package: ops-reactive-interface
ops-reactive-interfaceThis library is a helper for developers creating interface protocol API
libraries for charms. The goal is to allow the developer to focus on
implementing the API library using the best practices from theOperator
frameworkpattern and still enable usage in older charms which have yet to be
transitioned from thecharms.reactive frameworkwith minimal additional
developer and resource overhead.UsageAll that is required to use this library is to add a bit of info to your
interface protocol API library'ssetup.pyto include this as a dependency and
to register your API classes with the role and interface protocol name they
implement. Full details can be found inthe docs, as well as anexamplewhich shows an interface API implementation with
usage by both an Operator framework charm and a charms.reactive charm.
Package: opssection
OpsSectionA python library for creating openseespy fiber section objects.InstallationUse the package managerpipto install OpsSection.pip install opssectionUsageImport OpsSection in your Python code(openseespy project) like this:importopssection.fibersectionasofsSupportEmailTelegram ChannelInstagramAuthorOktai Alizade Arasi
Master of Science in Structural EngineeringDocumentation1- Download from:OpsSection Documentation2- Use getDoc() method of opssection.fibersection module:ofs.getDoc()LicenseOSI Approved : MIT License
Package: opstacle
An SMTP proxy built aroundinbox.pywhich attempts
to maintain some sanity as your servers begin to send thousands of
emails just cause.The basic premise is emails from a given server or process will happen,
but all 1300 aren’t really necessary right this instant. god forbid if
you pay by the smtp delivery.Installationpip install opstacleConfigurationopstacle is configured only by environment variables, and our
contestants are:Pretty thingsOPSTACLE_FROM_ADDRESSMost messages will be simply relayed without modification, but we
need our own name when we send rolled up emailsSample Value: “Opstacleopstacle@opstacle.io”Threshold configurationOPSTACLE_INTERVALInterval to keep counters when messages have been sent, in secondsSample Value: 30OPSTACLE_MESSAGE_CAPMax number of messages to send in a givenOPSTACLE_INTERVALSample Value: 5“Fake” SMTP server (where opstacle will listen)OPSTACLE_LISTEN_HOSTSample Value: “127.0.0.1”OPSTACLE_LISTEN_PORTSample Value: 9025“Real” SMTP serverOPSTACLE_SMTP_USERSample Value: “postmaster@smtp.opstacle.org”OPSTACLE_SMTP_PASSSample Value: “stopTheInsanity”OPSTACLE_SMTP_HOSTSample Value: “smtp.opstacle.org”OPSTACLE_SMTP_PORTSample Value: “587”RunningOnce installed, opstacle can be invoked by callingopstacle.Logs are spit directly to YOU! Right there on STDOUT, and no you can’t
turn them down
Package: opstool
opstoolmodelling, visualization, post-processing for OpenSeesPy.opstoolis a useful toolbox package aims to helpOpenSeesPypre-processing,visualization,analysis-aid, etc.
The package is still under development.To use, installopstoolfromopstool-PyPI:pipinstall--upgradeopstoolThe restriction on the python version mainly depends onopenseespy,
it is recommended that you useAnacondato avoid library version incompatibilities.DocumentLatest: Seehttps://opstool.readthedocs.io/en/latest/.Stable: Seehttps://opstool.readthedocs.io/en/stable/VisualizationBased onplotlyModelModalDeformationBased onpyvistaModelEigenDeformationAnimationEigenDeformationFiber section vis✅✅Fiber Section Mesh Generation✅✅✅Moment-Curvature Analysis of Fiber SectionSection MeshMoment-Curvature AnalysisLicenseThis software is published under theGPLv3 license.
Package: opstrich
OpstrichDevOps tooling, various scripts, etc.InstallationFirst install theopstrichpackage:pip install opstrichTo use the providedinvoketasks, you will also need to add these to a collection in your project:# tasks.py

from invoke import Collection
from opstrich.invoke import check, openssl, package

namespace = Collection(check, openssl, package)UsageOnce the invoke tasks have been added, you can view help information on them viainv -landinv --help.
Package: opsuite.config
Introduction============This package provides a dict-like interface to a global plone.registry and makes guesses about what type each object is when it is first set.This is intended to smooth configuration migrations from existing dict-like structure to plone.registry.This package is part of the Opinion Suite system, and is licenced under the Affero General Public Licence v3 with options.  See LICENSE.txt for more information.Changelog=========1.0---* Proof of concept initial release
Package: opsview
# Opsview Python REST API clienthttps://github.com/pschmitt/python-opsview## Installation```bashpip install opsview```## Usage```pythonfrom opsview import Opsviewo = Opsview('opsview.example.com',verify_ssl=True,username='pschmitt',password='MySecretPassw0rd')```## LicenseGPL3
Package: opsvis
opsvisOpenSeesPy (OpenSees) postprocessing and visualization moduleInstallationpip install opsvisNote: The previous name of this module wasops_vis, but to avoid
issues with PyPi and readthedocs naming conventions, the name of the
package and module to import is without the underscore.Usageimport opsvis as opsvDocumentationhttps://opsvis.readthedocs.io/en/latest/OpenSeesPy documentationhttps://openseespydoc.readthedocs.io/en/latest/
Package: opswork
OpsWorkTo use opswork, follow the following steps:Create a python virtual environment or use system wide environment$ python3 -m venv venv
$ source venv/bin/activateInstall opswork package with pip.$ pip install opsworkGet opswork command line help$ opswork --helpInit the config file and the sqlite database$ opswork config initTo edit configs$ opswork config initAdd a recipe$ opswork recipe add <recipe_name> -p <recipe_relative_path>

# Some examples
$ opswork recipe add clivern/ping -p recipe/ping -f
$ opswork recipe add clivern/nginx -p recipe/nginx -f
$ opswork recipe add clivern/motd -p recipe/motd -f
$ opswork recipe add clivern/cmd -p recipe/cmd -f
# From remote git
$ opswork recipe add clivern/dotfiles/update -p git@github.com:clivern/dotfiles.git -s brew/update -t dotfiles -fTo list recipes$ opswork recipe list

# Get recipes as a JSON
$ opswork recipe list -o json | jq .To get a recipe$ opswork recipe get <recipe_name>To delete a recipe$ opswork recipe delete <recipe_name>Add a host$ opswork host add <host_name> -i <host_ip> -p <ssh_port> -u <ssh_username> -s <ssh_key_path>

# Add a remote host
$ opswork host add example.com -i 127.0.0.1 -p 22 -u root -s /Users/root/.ssh/id_rsa.pem

# Add the localhost
$ opswork host add localhost -i localhost -c localTo list hosts$ opswork host list

# Get hosts as a JSON
$ opswork host list -o json | jq .To get a host$ opswork host get <host_name>To SSH into a host$ opswork host ssh <host_name>To delete a host$ opswork host delete <host_name>Run a recipe towards a host$ opswork recipe run <recipe_name> -h <host_name> -v key=value

# Some examples
$ opswork recipe run clivern/nginx -h example.com
$ opswork recipe run clivern/ping -h localhostTo generate a random password$ opswork random password 8To add a secret$ opswork secret add <secret/name> <secret_value> -t <tag>

$ opswork secret add clivern/cloud_provider/api_key xxxx-xxxx-xxxx-xxxx -t cloud_providerTo list secrets$ opswork secret list -o jsonTo get a secret$ opswork secret get <secret_name>

# For example
$ opswork secret get clivern/cloud_provider/api_keyTo delete a secret$ opswork secret delete <secret_name>

# For example
$ opswork secret delete clivern/cloud_provider/api_key
Package: opswrapper
Python wrappers and helpers for (Tcl) OpenSees analyses.InstallationConda:conda install -c otaithleigh opswrapperUsageThe objects provided in this package largely line up with their OpenSees Tcl
counterparts. The general workflow is to create a list of objects, and then callstron them while printing to a file. Each entry in the list will become a
line in the Tcl script, allowing for mixing of raw Tcl code and opswrapper
objects.Simple Exampleimportopswrapperasopsmodel=[]model.append(ops.Model(ndm=2,ndf=3))model.append(ops.Node(1,0,0))model.append(ops.Node(2,0,10))model.append(ops.material.Elastic(1,29000))model.append(ops.element.Truss(1,1,2,mat=1,A=10))print(*model,sep='\n')Output:model basic -ndm 2 -ndf 3
node 1 0 0
node 2 0 10
uniaxialMaterial Elastic 1 29000
element truss 1 1 2 10 1FormattingObjects can be formatted via multiple ways. The simplest is to convert them tostr:>>>str(Elastic(1,29000.))'uniaxialMaterial 1 29000'A float format specifier may be specified when used with the built-in format
commands:>>>format(Elastic(1,29000.),'e')'uniaxialMaterial 1 2.900000e+4'>>>f'{Elastic(1,29000.):.2e}''uniaxialMaterial 1 2.90e+04'Specifiers for other types may be passed using thetcl_codemethod:>>>Elastic(1,29000.).tcl_code({int:'4d'})'uniaxialMaterial Elastic    1 29000'Defaults can be set on a global basis usingbase.set_global_format_spec, on a
per-class basis usingcls.set_class_format_spec, or on a per-object basis
usingself.set_format_spec:>>>set_global_format_spec({float:'#.3g'})>>>section.Elastic2D.set_class_format_spec({float:'#.3g'})>>>s=section.Elastic2D(...)>>>s.set_format_spec({float:'#.3g'})Each of these methods return the previously-set modifiers if you wish to restore
them later.
Package: opszero-rustypy
opszero-rustypyopszero-rustypy is a template Rust Library for Python usingPyo3.The project is a template that you can clone or generate using the PyO2 product. This project
exists as a demonstration of a Ruby library that is used withing AWS Lambda and Kubernetes:aws-lambda-pythontiphyspyDependenciesMacOSbrew install pyenv pyenv-virtualenv
pip3 install maturinCreatemkdir project/
maturin init
✔ 🤷 What kind of bindings to use? · pyo3Buildpyenv virtualenv opszero-rustypy
pyenv activate opszero-rustypy
cargo update
./build.shBuilt for Mac, Linux and Windows on PushPublishPublished on Release TagUse>>>importopszero_rustypy>>>opszero_rustypy.sum_as_string(1,2)'3'