Saravanan666/pypi-org huggingface dataset:
Package: wrappedbrowser
wrappedbrowserA wrapper around thewebbrowsermodule of the standard library.Free software: MIT licenseDocumentation:https://wrappedbrowser.readthedocs.io.Featuresopening a browser window with a list of url-sCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-04-12)First release on PyPI.0.1.2 (2019-04-13)Added tox: Python 3.6, 3.70.1.3 (2019-04-13)Added Travis0.1.5 (2019-04-13)Adapted bumpversion config
Package: wrapper-rabbitmq-client
RabbitMQProducerOverviewIt is a message producer for a RabbitMQ Server.Installing AMI2RabbitMQ and Supported VersionsRabbitMQProducer is available on PyPI:$ python -m pip install wrapper-rabbitmq-clientRabbitMQProducer officially supports Python 3.8+.Cloning the repository$ git clone https://github.com/tatianno/wrapper-rabbitmq-client.gitExamplefrom wrapper_rabbitmq_client import RabbitMQProducer


RABBITMQ_SETTINGS = RABBITMQ_SETTINGS = {
    'host' : 'localhost',
    'user' : 'user',
    'password' : 'password',
    'queuename' : 'online'
}

producer = RabbitMQProducer(
    RABBITMQ_SETTINGS
)

producer.send(
    {
        'test' : 1234
    }
)
Package: wrapper-redis-client
RedisDBOverviewIt is a wrapper for a Redis Server.Installing RedisDB and Supported VersionsRedisDB is available on PyPI:$ python -m pip install wrapper-redis-clientRedisDB officially supports Python 3.8+.Cloning the repository$ git clone https://github.com/tatianno/wrapper-redis-client.gitExamplefrom wrapper_redis_client import RedisDB

# We set Online: as the default prefix for keys that will be used to persist data.
redis_db = RedisDB(key_prefix='Online:') 

# Clearing previously persisted data.
#
# Obs.: Only data persisted with the keys that have the prefix informed during the instance of the class will be erased.
redis_db.flushall()

# Persisting data with the Online:Test key
redis_db.save('Online:Test', {'test': 1234})

# Retrieving data with the Online:Test key
data = redis_db.get('Online:Test')

# Getting list of keys with prefix informed during class instance
keys_list = redis_db.get_all_keys()

