Saravanan666/pypi-org huggingface dataset:
Package: sag-py-cache-decorator
sag_py_cache_decoratorA cache annotation that can be used to cache calls to a methodWhat it doesCaches calls to methods if the same parameters are usedRemoves the least recently used cache item if a optional maximum is reachedSupports sync and async functionsPossibility to skip the cache by parameterPossibility to clear the cache entirely or for one set of parametersInstallationpip install sag-py-cache-decoratorHow to usefromsag_py_cache_decorator.lru_cacheimportlru_cache@lru_cache(maxsize=3)defmy_function(str:str,str2:str)->str:returnf"{str}-{str2}"This is the regular use case of the cache.Available decorator arguments:ArgumentDescriptionDefaultmaxsizeIf this size is reached, the least recently used cache item will be removed. Can be set to None to have a unlimited cache.128fromsag_py_cache_decorator.lru_cacheimportlru_cache@lru_cache(maxsize=3)defmy_function(str:str,lru_clear_cache:bool=False,)->str:returnf"{str}-{str2}"my_function("one")my_function("two")# Before executing the next function the cache is cleared and then# rebuilt with the results of three and four because of lru_clear_cache = Truemy_function("three",lru_clear_cache=True)my_function("four")Available function arguments:ArgumentDescriptionDefaultlru_use_cacheIf set to false, the function call skips the cache. Existing cached items are ignored and new ones are not written for that call.Truelru_clear_cacheIf set to true, the cache is cleared entirely before executing the method. The result of the call is then cached again.Falselru_clear_arg_cacheIf set to true, the result for this set of parameters is removed from cache(if present). The result of the call is then cached again.FalseHow to start developingWith vscodeJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.With pycharmInstall latest pycharmInstall pycharm plugin BlackConnectInstall pycharm plugin MypyConfigure the python interpreter/venvpip install requirements-dev.txtpip install black[d]Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed filesCtl+Alt+S => Check Tools => BlackConnect => Trigger on code reformatCtl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)Ctl+Alt+S => Click Tools => Actions on save => Reformat codeRestart pycharmHow to publishUpdate the version in setup.py and commit your changeCreate a tag with the same version numberLet github do the rest
Package: sag-py-execution-time-decorator
sag_py_execution_time_decoratorA decorator for methods to log the execution time (sync and async)What it doesLogs the execution time in millisecondsSample log entry:decorated_sync_method took 1000 ms.The entry contains "function_name" and "execution_time" as extra data.Installationpip install sag-py-execution-time-decoratorHow to useDecorate your methods like that:fromsag_py_execution_time_decorator.execution_time_decoratorimportlog_execution_time@log_execution_time()defdecorated_sync_method(param:str)->str:time.sleep(SLEEP_TIME_MS/1000)returnf"test:{param}"@log_execution_time(log_level=logging.ERROR,log_params=("param",))asyncdefdecorated_async_method(param:str)->str:awaitasyncio.sleep(SLEEP_TIME_MS/1000)returnf"test:{param}"Optional arguments:ArgumentDescriptionDefaultlog_levelThe log level integar. Use logging.* constantslogging.INFOlogger_nameThe name of the logger that is internally used for logging.getLoggerexecution_time_decoratorlog_paramsA tuple of parameter names to be logged with their values in 'extra'()How to start developingWith vscodeJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.With pycharmInstall latest pycharmInstall pycharm plugin BlackConnectInstall pycharm plugin MypyConfigure the python interpreter/venvpip install requirements-dev.txtpip install black[d]Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed filesCtl+Alt+S => Check Tools => BlackConnect => Trigger on code reformatCtl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)Ctl+Alt+S => Click Tools => Actions on save => Reformat codeRestart pycharmHow to publishUpdate the version in setup.py and commit your changeCreate a tag with the same version numberLet github do the rest
Package: sag-py-fastapi-health
sag_py_fastapi_healthAdd health check endpoints to fastapi (similar to the ones dotnet core has)What it doesAdds one or multiple health endpointConfigurable output format (json or prtg)Possibility to add checks (own and pre shipped)Pre-Shipped tests for http get requests including basic auth and directory existence/readability/writabilityInstallationpip install sag-py-fastapi-healthHow to useSample usage with existing checksfromsag_py_fastapi_health.checks.httpimportHttpCheckfromsag_py_fastapi_health.checks.storageimportStorageExistsCheck,StorageReadableCheckfromsag_py_fastapi_health.formatterimportDefaultResponseFormatter,PrtgResponseFormatterfromsag_py_fastapi_health.modelsimportProbefromsag_py_fastapi_health.routerimportHealthcheckRouterfromconfigimportconfigrouter=HealthcheckRouter(Probe(name="health",response_formatter=DefaultResponseFormatter(),checks=[StorageExistsCheck("/opt/app/data",name="my_dir_exists"),StorageReadableCheck("/opt/app/data",name="my_dir_is_readable"),HttpCheck("https://localhost/auth",name="auth_available",timeout=5),],),Probe(name="health-prtg",response_formatter=PrtgResponseFormatter(),checks=[StorageExistsCheck("/opt/app/data",name="my_dir_exists"),StorageReadableCheck("/opt/app/data",name="my_dir_is_readable"),HttpCheck("https://localhost/auth",name="auth_available",timeout=5),],),)Write your own checkfromsag_py_fastapi_health.modelsimportCheckResultclassTestCheck(Check):def__init__(self,name:str="check")->None:self._name:str=nameasyncdef__call__(self)->CheckResult:is_healthy:bool=a_custom_check()description:str="A description of the status or a error message"returnCheckResult(name=self._name,status="Healthy"ifis_healthyelse"Unhealthy",description=description,)The description contains something like "Directory ... was accessable" or "Service is running" if everything is ok.
If there was an error, you can add the error message/exception message there.How to configure in prtguse the sensor "HTTP data advanced" (https://www.paessler.com/manuals/prtg/http_data_advanced_sensor) and configure to your prtg health endpoint (like in the example above ([URL_TO_YOUR_SERVICE]/health/health-prtg)How to start developingWith vscodeJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.With pycharmInstall latest pycharmInstall pycharm plugin BlackConnectInstall pycharm plugin MypyConfigure the python interpreter/venvpip install requirements-dev.txtpip install black[d]Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed filesCtl+Alt+S => Check Tools => BlackConnect => Trigger on code reformatCtl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)Ctl+Alt+S => Click Tools => Actions on save => Reformat codeRestart pycharmHow to publishUpdate the version in setup.py and commit your changeCreate a tag with the same version numberLet github do the rest
Package: sag-py-fastapi-request-id
sag_py_fastapi_request_idThis library provides a way to identify all log entries that belong to a single request.What it doesProvides a middleware to generate a random request id for every requestContains a logging filter that adds the request id as field to every log entryHow to useInstallationpip install sag-py-fastapi-request-idAdd the middlewareAdd this middleware so that the request ids are generated:fromsag_py_fastapi_request_id.request_context_middlewareimportRequestContextMiddlewarefromfastapiimportFastAPIapp=FastAPI(...)app.add_middleware(RequestContextMiddleware)Get the request idThe request id can be accessed over the contextfromsag_py_fastapi_request_id.request_contextimportget_request_idasget_request_id_from_contextrequest_id=get_request_id_from_context()This works in async calls but not in sub threads (without additional changes).See:https://docs.python.org/3/library/contextvars.htmlhttps://kobybass.medium.com/python-contextvars-and-multithreading-faa33dbe953dAdd request id field to loggingIt is possible to log the request id by adding a filter.importloggingfromsag_py_fastapi_request_id.request_context_logging_filterimportRequestContextLoggingFilterconsole_handler=logging.StreamHandler(sys.stdout)console_handler.addFilter(RequestContextLoggingFilter())The filter adds the field request_id if it has a value in the context.How to start developingWith vscodeJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.With pycharmInstall latest pycharmInstall pycharm plugin BlackConnectInstall pycharm plugin MypyConfigure the python interpreter/venvpip install requirements-dev.txtpip install black[d]Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed filesCtl+Alt+S => Check Tools => BlackConnect => Trigger on code reformatCtl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)Ctl+Alt+S => Click Tools => Actions on save => Reformat codeRestart pycharmHow to publishUpdate the version in setup.py and commit your changeCreate a tag with the same version numberLet github do the rest
Package: sag-py-logging-logstash
sag_py_logging_logstashPython Logstash Async is an asynchronous Python logging handler to submit
log events to a remote Logstash instance.
It based on  open source library, see the documentationhttp://python-logstash-async.readthedocs.io/en/latest/.
In this version transporter is limited to HTTPTransport, according to  Logstash intern installation requirements.Unlike most other Python Logstash logging handlers, this package works asynchronously
by collecting log events from Python's logging subsystem and then transmitting the
collected events in a separate worker thread to Logstash.
This way, the main application (or thread) where the log event occurred, doesn't need to
wait until the submission to the remote Logstash instance succeeded.This is especially useful for applications like websites or web services or any kind of
request serving API where response times matter.UsageExample::from logstash_async.handler import AsynchronousLogstashHandler
from logstash_async.formatter import LogstashFormatter
import logging

logstash_handler = AsynchronousLogstashHandler(
    host='my_host',
    port=123,
    username='my_user',
    password='my_password',
    index_name = 'my_index')
logstash_formatter = LogstashFormatter( extra_prefix='',
extra={'customer': "name", 'ap_environment': "local"})
logstash_handler.setFormatter(logstash_formatter)

logging_handlers = []
logging_handlers.append(logstash_handler)

logging.basicConfig(
level="INFO",
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=logging_handlers)

logging.getLogger().info("Logging Message", extra = {'new_field':"value"})Installationpip install sag-py-logging-logstashHow to start developingWith vscodeJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.With pycharmInstall latest pycharmInstall pycharm plugin BlackConnectConfigure the python interpreter/venvpip install requirements-dev.txtpip install black[d]Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed filesCtl+Alt+S => Check Tools => BlackConnect => Trigger on code reformatCtl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)Ctl+Alt+S => Click Tools => Actions on save => Reformat codeRestart pycharmHow to publishUpdate the version in setup.py and commit your changeCreate a tag with the same version numberLet github do the rest
Package: sahara
OpenStack Data Processing (“Sahara”) projectSahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/935Sahara docs site:https://docs.openstack.org/sahara/latest/Roadmap:https://wiki.openstack.org/wiki/Sahara/RoadmapQuickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/saharaBugs and feature requests:https://storyboard.openstack.org/#!/project/935Release notes:https://docs.openstack.org/releasenotes/sahara/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-dashboard
OpenStack Dashboard plugin for Sahara projectHow to use with Horizon on server:Use pip to install the package on the server running Horizon. Then either copy
or link the files in sahara_dashboard/enabled to
openstack_dashboard/local/enabled. This step will cause the Horizon service to
pick up the Sahara plugin when it starts.How to use with devstack:Add the following to your devstacklocal.conffile:enable_plugin sahara-dashboard https://opendev.org/openstack/sahara-dashboardTo run unit tests:./run_tests.shNOTE:As of the Mitaka release, the dashboard for sahara is now maintained
outside of the horizon codebase, in the repository.Links:Sahara project:https://opendev.org/openstack/saharaStoryboard project:https://storyboard.openstack.org/#!/project/936Sahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlRelease notes:https://docs.openstack.org/releasenotes/sahara-dashboard/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-extra
OpenStack Data Processing (“Sahara”) extra repoSahara-extra is place for Sahara components not included into the mainSahara repositoryHere is the list of components:Sources for Swift filesystem implementation for Hadoop:https://opendev.org/openstack/sahara-extra/src/branch/master/hadoop-swiftfs/README.rstSources for main function wrapper that adapt for oozie:https://opendev.org/openstack/sahara-extra/src/branch/master/edp-adapt-for-oozie/README.rstSources for main function wrapper that adapt for spark:https://opendev.org/openstack/sahara-extra/src/branch/master/edp-adapt-for-spark/README.rstDiskimage-builderelements moved to the new repo:https://opendev.org/openstack/sahara-image-elementsTools for building artifacts:https://opendev.org/openstack/sahara-extra/src/branch/master/tools
Package: sahara-plugin-ambari
OpenStack Data Processing (“Sahara”) Ambari PluginOpenStack Sahara Ambari Plugin provides the users the option to
start Ambari clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
Ambari Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-ambariSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-ambariBugs and feature requests:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-ambariRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-ambari/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-plugin-cdh
OpenStack Data Processing (“Sahara”) CDH PluginOpenStack Sahara CDH Plugin provides the users the option to
start CDH clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
CDH Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-cdhSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-cdhBugs and feature requests:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-cdhRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-cdhLicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-plugin-mapr
OpenStack Data Processing (“Sahara”) MapR pluginOpenStack Sahara MapR Plugin provides the users the option to
start MapR clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
MapR Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-maprSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-maprBugs and feature requests:https://storyboard.openstack.org/#!/openstack/sahara-plugin-maprRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-mapr/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-plugin-spark
OpenStack Data Processing (“Sahara”) Spark PluginOpenStack Sahara Spark Plugin provides the users the option to
start Spark clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
Spark Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-sparkSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-sparkBugs and feature requests:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-sparkRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-spark/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-plugin-storm
OpenStack Data Processing (“Sahara”) Storm PluginOpenStack Sahara Storm Plugin provides the users the option to
start Storm clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
Storm Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-stormSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-stormBugs and feature requests:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-stormRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-storm/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahara-plugin-vanilla
OpenStack Data Processing (“Sahara”) Vanilla PluginOpenStack Sahara Vanilla Plugin provides the users the option to
start Vanilla clusters on OpenStack Sahara.
Check out OpenStack Sahara documentation to see how to deploy the
Vanilla Plugin.Sahara at wiki.openstack.org:https://wiki.openstack.org/wiki/SaharaStoryboard project:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-vanillaSahara docs site:https://docs.openstack.org/sahara/latest/Quickstart guide:https://docs.openstack.org/sahara/latest/user/quickstart.htmlHow to participate:https://docs.openstack.org/sahara/latest/contributor/how-to-participate.htmlSource:https://opendev.org/openstack/sahara-plugin-vanillaBugs and feature requests:https://storyboard.openstack.org/#!/project/openstack/sahara-plugin-vanillaRelease notes:https://docs.openstack.org/releasenotes/sahara-plugin-vanilla/LicenseApache License Version 2.0http://www.apache.org/licenses/LICENSE-2.0
Package: sahayakAI
# SahayakAI
Using AI to solve some of the India specific problems## Design
You can see the high level design in this [Miro Board](https://miro.com/app/board/uXjVM61FLNk=/?share_link_id=389475655874)## Demo
<img src=”demo.gif” width=”350” height=”400”/>## InstallationStep 1:Create a python virtual environment. We recommend using eitheranacondaorvenv.Create and activate virtual environment using anaconda:` conda create--namesahayakAI python=3.10 conda activate sahayakAI `Create and activate virtual environment using venv:` virtualenv-p<path/to.python> <your_env_name> source<your_env_name>/bin/activate`Step 2:After creating and activating the virtual environment, we need to install all the dependencies:` pip install-rrequirements.txt `## UsageStep 1:Create a telegram botStep 2:Set theTELEGRAM_BOT_TOKENas an environment variable or insidesahayak/common/config.yamlStep 3:Set yourOPENAI_API_KEYas an environment variable or insidesahayak/common/config.yamlStep 4:Set yourRAPID_API_KEYas an environment variable or insidesahayak/rahiAI/config.yamlStep 5:Run the telegram bot using the below command:` python bot.py `## TODO Tasks
- Update README
- Add unit tests
- Integrate Langchain and deprecate Simpleaichat
- Proper error/exception handling## Key Contributors
-Abhijeet Dubey-Abhishek Bagade-Nithin Sethumadhavan-Vineet Singh## References
1.https://github.com/minimaxir/simpleaichat
Package: saheffects
saheffectssaheffects  is a Python package for applying various image filters to images.Free software: MIT licenseDocumentation:https://saheffects.readthedocs.io.FeaturesTODOCreditsSahSofts <sahsofts97@gmail.com>OpenCv   <https://opencv.org/>saheffectsHistory0.1.0 (2023-04-29)First release on PyPI.
Package: sahir_py_std
=============================sahir py std=============================sahir py std is a test package just to see how we create a distribution for python.Installation=============================Github without clonepip install git+ssh://github.ubc.ca/smoosvi/sahir_py_std.gitGithub clonepip install ./dist/sahir_py_std-0.1dev.tar.gzPypipip install sahir_py_stdUsage of `standard_deviation`=============================```from sahirPyStd import standard_deviation as s_ds_d.standard_deviation([0,1,2])# 0.816496580927726```Usage of `standard_error`=============================```from sahirPyStd import standard_error as s_es_e.standard_error([1,2,3])# 0.47140452079103173```
Package: sahkon-hinta
sahkon-hintaA simple CLI tool to fetch the current electricity price in Finland, using the data fromsahko.tk.The program usesPlaywrightto spin up a headless browser and fetch the data from the website. The data is then parsed and printed to the console in a nice format.Done as a part of a Cloud Services course at the Oulu University of Applied Sciences.This was a fun learning experience, as I had never used Playwright before nor published a package to PyPI.InstallationJust install the package from PyPI:python3-mpipinstallsahkon-hintaExample output$sahkon-hinta>                 Sähkön hinta (snt/kWh) 24% alv> Nyt   Päivän alin  Päivän ylin  7pv keskihinta  28pv keskihinta> 6.96     5.27         11.76          5.80            6.46>                         Lähde: sahko.tk