Saravanan666/pypi-org huggingface dataset:
Package: sau-test
SAU ExporterOverviewThe SAU Exporter is a Python-based application designed to collect and expose AWS EC2 and EBS volume metrics for monitoring and observability. It utilizes the Prometheus client library to provide an HTTP endpoint for scraping metrics.FeaturesEC2 Metrics: Collects information about stopped EC2 instances in different AWS regions.EBS Volume Metrics: Retrieves data on unattached/errored EBS volumes, including volume state, type, size, and region.Prometheus Integration: Exposes metrics in the Prometheus format, making it compatible with Prometheus monitoring systems.Getting StartedInstalling via pipOffers support for python>=3.8pipinstallsauUsing pip package after installationpython3-msau-c/path/to/config.yamlInstalling using dockerThe docker repository is available atlink. You will need the following:config file:see sectionAWS Credentials: It would be easier to put the creds in a env file and reference the file when running container. Example.envfile can be seen below:AWS_ACCESS_KEY_ID=129QJDNC2OQD09N
AWS_SECRET_ACCESS_KEY=9KXXXXXXXXX
AWS_REGION=eu-central-1To run the container, use the example command below:dockerrun-ti--env-file.env-v/path/to/config.yaml:/sau/config.yamlugwuanyi/sau:latest-c/sau/config.yamlPrerequisites:Python 3.8+ installed on your system.Ensure the required Python libraries are installed by running the following command.pipinstall-rrequirements.txtConfiguration:Create a YAML configuration file with the necessary settings.Configuration OptionsRegions: Specify the AWS regions for which you want to collect metrics.Exporter Port: Define the port on which the exporter will expose metrics (default: 9000).Logging Configuration: Customize logging settings, such as log file directory and retention.
See example below.# list of regions to scrape: REQUIREDregions:-eu-central-1-eu-west-1# exporter port. Defaults to 9000exporter_port:9000# Logging configurationlogging:# Number of log files to retain after log rotationretention:7# log directory. defaults to current working directorydirectory:"."# log level (debug, info, warn, error). Defaults to infolevel:infoRunning the Exporter:Execute the exporter by providing the path to the configuration file:python3sau_exporter.py-c/path/to/your/config.yamlMetrics Endpoint:Once the exporter is running, metrics can be accessed athttp://localhost:<exporter_port>/.CustomizationFeel free to extend or customize the exporter to meet your specific requirements. You can modify the provided code or add additional collectors to gather more AWS resource metrics.LicenseThis project is licensed under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.AuthorCreated by Emeka Ugwuanyi. For questions or feedback, please contact me.Happy monitoring!
Package: sauth
ServerauthA simple server for serving directories via http or https and BASIC authorization:$ sauth --help
Usage: sauth [OPTIONS] USERNAME PASSWORD [IP] [PORT]

  Start http server with basic authentication current directory.

Options:
  -d, --dir TEXT  use different directory
  -s, --https     use https
  -t, --thread    serve each request in a different thread
  --help          Show this message and exit.Free software: GNU General Public License v3Installationpip install sauthAlso available on Arch User Repository if you’re running arch:pacaur -S sauthUsageTo serve your current directory simply run:$ sauth someuser somepass
