Saravanan666/pypi-org huggingface dataset:
Package: applib
applibapplib is a set of cross-platform application utilities that originated in
thePyPMproject at ActiveState. It contains the following modules:sh: shell related operations including compression routinestextui: utilities for textual UI such as progress bar and column
printinglog: log file rolling, exception-and-verbosity, sub commands, etc.If you’re interested in this module, please let me know - as that may motivate
me to document it fully.News1.2Release date: 19-March-2011sh.rm: ensure that only symlinks are deleted (not the entire dir)sh.rm: remove symlinks as well (PyPM Bug #89540)#12: sh.RunError now handles non-ascii stdout/stderrsh.RunError now strips long stdout/stderr messagesapplib.misc.safe_unicode: error-free unicode strings!1.1.0Release date: 20-December-2010applib now depends on  appdirs and six#1: Deprecate applib.base.Locations and applib.locations in favour of
‘appdirs’#3: sh.unpack now ensures single top-level directory#4: Stop usingunicode(py3k); applib now depends on thesixpackage#5: Stop usingraw_input(py3k)#6: Progress Bar prints delay with proper precision on py3ktextui: Progress Bar shows ETA#8: progressbar prints floats as delay on py3ktextui: ProgressBar.iterate clean-ups output if there is an exception/breaktextui: ProgressBar.iterate(post=’…’) to print post message after progresscompression: Workaround zipfile bug with long paths on Windows (issue10447)proc: makesh.runacceptcmdas a list of arguments_simpledb: force PickeType to use protocol 2.PyPM Bug #88882textui: Makecolprintnot prune columns when stdout is not a terminal1.0.1Release date: 23-July-2010applib.log: support for specifying the default verbosity level1.0.0Release date: 29-Jun-2010bb #1: Broken pipe error when breakingless1.0.0c10Release date: 27-May-2010More Python3 related fixes1.0.0c9Release date: 25-May-2010FixedUnboundLocalErrorwith ‘sys’ in _cmdln.py#L11901.0.0c8Release date: 28-Apr-2010Fixedsys.exc_inforelated Python3 port1.0.0c7Release date: 28-Apr-2010Updated applib._cmdln with cmdln:^/branches/cfg1.0.0c6Release date: 28-Apr-2010Fixed more modules supporting Python 31.0.0c5Release date: 28-Apr-2010Python 3 support1.0.0c4Release date: 13-Apr-2010Fix a NameError with _proc.RunTimedout1.0.0c3Release date: 30-Mar-2010Fix: require_option was throwing Exception with empty message1.0.0c2Release date: 19-Mar-2010Add applib.textui:askyesno
Package: applicability-domain
Applicability DomainHow to use.See example for details.
Now, I' ll show you some easy example.fromapplicability_domainimportApplicabilityDomainDetectorfromsklearn.model_selectionimporttrain_test_splitX_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=SEED)ad=ApplicabilityDomainDetector(k=5,alpha=0.9)ad.fit(X_train)X_test_inlier=ad.transform(X_test)ReferencesSiteshttps://datachemeng.com/applicabilitydomain/LICENSECopyright © 2021 yu9824Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: applicable
applicable.pyapplicable.py is a very basic package with a single function:applicable(). It is simply used to test if a callable can be called with a set of arguments without raising an error.This package must be used with Python 3.6 or higher.The signature ofapplicable()is:applicable(callable: Callable,
           *args: Any,
           **kwargs: Any,
           ret_result: bool = True,
           ret_exc: bool = True) -> Any*Note:This is not the actual signature, as you can probably tell. The actual signature (and the one type checkers and other tools will give you) isapplicable(callable: Callable, *args: Any, **kwargs: Any). As noted in the docstring (applicable.__doc__),ret_resultandret_excare special keyword arguments, and it would be preferred that they be used after the callable arguments.Arguments:callable: The callable to be testedret_result: Whether to returncallable(*args, **kwargs)upon no error.Trueby default. If false,applicable()will returnTrueupon no error.ret_exc: Type or value to return upon error. Defaults to_FalseException. With the exception of_FalseException(which is returned as_FalseException(exception_instance)), the default value for the type is returned, e.g.,int()(which is0),bool()(False),Noneifret_excis a type. Ifret_excis a value, the value is returned.Changed in version 1.1.0:ret_excwas previously a boolean value specifying whether to return a_FalseExceptionor not.argsandkwargs: The arguments that are passed tocallable().This function will usually be used in anifstatement like the following:from applicable import applicable

val = applicable(SomeCallable, 'arg!', a_kwarg='kwarg!')
if val == False or isinstance(val, _FalseException):
    # Do somthing with val
else:
    # Do something with the exception; use val.cls for the exception classMore examples, to show the full functionality ofapplicable()(and_FalseException):>>> from applicable import applicable
>>> a = applicable(int, '4')
>>> a
4
>>>
>>> a = applicable(int, 'whoops')
>>> a
applicable._FalseException(exc_inst=ValueError(...))
>>> a.cls
<class 'ValueError'>
>>> a.inst
ValueError("invalid literal for int() with base 10: 'whoops'")
>>> bool(a)
False
>>>
>>> a = applicable(complex, 4, imag=3)
>>> a
(4+3j)
>>>
>>> a = applicable(complex, 4, imag=3, ret_result=False)
>>> a
True
>>> a = applicable(int, 'whoops', ret_exc=bool)
>>> a
False
>>> applicable(int, 'whoops', ret_exc=None)
None
>>> applicable(int, 'whoops', ret_exc=4)
4
Package: application-builder
Application BuilderThe goal of application builder is to have a single object that connectssettingsand the current applicationenvironmentin one place. This object can then be used throughout your python application,
as a central spot for checking which environment the application is running under and for gettings settings accordingly.Usage Examplefromapplication_builder.applicationimportApplication# our settings class must support 2 functions `load()` and `settings()`.classMySettingsManager:def__init__(self,env,app_root):self._env=envself._root=app_rootdefload(self):# json/yaml/python files could be loaded hereself._data={'test':{'db':'localhost'},'dev':{'db':'some.server.com'}}defsettings(self):returnself._datadefsettings_init_fn(env:str,app_root:str):sm=MySettingsManager(env,app_root)returnsm# Let's assume MYAPP_ENV='dev'myapp=Application(name='myapp',app_env_varname:'MYAPP_ENV',app_root_dir:'/path/to/myapp',# sometimes you might need to do a lot more# than just instantiate a class, that's why you need to pass a functionsettings_class_init_fn:settings_init_fn)myapp.add_path('settings','config/settings')myapp.add_path('data','data')myapp.boot()myapp.current_environment()# 'dev'myapp.settings()# { 'db' : 'some.server.com' }myapp.paths('root')# /path/to/myappmyapp.paths('settings')# /path/to/myapp/config/settingsmyapp.paths('data')# /path/to/myapp/data
Package: applicationinsights-starlette
Azure's Application insights for StarletteThis is a small module to use Azure's Application insights on aStarletteapplication.How to use:from starlette.applications import Starlette
from starlette.middleware.base import BaseHTTPMiddleware

app = Starlette()

from .appinsight import AppInsights
insights = AppInsights('<instrumentation_key>')

app.add_exception_handler(Exception, insights.exception_handler)

app.add_middleware(BaseHTTPMiddleware, dispatch=insights.request_middleware)
app.add_middleware(BaseHTTPMiddleware, dispatch=insights.flush_middleware)

# or any variation of how you log in your app
logging.getLogger(__name__).addHandler(insights.log_handler)


@app.route('/')
async def homepage(request):
    return JSONResponse({'hello': 'world'})

if __name__ == '__main__':
    uvicorn.run(app, host='0.0.0.0', port=8000)At this point, any request, log message or exception will be pushed to Azure's application insights.
Package: application-model
application_modelGenerate application score for new customers.DocumentationInstallationPyPI Package$pipinstallapplication_modelHow to useapplication_modelcan be used to generate application score as follows:importjsonfromapplication_model.application_modelimportgenerate_application_scorepayload={"ume-profession":"COSTUREIRA","ume-zipcode":69059192.0,"ume-age_on_application":63.0,"ume-segment":"Móveis","ume-retailer":"apa-moveis","ume-city":"MANAUS","ume-state":"AMAZONAS","bvsIncome-CLASSRENDAV2":6.0,"bvsIncome-RendaPresumida":1700.0,"bvsP5-Score":0.3009,"bvsSubP5-Fintechs":0.4499,"bvsSubP5-CartaoCredito":0.3950,"bvsSubP5-CreditoPessoal":0.4589,"bvsSubP5-VAR_MoveisEletrodomesticos":0.3379,"bvsSubP5-VAR_VestuarioAcessorios":0.2430,"bvsSubP5-FinancialmentoVeiculos":0.4199}payload_json=json.loads(payload)score=generate_application_score(payload_json)Data sourceOrigin of Ume's attributes{'ume-profession':'modelo de profissao da ume coletada no application','ume-zipcode':'zipcode no formato numerico','ume-age_on_application':'idade calculada com base na data do application','ume-segment':'coluna name extraida da tabela prd-ume-data.prd_datastore_public.retailer_categories','ume-retailer':'coluna name extraida da tabela prd-ume-data.prd_datastore_public.retailers','ume-city':'nome completo da cidade em caixa alta (MANAUS)','ume-state':'nome completo do estado em caixa alta (AMAZONAS, PARÁ, RORAIMA, ACRE, RONDÔNIA, BAHIA)',}Origin of Bvs's attributes{'bvsIncome-CLASSRENDAV2':'CLASSRENDAV2','bvsIncome-RendaPresumida':'RNDRPRPNMMESPFLGBREGV2','bvsP5-Score':'SCRCRDPNM06MPFLGBCLFALLV5','bvsSubP5-Fintechs':'SCRCRDPNM06MPFLGBCLFBCDV2','bvsSubP5-CartaoCredito':'SCRCRDPNMCCRPFLGBCLFBVSV3','bvsSubP5-CreditoPessoal':'SCRCRDPNMCRPPFLGBCLFBVSV3','bvsSubP5-VAR_MoveisEletrodomesticos':'SCRCRDPNMVARPFLGBCLFBVSV3','bvsSubP5-VAR_VestuarioAcessorios':'SCRCRDPNMVARPFLGBCLFBVSV2','bvsSubP5-FinancialmentoVeiculos':'SCRCRDPNMVEIPFLGBCLFBVSV3',}Licenseapplication_modelwas created by Wesllen Sousa Lima in Ume corporation. It is licensed under the terms of the Proprietary license.Creditsapplication_modelwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: application-profiles
Application-ProfilesThis project brings (at least partially) the ability of providingproperties fileslike Spring Framework but now in whatever Python context.How to use itpipinstallapplication-profilesImportfromapplication_profilesimportApplicationProfiles...profiles=ApplicationProfiles()...a_prop:ApplicationProfiles=profiles.properties['a_prop']Select the desired profile(s) by using Environment VariableOne profileexportAPP_PROFILES=devList of profileexportAPP_PROFILES=dev,red,southSelect the desired profile(s) by constructor argumentOne profileprofiles=ApplicationProfiles(profiles="dev")List of profileprofiles=ApplicationProfiles(profiles="dev,red,south")How it work?'profiles' Python moduleBefore moving on, there are several requirements to accomplish, the first one is having in the root of your project a module calledprofiles, where your properties files will be placed.
Like thisprofiles/__init__.pyapplication.yamlapplication-dev.yaml...Properties FilesInside theprofilesmodule, you must place all the properties files to be included in your project. There is a convention required to name them, like in Spring, the prefix of all the files must beapplicationfollowed by the name of the desired profile, like for exampledev,testetc., joined by a hyphen-, here you go a list of common examplesapplication-dev.yamlapplication-prod.yamlapplication-int.yamlImportantThe default profile isapplication.yaml(without a profile name), this file is optional but it is consedered the"default"profile.Load PrecedenceThis is something crucial for the library, there is a precedence in how the files are loaded.
The profiles files are loaded in the following order:1.-defaultprofile.2.- All the profiles in the provided order by theprofileconstructor argument.3.- All the profiles in the provided order by theAPP_PROFILESenvironment variable.Properties are merged in that order, then they are consumables through theApplicationProfilesobject.How the properties are merged?This point is extremely important, because there are a couple of restrictions in how this library worksLists: if there is a variable in more than one profile that contains a list, it is replaced entirely with the corresponding value.Dictionaries: all dictionaries are scanned in deep replacing coincidences for native raw data types like numbers, strings, booleans. It includes nested dictionaries.Run it in localThis project usesPoetry, in case you don't have it just runmake install-poetryCreate a local env & Install dependencies*makeinstallRun the Tests Suitemaketest
Package: application-settings
application_settings - version 0.4.0"You write the dataclasses to define parameters for configuration and settings,
application_settings takes care of the logic."What and whyApplication_settings is a package for providing a python application or library with
parameters for configuration and settings. It usestomlorjsonfiles that are parsed
into dataclasses. This brings some benefits:Minimal work for the developer of the application / libraryParameters are typed, which allows for improved static code analyses.IDEs will provide helpful hints and completion when using the parameters.More control over what happens when a file contains mistakes
(by leveraging the power ofpydantic).Possibility to specify defaults when no file is found or entries are missing, i.e.,
aim for "zeroconf".Configuration parameters are read-only (i.e., changed by editing the config file); we
recommend (and support) the use oftomlfor this, which is a human-oriented,
flexible, standardardized and not overly complex format.Settings parameters are read-write (i.e., mostly changed via the UI of the
application); we recommend (and support) usejsonfor this, an established
standardized machine-oriented format.Parsing is done once before or during first access and the resulting set of parameters is
stored as a singleton.Interested? Then have a look at ourquick startor dive into thefull documentation.If you appreciate this library package, then please give us a star onGithub.LicenseThis project is licensed under the terms of the MIT license.
Package: applied-stats
Aboutapplied_stats is a Python library that implements various statistical distributions and methods in Python. The continuous_distributions module supports plotting and calculating probabilities for normal, chi-squared, t, and F distributions, and the mle module can calculate various maximum likelihood estimators based on particular distributions. I plan to continue development of this to add new functionality and modules in the future.The project was inspired while I took MAT 561 (Probability) and MAT 562 (Mathematical Statistics) at the University of Louisville. The goal of this is to provide simple tools to work with applied statistics, while also aiding my own understanding by applying theoretical techniques learned during class.Please feel free to submit PRs or Issues if you'd like!InstallationRun the following to install the applied-stats:$ pip install applied-statsThis has been tested on Windows 10 and Ubuntu 21.04; will test on macOS soon.UsageFollow these examples to start plotting and calculating probabilities. Various examples, including the ones below, can also be found in theDemonstration Jupyter NotebookGenerate some plots and calculate some probabilities:>>>fromapplied_statsimportcontinuous_distributions>>>a=Norm_rv(0,1)>>>a.plot_pdf()>>>a.probability_calc()Note: pypi has some difficulty rendering the below plot images, they can be viewed on GitHub.>>>q=ChiSq_rv(4,crit_value=7)>>>q.plot_pdf(cv_probability=True)>>>q.probability_calc()Calculate a two-tailed Chi-Sq distribution and plot:>>>z=st.ChiSq_rv(3)>>>z.plot_pdf(left_cv=1,right_cv=7,cv_probability=True,two_tail=True)>>>z.probability_calc()Calculate the numeric MLE of several common distributions:>>>fromstats_toolsimportmle>>>a=[1,3,2,5,6,7,2,3,4,5]>>>mle.binomial(10,a)>>>0.38>>>b=[1.2,4.3,2.3,6.8,2.4,3.6]>>>mle.exponential(b)>>>3.4333333333333336A basic hypothesis test>>>data=['R','B','R','B','R','B','R','B','R','B']>>>a=gen_test(data,'H0 is that there are 5 red marbles in a bag')>>>a.run_test(n=4,counter='R',accept_left=3,accept_right=4)>>>'Do not reject H0. Count is 3'TestsRun the tests from the command line withpython test.py -v
Package: applier
applierAutomatically apply SaltStack highstate on GitHub webhooks.ConfigurationThe following environment variables can be configured:Environment VariableDefaultDescriptionDEFAULT_BRANCHmainThe branch to perform updates on, typically the default branchREDIS_HOST127.0.0.1The hostname/IP address of the Redis instanceREDIS_PORT6379The port the Redis instance is running onSECRET_TTL900How many seconds to cache secrets forWEBHOOK_SECRET_SDB_KEYgithub-webhookThe SDB secret path to read fromWEBHOOK_SECRET_SDB_BACKENDsecretsThe SDB secret backend to use
Package: applipy-healthcheck
Applipy HealthCheck Metricspip install applipy_healthcheckExposes the health status of the applipy application through an HTTP endpoint with path/health.UsageAdd theapplipy_healthcheck.HealthCheckModuleto your application. Optionally,
define through which http server to expose the/healthendpoint, if no name
is given it defaults to the anonymous server:# dev.yamlapp:name:demomodules:-applipy_healthcheck.HealthCheckModulehttp.servers:-name:internalhost:0.0.0.0port:8080healthcheck.server_name:internalTo run this test just installapplipy_healthcheckandpyyamland run the applipy application:pipinstallapplipy_healthcheckpyyaml
python-mapplipyYou can now queryhttp://0.0.0.0:8080/healthand you should seeOKbeing returned.Custom health checksapplipy_healthcheckexposes theHealthCheckerinterface. You can implement
your own and the health check endpoint will use it to determine the health of
the system.ExampleFull healthcheck module configAll keys and their default values:healthcheck:server_name:nullverbose:falseUsage with custom HealthChecker# mymodule.pyfromapplipyimportModulefromapplipy_healthcheckimportHealthCheckerclassMyHealthChecker(HealthChecker):asyncdefcheck(self):is_healthy=Truestatus_message='All OK'returnis_healthy,status_messageclassMyModule(Module):defconfigure(self,bind,register):bind(HealthChecker,MyHealthChecker)@classmethoddefdepends_on(cls):returnHealthCheckModule,# dev.yamlapp:name:testmodules:[mymodule.MyModule]http.servers:-host:0.0.0.0port:8080
Package: applipy-newrelic
Applipy New Relicpip install applipy_newrelicSend logs and metrics to New Relic.UsageMinimal applipy application definition using the New Relic module.# dev.yamlapp:name:demomodules:-applipy_newrelic.NewRelicModulenewrelic:license:XXX# requiredlogs:enabled:truehost:nullport:443metrics:enabled:truehost:nullport:443report_interval:60# in secondscommon_tags:{}Values in the example above are the default ones.
Package: applipy-pg
Applipy PostgreSQLAnapplipylibrary for working with PostgreSQL.It lets you declare connections in the configuration of your application that
get turned into postgres connection pools that can be accessed by declaring the
dependency in your classes.The connection pools are created the first time they are used and closed on
application shutdown.UsageYou can define connections to databases in you application config file:# dev.yamlapp:name:demomodules:-applipy_pg.PgModulepg:connections:# Defines an anonimous db connection pool-user:usernamehost:mydb.localport:5432dbname:demopassword:$3cr37# Defines an db connection pool with name "db2"-name:db2user:usernamehost:mydb.localport:5432dbname:demopassword:$3cr37The configuration definition above defines two database connection pools. These
can be accessed through applipy's dependency injection system:fromapplipy_pgimportPgPoolclassDoSomethingOnDb:def__init__(self,pool:PgPool)->None:self._pool=poolasyncdefdo_something(self)->None:asyncwithself.pool.cursor()ascur:# cur is a aiopg.Cursorawaitcur.execute('SELECT 1')awaitcur.fetchone()fromtypingimportAnnotatedfromapplipy_injectimportnameclassDoSomethingOnDb2:def__init__(self,pool:Annotated[PgPool,name('db2')])->None:self._pool=poolasyncdefdo_something(self)->None:asyncwithself.pool.cursor()ascur:# cur is a aiopg.Cursorawaitcur.execute('SELECT 2')awaitcur.fetchone()Theaiopg.Poolinstance can be accessed using thePgPool.pool()method.Each connection pool can be further configured by setting aconfigattribute
with a dict containing the extra paramenters to be passed toaiopg.create_pool():pg:connections:-user:usernamehost:mydb.localport:5432dbname:demopassword:$3cr37config:minsize:5timeout:100.0You can also define a global configuration that will serve as a base to all
database connections defined by settingpg.global_config.pg:global_config:minsize:5timeout:100.0connections:# ...MigrationsThis library also includes a migrations functionality. How to use it:First, define your migrations:classDemoMigrationSubject_20240101(ClassNameMigration):def__init__(self,pool:PgPool)->None:self._pool=pool# Import whatever resources you needasyncdefmigrate(self)->None:# Do you migrations...asyncwithself._pool.cursor()ascur:...If you want more control over how the version and subject of the migration is
defined, you can extendMigrationand implement your own logic.Then, create your migrations module:classMyMigrationsModule(Module):defconfigure(self,bind:BindFunction,register:RegisterFunction)->None:bind(Migration,DemoMigrationSubject_20240101)@classmethoddefdepends_on(cls)->tuple[type[Module],...]:returnPgMigrationsModule,Finally, you can optionally set the name of the connection to use for the
migrations audit table. This table is used to know what migrations have been
run and which migrations should be ran:pg:connections:# Defines an db connection pool with name "db2"-name:db2# ...migrations:# sets the connection named "db2" as the connection to use for the# migrations audit tableconnection:db2