# Erasing data with the Online:Test key
redis.delete('Online:Test')
Package: wrappers
wrappers provide convenient wrappers around pyquery, logging, ssl, etc.storageStorage class that extends dict to provide attribute access to keys:from wrappers.storage import Storage
d = Storage(a=1, b=2)
print d.a, d['b']sslPatches ssl.wrap_socket() to use TLSv1 instead of SSLv23 to resolve connection issues.
Details:http://stackoverflow.com/a/24166498/41957:from wrappers import sslAll modules that use the built-in ssl module (e.g. requests) will work with the new settings.pqpq.PQ() - wrapper around the pyquery.PyQuery constructor that supports mixed-case XML tags.loggerPerforms the basicConfig() setup and uses/parses LOG_LEVEL from the environment.Provides getLogger().clockProvides stopwatch-like functionality in a Clock class.
Package: wrappy
wrappyDecorators for common developer utilities in Python 3.6+.DocumentationDocumentation is built with Mkdocs and hostedhere.Quick Examples (see the docs for more detail)fromwrappyimportprobe,guard,todo,memoize@probe()defdo_some_heavy_computation(a,b,c):returna*b+c@probe(show_args=True,show_kwargs=True,show_returns=True)defsomeone_elses_code():# code that does not explain itself## show examples of args, kwargs, and return values at runtime to get some clue@probe(show_caller=5)defa_call_chain_would_be_nice():# find out with show_caller=<number_of_callers_along_the_chain>@guard(fallback_retval=0)defthis_could_blow_up(a,b):returna/b@todo('Not implemented')defi_am_not_ready():# code is under construction, so throw an error when called prematurely@guard()@memoize()defrecursive_or_dynamic_programming_subroutine(n):assertisinstance(n,int)andn>=0ifn==0:return0returnn+recursive_or_dynamic_programming_subroutine(n-1)Examples by ComparisonThis section is under construction!Release Notes
Package: wraps
wrapsMeaningful and safe wrapping types.InstallingPython 3.8 or above is required.pipInstalling the library withpipis quite simple:$pipinstallwrapsAlternatively, the library can be installed from the source:$gitclonehttps://github.com/nekitdev/wraps.git$cdwraps$python-mpipinstall.poetryYou can addwrapsas a dependency with the following command:$poetryaddwrapsOr by directly specifying it in the configuration like so:[tool.poetry.dependencies]wraps="^0.9.1"Alternatively, you can add it directly from the source:[tool.poetry.dependencies.wraps]git="https://github.com/nekitdev/wraps.git"ExamplesOptionOption[T]type represents an optional value: every option is eitherSome[T]and contains a value, orNull, and does not.Here is an example of usingwrap_optionto catch any errors:fromtypingimportList,TypeVarfromwrapsimportwrap_optionT=TypeVar("T",covariant=True)classArray(List[T]):@wrap_optiondefget(self,index:int)->T:returnself[index]array=Array([1,2,3])print(array.get(0).unwrap())# 1print(array.get(5).unwrap_or(0))# 0ResultResult[T, E]is the type used for returning and propagating errors.
It has two variants,Ok[T], representing success and containing a value,
andError[E], representing error and containing an error value.fromenumimportEnumfromwrapsimportError,Ok,ResultclassDivideError(Enum):DIVISION_BY_ZERO="division by zero"defdivide(numerator:float,denominator:float)->Result[float,DivideError]:returnOk(numerator/denominator)ifdenominatorelseError(DivideError.DIVISION_BY_ZERO)Early ReturnEarly return functionality (like thequestion-mark(?) operator in Rust) is implemented viaearlymethods
(for bothOptionandResulttypes)
combined with the@early_optionand@early_resultdecorators respectively.fromwrapsimportOption,early_option,wrap_option@wrap_option[ValueError]defparse(string:str)->float:returnfloat(string)@wrap_option[ZeroDivisionError]defdivide(numerator:float,denominator:float)->float:returnnumerator/denominator@early_optiondeffunction(x:str,y:str)->Option[float]:returndivide(parse(x).early(),parse(y).early())DecoratorsIn Python 3.9 the restrictions on the decorators' syntax have been lifted, which allows for nifty
syntax which can be seen above. On older versions of Python, one can use:fromwrapsimportwrap_option@wrap_optiondefparse(string:str)->int:returnint(string)However, this isn't the best way to handle errors, asanynormal errors will be caught, without
a way to distinguish between them.
To counter this, one can useWrapOptiondirectly,
passing the concrete error type:fromwrapsimportWrapOptionwrap_value_error=WrapOption(ValueError)@wrap_value_errordefparse(string:str)->int:returnint(string)DocumentationYou can find the documentationhere.SupportIf you need support with the library, you can send us anemailor refer to the officialDiscord server.ChangelogYou can find the changeloghere.Security PolicyYou can find the Security Policy ofwrapshere.ContributingIf you are interested in contributing towraps, make sure to take a look at theContributing Guide, as well as theCode of Conduct.Licensewrapsis licensed under the MIT License terms. SeeLicensefor details.
Package: wrap-technote
wrap_technoteCode to process groundwater and rainfall data for the annual Water Resource Assessment Program technical notes.InstallThe source code is onBitbucket, while Python packages (source and binary) are published on
thePython Package Indexand
on a dedicated channel onAnaconda Cloud.From PyPI (most recent release)Run this in Command Prompt to install from PyPI:pip install wrap_technoteTo upgrade to the latest version:pip install -U wrap_technoteFrom AnacondaYou can also install using conda/mamba if you prefer:mamba install -c dew-waterscience wrap_technoteTo upgrade:mamba upgrade -c dew-waterscience wrap_technoteThe version may not be as up-to-date as the PyPI version.From BitbucketThis is how you can install the latest version of the source code directly from Bitbucket (the version control repository):python -m pip install git+https://kinveraritysagov@bitbucket.org/dewsurfacewater/wrap_technote.gitYou will need to replacekinveraritysagovwith your Bitbucket username, and you will also need access to the source repository on the Bitbucket dewsurfacewater workspace.UsageCheck out complete documentation at:http://bunyip:8191/python-docs/wrap_technote/latest_source/index.htmlLicenseAll rights reserved DEW 2023
Package: wraptimer
wraptimerAn amazing alternative to Python's builtintimeitmodule that allows for high resolution timing of functions as well as in-depth line-by-line timing. It also exposes convenient classes to measure execution time for any arbitrary code.Sync function example# importsimporttimefromwraptimerimportTimeIt# Inittimeit=TimeIt()# decorate@timeit.bylinedeftest_by_line():a=10b=20time.sleep(0.8)c=a+breturn[a,b,c]# runtest_by_line()Async function example# ImportsimportasynciofromwraptimerimportTimeIt# Inittimeit=TimeIt()# decorate@timeit.bylineasyncdeftest_by_line_async():a=10b=20awaitasyncio.sleep(1.25)return[a,b]# runasyncio.run(test_by_line_async())Don't need Line-by-line tracing?Use@timeit.funcif you do not want to printline-by-linedurations....@timeit.funcasyncdeftest_by_line_async():a=10b=20awaitasyncio.sleep(1.25)return[a,b]Read the documentationFor more about wraptimer,Read The Documentation
Package: wraptitude
Wraptitude provides a decorator that wraps result of a function call in a call to another function.>>>fromwraptitudeimportWrapper>>>@Wrapper(dict)...deff(x):...foriinrange(x):...yieldi,i**2...>>>f(3){0:0,1:1,2:4}>>>@Wrapper(lambdax,y:x+y,4)...defg(x):...returnx*5...>>>g(2)14
Package: wraptools
Utilities for wrapping and dispatching functions.Supported Python versions:2.73.43.5pluggablepluggablewill take some decorators and simply apply it.
But applied decorators can be purged bypurge_pluggable_decorators.fromfunctoolsimportlru_cachefromwraptools.pluggableimportpluggable@pluggable(lru_cache,)defget_data():""" Some function return data from RDB or so. """purge_pluggable_decoratorsis useful on tests.fromwraptools.pluggableimportpurge_pluggable_decorators@purge_pluggable_decoratorsdeftest__get_data(self):always_flesh_data=get_data()Or it can be also used as a context manager.withpurge_pluggable_decorators():always_flesh_data=get_data()pluggabledecorator can be useful for view functions of Web Frameworks,
like Django.@pluggable(login_required,)defprofile_view(request):returnTemplateResponse(request,"profile.html")dispatchdispatchwill create function by some condition and functions.
Following example meansWhen request is authenticated,dashboardfunction will be called.Other cases,landing_pagefunction will be called.fromwraptools.dispatchimportdispatchfromwraptools.contrib.django.dispatchersimportis_authenticateddeflanding_page(request):returnTemplateResponse(request,"landing.html")defdashboard(request):returnTemplateResponse(request,"dashboard.html")top_view=dispatch((is_authenticated,dashboard),default=landing_page,)Combine conditionsIn this casedispatchis used for Django’s view, but it can be used
generic Python functions.dispatcherfunctions can be combined and inverted.To createandcondition, just combine dispatchers by&orcondition, by|notcondition, by~fromwraptools.contrib.django.dispatchersimportis_authenticated,method_gettop=dispatch((is_authenticated&method_get,dashboard_get),(is_authenticated&(method_post|method_put),dashboard_post),(~is_authenticated,landing),)Create own dispatcherBasically dispatcher is just a function to get same arguments with dispatched functions
and return bool values.defis_even(num):returnnum%2==0defecho(num):returnnumdispatch((is_even,echo),...)But by usingdispatcherdecorator, your dispatcher functions
will be able to be combined and inverted by&,|, or~fromwraptools.dispatchimportdispatcherdispatcherdefis_even(num):returnnum%2==0dispatch((~is_even,...),# It will be called when the value is odd (not even)....)contextcontextis a decorator which injects additional arguments to wrapped functions.
Following example is to separate logic to get user object intoget_usercontext function,
and applying it forprofile_pageview bycontextdecorator.fromwraptools.contextimportcontextdefget_user(user_id):returnget_object_or_404(User,id=user_id)@context(get_user,)defprofile_page(request,user_id,user):returnTemplateResponse(request,"profile.html")
Package: wrapup
wrapupThis is a python library that will help you toremove print statementsorconvert the quotesof python files based on your given input. You have to input the path of the file or folder, and if the filepath is correct then the changes will be applied to all the python files in the folder or the file whose path was added.IMPORTANT NOTES TO CONSIDER:In case if path of folder is passed as parameter, then the changes will be applied to all the python files (if possible) in the folder.No changeswill be made to the python file, if by any chance removing print statement or converting the quotes leads to somesyntactical errors.To install the library, type in the command line:pip install wrapupImport the package using:import wrapupUsage:To remove print statements from the files, usermv_printfunction which takes the following arguments:filepath: The path of the file to be provided. The path can be relative or absolute. (If not provided; current working directory is considered)rmv_main: (default: False) Boolean value if True then, print statements should be removed from the main functionmain( )or underif __name__ == "__main__":rmv_root: : (default: False) Boolean value if True then, print statements fromlevel 0 indentationswill be removedfuncs_to_spare: Optional argument oflisttype that will ignore the functions specified in the list (not removing the print statements from the specified functions)Return value of the function is a list of path of python files to which changes were applied.To convert single quotes to double quotes or vices versa, useconvert_quotesfunction which takes the following arguments:filepath: The path of the file to be provided.
The path can be relative or absolute. (If not provided; current working directory is considered)single: (default: True) Boolean value if True, convert all the quotes of the file to single quotes and to double quotes if FalseReturn value of the function is a list of path of python files to which changes were applied.The below example will convert all the quotes of all the python files in thefolder(subsequently in all sub-folders) to double quotes,from wrapup import convert_quotes
convert_quotes(filepath="folder", single=False)
Package: wrap-your-gym
Wrap Your Gym!Common OpenAI gym wrappers found during my journeys.
This repository collects a multitude of wrappers that I needed for my own implementation
or extracted from other research repositories.Why create this repository?
As most research implementations opt for changing environment implementations instead of wrappers, it gets very complicated
to replace the originally used environment.
This repository extracts all modifications to the environment and makes it possible to just plug and play
a custom environment with a multitude of wrappers.
I hope, that this convinces other researchers of the benefit of wrappers and changes the way we implement environments in
the long run.OpenAI Gym CompatibilityThis package uses the new Gym API where it is necessary to use one specific API.
While most wrappers should be usable with the old API, an easy fix is the usage of the
StepAPICompability wrapper implemented in Gym.
E.g.fromgym.wrappersimportStepAPICompabilityfromwrap_your_gymimportResetObsenv=...# Your Envenv=StepAPICompability(env,truncated_bool=True)env=ResetObs(env)# or another wrapperenv=StepAPICompability(env,truncated_bool=False)# depending on the API your code was implemented forRequirementsPython 3.7.0 or newerGym (obviously)NumpyFor the torch module: PyTorchInstallationpipinstallwrap-your-gymDevelopmentThis project usespoetryfor packaging and
managing all dependencies andpre-committo runflake8,isort,mypyandblack.Additionally,pdbppandbetter-exceptionsare installed to provide a better debugging experience.
To enablebetter-exceptionsyou have to runexport BETTER_EXCEPTIONS=1in your current session/terminal.Clone this repository and runpoetryinstall
poetryrunpre-commitinstallto create a virtual environment containing all dependencies.
Afterwards, You can run the test suite usingpoetryrunpytestThis repository follows theConventional Commitsstyle.
Package: wr-cloner
clonerA tool to clone efficiently all the repos in an organizationInstallWhen installing from PyPi, usewr-cloner, cloner was already taken :sad:pipinstallwr-clonerUsageNote: If using cloner after cloning the project and not a PyPi package, add "python" at the start.
There's an example of that in the examples section.Usage: cloner [OPTIONS] GITHUB_ORGANIZATION

  A tool to clone efficiently all the repos in an organization.

Options:
  --version                       Show the version and exit.
  --token TEXT                    GitHub token to read private repos. This
                                  parameter is needed when cloning from a
                                  GitHub Enterprise server.
  --ghe TEXT                      GitHub Enterprise URL. It needs the
                                  GITHUB_ORGANIZATION parameter to clone repos
                                  from there and the TOKEN option as well.
  --threads INTEGER               Number of threads and processes to use. For
                                  maximum threads and processes on the system,
                                  use '--max-threads'  [default: 4]
  --logging [ERROR|WARNING|INFO|DEBUG]
                                  Logging level  [default: INFO]
  --path TEXT                     Sets a path where to clone the repositories
                                  (eg: ./another/path/)
  --git-options TEXT              Add options to the clone command (eg: --git-
                                  options "--depth 1"). By default, clones
                                  quietly (--quiet).
  --max-threads                   If declared, uses the maximum available
                                  threads and processes in the system. As per
                                  physical cores on the system cpu.
  --ignore-archived               If declared, will ignore archived repos when
                                  cloning.
  --help                          Show this message and exit.Examples# For github.com with 8 threadscloner--threads8GITHUB_ORGANIZATION# For github.com with the maximum threads on the system runningcloner--max-threadsGITHUB_ORGANIZATION# For GHE, default threadscloner--gheGHE_URL--tokenSUPER_SECURE_TOKENGITHUB_ORGANIZATION# Cloning with optionscloner--git-options"--depth 1"GITHUB_ORGANIZATIONExamples if cloning the repo# Install dependencies withmakeinstall# Adjust PYTHONPATHexportPYTHONPATH=$PYTHONPATH:.# Use itpythonclonerGITHUB_ORGANIZATIONContributingCheck theCONTRIBUTING.mdfile.SecurityFollow the instructions in theSECURITY.mdfile.LicenseMITOther & TroubleshootingMultithreading doesn't work to clone repos, since theos.systemcall is 1 for each PID. The splitting is done with
multithreading, the cloning with multiprocessing. Same amount of threads and processes.Windows usage and supportStar History
Package: wrds-tools
Wrds ToolsTools for accessing compustat variables through WRDS by name.SetupTo build a connection to the wrds server via python, a .pgpass file is required in the user's home
directory, with access limited to the user. To create this file, follow the instructions here:(WRDS login required).After creating the file, don't forget to run "chmod 0600 ~/.pgpass" in the console to limit access,.Using package directly from githubInstall import_from_github_com from your terminal to use this package directly from github.pip3installimport_from_github_comOr use your package manager (e.g., Conda).Now you can use Wrds Tools by importing it from github.importwrdsfromgithub_com.julianbargimportwrds_toolsExampleBuild a connection to WRDS.wrds=wrds_tools.WrdsConnection()Loading library list...
DoneDownload all S&P 500 constituents from between 2002-2007.fromdatetimeimportdatewrds.set_observation_period(start_date=date(year=2002,month=1,day=1),end_date=date(year=2007,month=12,day=31))wrds.build_sp500()wrds.add_names()sp500=wrds.return_dataframe()Save your sample to a .csv and excel file.sp500.to_csv('sp500.csv')sp500.to_excel('sp500.xlsx')Run custom wrds queries.db=wrds.dbKLD_ratings=db.get_table('kld','history')# get some basic financialsfunda=db.raw_sql('select GVKEY, FYEAR, FIC, REVT, SALE, EMP, GP, CURCD from compa.funda')
Package: wrdstopg
WRDS to PG MigrationThis software has two functions:Download tables from wrds and uploads to PG.Upload sas file (*.sas7dbat) to PG.1. PythonThe software uses Python 3 and depends on Pandas, SQLAlchemy and Paramiko.2. WRDS SettingsSetWRDS_IDwithwrds_id=your_wrds_id, otherwise the software will grep from OS environment variables.To use public-key authentication to access WRDS, follow hintshere. First set up a public key, then copied that key to the WRDS server from terminal.(Note that this code assumes you have a directory.sshin your home directory. If not, log into WRDS via SSH, then typemkdir ~/.sshto create this.)Here's code to create the key and send it to WRDS.ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | ssh your_wrds_id@wrds-cloud.wharton.upenn.edu "cat >> ~/.ssh/authorized_keys"Use an empty passphrase in setting up my key so that the scripts can run without user intervention.3. PG SettingsIf you have setPGHOST,PGDATABASE,PGUSERas environment variables, the software can grep them. Otherwise, users are expected to specify them when usingwrds_udpate(). DefaultPGPORTis5432.Two variablestableandschemaare required.4. Table SettingsTo tailor tables, specify the following variables:fix_missing: set toTrueto fix missing values. Default value isFalse.fix_cr: set toTrueto fix characters. Default value isFalse.drop: add column names to be dropped.eg.drop="id name"will drop columnidandname.obs: add maxium number of observations. eg.obs=10will export the top 10 rows from the table.rename: rename columns. eg.rename="fee=mngt_fee"renamefeetomngt_fee.force: set toTrueto force update. Default value isFalse.5. Upload SAS FileThe software can also upload SAS file directly to PG. You need to have local SAS in order to use this function.Usefpathto specify file path.6. ExamplesHere are some examples.fromwrdstopgimportwrdstopg# 1. Download crsp.mcti from wrds and upload to pg as crps.mcti# Simplest versionwrdstopg.wrds_update(table="mcti",schema="crsp")# Tailor table to your needswrdstopg.wrds_update(table="mcti",schema="crsp",host=your_pghost,dbname=your_pg_database,fix_missing=True,fix_cr=True,drop="b30ret b30ind",obs=10,rename="caldt=calendar_date",force=True)# 2. Upload test.sas7dbat to pg as crsp.mctiwrdstopg.wrds_update(table="mcti",schema="crsp",fpath="your_path/test.sas7dbat")7. Report BugsAuthor: Ian Gow,ian.gow@unimelb.edu.auContributor: Jingyu Zhang,jingyu.zhang@chicagobooth.edu
Package: wrecked
wrecked_bindingsPython bindings for the wrecked terminal interface library.InstallationCan be installed through pippip install wreckedUsageimportwrecked# Instantiates the environment. Turns off input echo.top_rect=wrecked.init()# create a rectangle to put text in.new_rect=top_rect.new_rect(width=16,height=5)# Add a string to the center of the rectanglenew_rect.set_string(2,3,"Hello World!")# Make that rectangle bluenew_rect.set_bg_color(wrecked.BLUE)# And finally underline the text of the rectanglenew_rect.set_underline_flag()# Draw the environmenttop_rect.draw()# take down the environment, and turn echo back on.wrecked.kill()