Serving "/home/user/somedir" directory on http://0.0.0.0:8333You can specify port and ip to serve on with 3rd and 4th arguments:$ sauth someuser somepass 127.0.0.1 1234
Serving "/home/user/somedir" directory on http://127.0.0.1:1234Threading is also supported through-tor–threadflags:$ sauth someuser somepass 127.0.0.1 1234 –thread
Serving “/home/user/somedir” directory onhttp://127.0.0.1:1234using threading
Package: sautils
Various SQLAlchemy utilities which are a little specific to be proposed tomain SQLAlchemy distribution.Currently the following features are supported:- insert_from_select(table, select) -- adapted from corresponding SQLAlchemyexample (all copyrights goes to @zzzeek)- upsert_from_select(table, select) -- upsert via insert from select with leftjoin on target table- upsert(table, **values) -- upsert of values- sqltype(name) -- shortcut for defining ad-hoc types
Package: savager
SVGpyThis is a basic library written in python for creating simple svgs with python scripts.Table of Contents:[[TOC]]Files:FileDescriptionsavager/__init__.pyimports librarysavager/file.pyfile class used to write svg filessavager/element.pyused by file class to generate elements in svgflower.pyexample of use, generates flower.svgflower.svgexample svg generated by flower.pysetup.pythis enables import as a python libraryLICENSEYou have full permission to use and modify this library, just please pass on that privilege.README.mdthis fileImporting this library:pip:$pipinstallgit+https://gitlab.com/pyrogue6/savager.gitpip for development while in repo:$pipinstall-e.coming soon to PyPI:$pipinstallsavagerNotesResource heavily used:https://developer.mozilla.org/en-US/docs/Web/SVG/TutorialThis library uses xlink:href instead of the href standard in  blocks to maintain compatability with eog (EyeOfGnome)path parameters use underscores instead of dashes, and are converted back to dashes when writing to svg filesthis could be solved by unpacking a dictionary every time you want to add parameters that use dashes, but that's pretty uglywe believe in tabs here, sorry.TODOKey[+] feature to be added[x] change in code[-] bug to be removed[?] uncertain how to proceedTasks[+] manipulate paths within SVG class[+] easily add function-defined paths[+] circles and elipses[+] error handling especially in writing to files![+] css stylesheets for reducing file sizes?└──https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes[+] need way to add controls easily├──optional arg for a control gen?└──incorporated into coord gen? tuple for all paired controls?[x] Split path and SVG classes into seperate files?[x] make demo or doctest directory for extraneous files[+] test_suite for setup to enhance unittests├──https://setuptools.readthedocs.io/en/latest/setuptools.html└──also write unittests, woops[x] use scm metadata to setup└──https://pypi.org/project/setuptools-scm/[+] upload to PyPI└──update badges![?] change project name to match library name?
Package: savanna
Savanna at wiki.openstack.org:https://wiki.openstack.org/wiki/SavannaLaunchpad project:https://launchpad.net/savannaSavanna docs site:https://savanna.readthedocs.org/en/latest/index.htmlRoadmap:https://wiki.openstack.org/wiki/Savanna/RoadmapQuickstart guide:https://savanna.readthedocs.org/en/latest/devref/quickstart.htmlHow to participate:https://savanna.readthedocs.org/en/latest/devref/how_to_participate.htmlLicenseCopyright (c) 2013 Mirantis Inc.Apache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: savanna-dashboard
Savanna project:https://github.com/stackforge/savannaSavanna at wiki.openstack.org:https://wiki.openstack.org/wiki/SavannaLaunchpad project:https://launchpad.net/savannaSavanna docs site:https://savanna.readthedocs.org/en/latest/index.htmlRoadmap:https://wiki.openstack.org/wiki/Savanna/RoadmapQuickstart guide:https://savanna.readthedocs.org/en/latest/devref/quickstart.htmlHow to participate:https://savanna.readthedocs.org/en/latest/devref/how_to_participate.htmlLicenseCopyright (c) 2013 Mirantis Inc.Apache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: savannahcrm-client
Savannah CRM ClientThis client library wraps theSavannah CRM API, making it easier to import community members and activity from your own Python code.UsageConnecting to an API Source>>> from savannahcrm import SavannahAPISource

>>> source = SavannahAPISource(token='7fbd4b88-5af7-4acf-bc81-f1888cd8f1b2')

>>> print("Source: %s" % source)
Source: Test

>>> print("Source info: %s" % source.info)
Source info: {'community': 'InfluxDB', 'name': 'Test', 'icon_name': 'fab fa-twitter-square', 'first_import': None, 'last_import': '2021-04-20T14:20:12.440415', 'enabled': True}Adding a Member>>> new_member = source.add_member(
...     origin_id='test-1',
...     username='test_user_1',
...     name='API Test User',
...     email='api@test.com',
...     tags=['api-test']
... )

>>> print("Member: %s" % new_member)
Member: {'origin_id': 'test-1', 'username': 'test_user_1', 'name': 'API Test User', 'email': 'api@test.com', 'avatar': None, 'tags': ['api-test']}Adding a Converation>>> convo_tstamp = datetime.datetime(2021, 4, 19, 13, 35, 00)

>>> new_convo = source.add_conversation(
...     origin_id='test-convo-1',
...     speaker='test-1',
...     channel='API Test',
...     timestamp=convo_tstamp,
...     content='Testing savannah-client library for Python',
...     location='https://docs.savannahhq.com/api/',
...     tags=['api-test', 'python']
... )

>>> print("Conversation: %s" % new_convo)
Conversation: {'origin_id': 'test-convo-1', 'speaker': 'test-1', 'channel': 'API Test', 'timestamp': '2021-04-19T13:35:00', 'content': 'Testing savannah-client library for Python', 'location': 'https://docs.savannahhq.com/api/', 'participants': ['test-1'], 'tags': ['api-test', 'python']}Adding a Contribution>>> new_contrib = source.add_contribution(
...     origin_id='test-convo-1',
...     author='test-1',
...     channel='API Test',
...     contribution_type='Pull Request',
...     timestamp=convo_tstamp,
...     title='Built importer using the Savannah API',
...     location='https://github.com/SavannahHQ/savannahcrm-client-python',
...     tags=['api-test', 'python'],
...     conversation='test-convo-1',
... )

>>> print("Contribution: %s" % new_contrib)
Contribution: {'origin_id': 'test-convo-1', 'author': 'test-1', 'contribution_type': 'Pull Request', 'channel': 'API Test', 'timestamp': '2021-04-19T13:35:00', 'title': 'Built importer using the Savannah API', 'location': 'https://github.com/SavannahHQ/savannahcrm-client-python', 'conversation': 'test-convo-1', 'tags': ['api-test', 'python']}
Package: savantaudio-client
Savant Audio Switch ClientThe savantaudio-client package allows users to download the contents of thisGiHub repository,  containing a client library to control Savant Audio Switches such as the SSA-3220/SSA-3220D.InstallingInstall and update usingpip:pip3installsavantaudio-clientOr you can clone this repo using:gitclonehttps://github.com/akropp/savantaudio-client.gitUsageThe client is based on asyncio, so all calls must be made in the context of an event loop.  A basic example which connects to a switch device and fetches all of the inputs/outputs is as follows:importloggingimportasyncioimportsavantaudio.clientlogging.basicConfig(handlers=[logging.StreamHandler()],encoding='utf-8',level=logging.INFO)savantaudio.client._LOGGER.setLevel(logging.DEBUG)switch=savantaudio.client.Switch(host='192.168.1.216',port=8085)loop=asyncio.new_event_loop()asyncio.set_event_loop(loop)loop.run_until_complete(switch.refresh())print(str(switch))loop.run_until_complete(switch.link(11,8))loop.run_until_complete(switch.output(11).set_volume(-20))print(str(switch.output(11)))loop.run_until_complete(switch.unlink(11))print(str(switch.output(11)))
Package: sav.channels
Channels between coroutinesA simplePythonimplementation of thechannelsynchronization
construct forasync/awaitapplications.Channels are used for synchronization in theCSPconcurrency model.
They are natively supported by languages that implement this model, such
asoccamandGo. Python hasasynchronous generators, which are
similar to channels except that they require yielding instead of calling
from one of the two endpoints. While this makes no difference in many
cases, some problems are easier to solve if a data stream can be
accessed from both ends by calling instead of yielding.Thesav.channelsmodule implements channels as pairs of
asynchronous generators. When an object is sent into one generator, it
will be yielded by the other generator, and vice-versa.InstallationThis module requires Python 3.8 or higher. Usepipto install it
from the command line:pip install sav.channelsOr visit the online project pages onGitHubandPyPI.Exampleimportasynciofromsavimportchannelsa_receiver,a_sender=channels.create()b_receiver,b_sender=channels.create()asyncdefsend_messages():"""Send messages into multiple channels."""asyncwithchannels.open(a_sender),channels.open(b_sender):awaita_sender.asend('Hello Arnold.')awaitb_sender.asend('Hello Bernard.')awaita_sender.asend('Goodbye Arnold.')awaitb_sender.asend('Goodbye Bernard.')asyncdefshow_messages(name,receiver):"""Show messages from a single channel."""asyncformessageinreceiver:print(f'Message for{name}:{message}')asyncdefmain():"""Run both channels concurrently."""awaitasyncio.gather(send_messages(),show_messages('Arnold',a_receiver),show_messages('Bernard',b_receiver))asyncio.run(main())DocumentationSee thedocumentationfor further details.Or useSphinxto build a local copy of the documentation from the package
source:cd docs
make singlehtml
Package: save
A very simple module tosafelysave data to files in python.When you choose a path and a name for the file you want to save your
data to, the script checksif the given file at the given path already
exist; if so,it adds an increasing numbering at the end of the file
name(just before the file extension if there is any) untill it finds
a path+name not taken already.This prevents from losing data by inadvertently re-writing a file.Install$ pip install saveBasic usagefrom save import save

data = 'Hey there'
save(data, 'my_file.txt')The safe_path functionYou can import thesafe_pathsubmodule to use with other libraries
or functions. It provides the same functionality assave().
(Basically thesave()function itself callssafe_path()to do
the work)This is an example involving matplotlib:from matplotlib import pyplot as plt
from save import safe_path

plt.plot(range(10))
plt.savefig(safe_path('my_figure.png'))
Package: savefig
Remember that time where you tried to remake a figure for your paper and
couldn’t seem to get the same results? We’ve all been there. Well not
anymore!This module monkey patches thesavefigcommand frommatplotliband inserts your current git commit hash into
the metadata of the saved file. Currently it supports PNG and PDF figures.UsageFirst, install the modulefrom PyPI:pip install savefigorfrom source:git clone https://github.com/dfm/savefig.git
cd savefig
python setup.py installThen in all your code just add the following lines before importing matplotlib:from savefig import monkey_patch
monkey_patch()To read the metadata from an existing image file, run:python -m savefig /path/to/figure.pngwhich will give you something like:git-hash: 192a639c4a9eb7523e9becd23f359fd7d96e833f
git-date: 2014-03-29 21:30:27 -0400
git-author: Dan F-MYou can also get the diff between the saved commit hash and the version used
to make the figure by running:python -m savefig /path/to/figure.png --diffLicenseCopyright 2014 Dan Foreman-MackeyAvailable under the MIT License.
Package: savefigs
savefigsEasily save all open Matplotlib figures, with useful filenames.UsageAssume we have a scriptsome_script.pythat creates multiple Matplotlib figures.Import thesavefigsfunction:fromsavefigsimportsavefigsThe below examples assume the figures do not have labels (fig.get_label()).
If a figure does have a label, it will be used in place offig{num}.Default save settings (./{script filename stem}{figure label or fig{num}}.png):savefigs()# ./some_script_fig1.png, ./some_script_fig2.png, ...👆 The filenames tell us which script generated the figures as well as their relative places in the figure generation order (or labels if they are labeled).Specify directory:savefigs(save_dir="figs")# must exist# ./figs/some_script_fig1.png, ./figs/some_script_fig2.png, ...Specify a different prefix to the base stem format:savefigs(stem_prefix="run1")# ./run1_fig1.png, ./run1_fig2.png, ...Save in multiple file formats:savefigs(formats=["png","pdf"])# ./some_script_fig1.png, ./some_script_fig1.pdf, ...Avoid overwriting files:savefigs(clobber=False,noclobber_method="add_num")# ./some_script_fig3.png (assuming ./some_script_fig{1,2}.png already exist)👆 By default (without changingnoclobber_method), settingclobber=Falsewill instead error.BackgroundWhen writing a script that creates multiple figures, I usually label them (usually using thenumargument toplt.figure()/plt.subplots()), which makes it easier to find the correct figure window. Then, at the end of the script I write a loop like:fornuminplt.get_fignums():fig=plt.figure(num)fig.savefig(f"{fig.get_label()}.pdf",...)# Maybe another format...savefigs()essentially does this, but is more robust and provides additional features through keyword arguments. And it saves having to write those lines in the script, instead allowing the simple one-liner:fromsavefigsimportsavefigs;savefigs()
Package: save_ipython_variables
Save IPython Variables======================You use IPython.  It's pretty great.  But things happen!  Your computercrashes, your IPython shell crashes (in theory), your computer runs out ofmemory and the process becomes unreachable.  You can lose your whole session,and potentially hours of work.Sure, you can work out of a file, using `%edit` to keep your code on disk, butthe variables that can take hours to build up -- whether it's through queryingdatabases, scraping the web, or executing long-running algorithms -- can justvanish.This is where this module comes into play: `save-ipython-variables` lets you dojust that -- save your global IPython variables to disk easily, and load themback into the global namespace when you need them again, even in a whole newIPython session.Example Usage-------------```pythonIn [1]: from save_ipython_variables import load_all_variables, save_variableIn [2]: data = build_data_dictionary_from_db()In [3]: save_variable('data', data)In [4]: save_variable('number', 5)In [5]: exit()```And now, in a new session:```pythonIn [1]: from save_ipython_variables import load_all_variables, save_variableIn [2]: load_all_variables()Loaded the following variables: ['data', 'number']In [3]: if data:...:     print 'Loaded Successfully!'Loaded Successfully!```You can also choose to load select variables:```pythonIn [1]: from save_ipython_variables import load_all_variables, save_variableIn [2]: load_all_variables(['number'])Loaded the following variables: ['number']In [3]: numberOut[3]: 5In [3]: data---------------------------------------------------------------------------NameError                                 Traceback (most recent call last)<ipython-input-8-2cd6ee2c70b0> in <module>()----> 1 dataNameError: name 'data' is not defined```As you can see, `number` was successfully loaded, but `data` was ignored.Details-------Each variable is saved to disk in the current directory as`<variable_name>.pkl`.  Variable names are also added to the set`saved_var_names`, which is saved to disk like all other variables.Variables are loaded into scope by adding them to the `__builtins__`dictionary.
Package: save-load-vars
Save and load vars, functions, objects ...How to save the global vars (or any other variable)# Create a fileimportpandasaspdfromsave_load_varsimportsave_vars_pkldf=pd.read_csv("https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv")defmyfunction(x):returnstr(x)+"bbbb"myfunction2=lambdak:myfunction(k)partofframe=df.Name.copy()[:50]# Save the global varssave_vars_pkl(g=globals(),folder=f"f:\\pklsavetest",interface="dill",protocol=None)How to load the saved datafromsave_load_varsimportload_vars_pklload_vars_pkl(folder=f'f:\\pklsavetest',name=__name__,interface='dill')print(df)print(myfunction(44))print(partofframe)print(df.Cabin.apply(myfunction2))How to create global variables from a dictfromsave_load_varsimportglobals_from_dictdidi={'a':'bobo','b':'bobao','c':[4,3,3]}globals_from_dict(didi,__name__)print(a)print(b)print(c)
Package: savepoint
A context manager that creates savepoints, avoiding recalculating expensive
parts of the code.An example:fromsavepointimportSavePointa=10b=20# do some expensive calculation herewithSavePoint("stuff.p"):print"doing stuff"a+=10c=30printa,b,cThe first time the code is ran thewithblock is executed, and the modifed
scope is pickled tostuff.p. Subsequent calls will update the global scope
from the pickle file, and skip the block completely.
Package: savescreen
SavescreenTo take and save screenshot.Installationpip install -U savescreenUsageusage: savescreen [options]

optional arguments:
  -h, --help       show this help message and exit
  -v, --version    show version number and exit

to take screenshot:
  -n , --name      name to screenshot
  -p , --path      path to save screenshot (default : path)
  -f , --format    image format to save screenshot (default : png)
  -t , --timeout   timeout period before taking screenshot in secs (default : 5s)
  -d , --display   to display the screenshot (default : False)Python ScriptTo encrypt/decrypt message using rsa.fromsavescreenimportScreenshotscreenshot=Screenshot(name='shot',img_format='png')screenshot.take()# to take screenshotscreenshot.save()# to save the screenshotscreenshot.display()# to display screenshotCommand LineTo take and save screenshot in png format.$ savescreen --name shot --format png
Screenshot saved in '.../shot.png'.To take and save screenshot after 30 secs.$ savescreen --name shot --format png --timeout 30
Screenshot saved in '.../shot.png'.Issues:If you encounter any problems, please file anissuealong with a detailed description.
Package: save-skype
# save_skypeExtract chats from Skype main.db and save them as text filesPython 3 only## Installation`pip3 install save_skype`Or- Pull the repo- Install dependencies w/ pip`pip3 install -r requirements.txt && python3 setup.py`## Usage- Get the path of your main.db`~/.Skype/USERNAME/main.db````alex@mba:/media/alex/Downloads/save_skype$ save_skype --helpUsage: save_skype [OPTIONS] FILEOptions:-s, --save TEXT  Path to save chats--help           Show this message and exit.alex@mba:/media/alex/Downloads/save_skype$ save_skype ~/.Skype/MY_USERNAME/main.dbchat_896_other1_me.txtchat_1536_me_other2.txtchat_901_me_other3.txtchat_2057_me_other4.txt...Files saved to .```## LicenseSee `LICENSE`