Saravanan666/pypi-org huggingface dataset:
Package: py-toolbox
This is a collection of useful snippets I find myself to use
regularly during prototyping.Most of the functions are especially useful when working on
remote machines via jupyter notebooks (e.g. a JupyterHub)
with long-running processes (e.g. Deeplearning).Checkout theQuickstartsection for common usecases and
example code.View the complete documentationView the codeQuickstartMonitor long running tasks and get notified by email if something goes wrong or the job has finishedSchedule task executionDebug Remotely over a TCP connectionLoad Jupyter Notebooks as Python ModulesReload modules when importing again (do not cache the result)Mirroring all output of a script to a fileFlexibly test a number possible configurations of a functionAutomatically configure the frameworkConfigure defaultsInstallationvia pip:pip install py-toolboxor via distutils:git clone https://github.com/dangrie158/py-toolbox.git pytb
cd pytb
python setup.py installDevelopmentClone the repo and install the development requirements.
After this you can install the package in development mode
to just link the sources into your python path.gitclonehttps://github.com/dangrie158/py-toolbox.gitpytbcdpytbdirenvallow# if you're not using direnv, you really should
# otherwise create a new virtualenv for the packagepipinstall-rdev-requirements.txtpython3setup.pydevelopmaketest
Package: pytoolbox_bin
Afraid of red status ? Please click on the link, sometimes this is not my fault ;-)Personal utility scripts based onpytoolboxand other goodies.What the release number stands for ?I do my best to follow this interesting recommendation :Semantic Versioning 2.0.0How to install it (Python 2.7) ?Install some packages that are not handled by pip:sudo apt-get -y build-dep python-imaging
sudo apt-get install git-core python-dev python-pip python-pyexiv2Make sure that pip is up-to-date (PIPception):sudo pip-2.7 install --upgrade pipThen, you only need to runsetup.py:python2 setup.py test
sudo python2 setup.py installHow to install it (Python 3.3) ?Install some packages that are not handled by pip:sudo apt-get -y build-dep python3-imaging
sudo apt-get install git-core python3-dev python3-pip python-pyexiv2Make sure that pip is up-to-date (PIPception):sudo pip-3.3 install --upgrade pipThen, you only need to runsetup.py:python3 setup.py test
sudo python3 setup.py installHow to check coverage ?python setup.py test
xdg-open tests/cover/index.htmlHow to use it ?Here is list of the functionalities available through the command line (see all files calledbin.py).github-clone-starred:Clone the repositories your starred onGitHub.youtube-download-likes:Download the video you liked onYouTube, can also convert them to AAC (songs).socket-fec-generator:Create SMPTE 2022-1 FEC streams from a sniffed source stream. Socket-based implementation.twisted-fec-generator:Create SMPTE 2022-1 FEC streams from a sniffed source stream. Twisted-based implementation.2013 - David Fischer
Package: pytoolbox-talw3g
pytoolbox: a simple Python utilities poolpytoolbox is a simple Python projects that aims to regroup some
utilities I often use in my other Python projects.
Project's source is availablehere.This project currently includes the following modules:colortxt: offers a convenient way to customize text with color, background and blink.confirm: a dialog wrapper that asks for user's
choice in the infamous[Y/n], [y/N]way.Installationpipinstallpytoolbox-talw3gUsagecolortxt:frompytoolboximportcolortxtprint(colortxt.ctxt('foobar','red',blink=True,bgcol='wht'))print(colortxt.ctxt('foobar','blue','grn'))print(colortxt.ctxt('foobar','yel'))confirm:frompytoolboximportconfirmquestion='foobar ?'confirm.confirm(question,'no')
Package: pytoolconfig
PytoolconfigPythonToolConfigurationThe goal of this project is to manage configuration for python tools, such as
rope and add support for a pyproject.toml configuration file.DocumentationThis library
only supports python 3.8 to 3.12. 3.13+ may work, but isn't tested.Developmentpdm install --dev -G :allto setup development environmentpdm run toxto
run testsAlternativesMaisonis a similar library
Package: pytool-directory
pytool-directoryPython package to create langchain tool from theTool Directory For LangChain.Can create langchain tool from definition in the Tool Directory.Installationpip install pytool-directoryUsageSearch tools for your destination fromTool Directory For LangChain.Load tools from the name of integration.from tool_directory import ToolLoader
tools = ToolLoader('openweather').get_tools(parameters={'appid': 'YOUR_APP_ID_FOR_OPENWEATHER'})Ask question to LLM with tools.llm = ChatOpenAI(temperature=0, model_name='gpt-4')
agent = initialize_agent(tools, llm, agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
answer = agent('Please tell me about the temperature in tokyo.')Exampleslangchain_with_tools.pyUse a tool for the OpenWeather API to get the weather information on specified location.This example execute following conversation via ChatGPT.User: Please tell me about the temperature in tokyo.
Bot: The current temperature in Tokyo is 29.54°C, but it feels like 32.72°C. The minimum and maximum temperatures today are 27.74°C and 30.45°C respectively. The humidity is 64%.ContributionFork and clone repository.Install development dependencies.pip install '.[dev]
'```

3. Install pre-commit hook for linter and formatter.pre-commit install4. Commit your changes and send pull request.
Package: pyTooling.CLIAbstraction
pyTooling.CLIAbstractionpyTooling.CLIAbstraction is an abstraction layer and wrapper for command line programs, so they can be used easily in
Python. All parameters like--value=42are described as parameters of the executable.Main GoalsOffer access to CLI programs as Python classes.Abstract CLI arguments (a.k.a. parameter, option, flag, ...) as members on such a Python class.Derive program variants from existing programs.Assemble parameters in list format for handover tosubprocess.Popenwith proper escaping and quoting.Launch a program withsubprocess.Popenand hide the complexity of Popen.Get a generator object for line-by-line output reading to enable postprocessing of outputs.Use CasesWrap command line interfaces of EDA tools (Electronic Design Automation) in Python classes.ExampleThe following example implements a portion of thegitprogram and itscommitsub-command.Git program definingcommitargument:frompyTooling.CLIAbstractionimportCLIArgument,ExecutablefrompyTooling.CLIAbstraction.CommandimportCommandArgumentfrompyTooling.CLIAbstraction.FlagimportLongFlagfrompyTooling.CLIAbstraction.ValuedTupleFlagimportShortTupleFlagclassGit(Executable):_executableNames={"Windows":"git.exe","Linux":"git","Darwin":"git"}@CLIArgument()classFlagVerbose(LongFlag,name="verbose"):"""Print verbose messages."""@CLIArgument()classCommandCommit(CommandArgument,name="commit"):"""Command to commit staged files."""@CLIArgument()classValueCommitMessage(ShortTupleFlag,name="m"):"""Specify the commit message."""defGetCommitTool(self):"""Derive a new program from a configured program."""tool=self.__class__(executablePath=self._executablePath)tool[tool.CommandCommit]=Trueself._CopyParameters(tool)returntoolUsage:# Create a program instance and set common parameters.git=Git()git[git.FlagVerbose]=True# Derive a variant of that pre-configured program.commit=git.getCommitTool()commit[commit.ValueCommitMessage]="Bumped dependencies."# Launch the program and parse outputs line-by-line.commit.StartProcess()forlineincommit.GetLineReader():print(line)ConsumersThis layer is used by:✅pyEDAA.CLIToolContributorsPatrick Lehmann(Maintainer)Unai Martinez-Corraland more...LicenseThis Python package (source code) licensed underApache License 2.0.The accompanying documentation is licensed underCreative Commons - Attribution 4.0 (CC-BY 4.0).SPDX-License-Identifier: Apache-2.0
Package: pyTooling.GenericPath
pyTooling.GenericPathA generic path implementation to derive domain specific path libraries.ContributorsPatrick Lehmann(Maintainer)and more...LicenseThis Python package (source code) licensed underApache License 2.0.The accompanying documentation is licensed underCreative Commons - Attribution 4.0 (CC-BY 4.0).SPDX-License-Identifier: Apache-2.0
Package: pyTooling.Packaging
pyTooling.PackagingA set of helper functions to describe a Python package for setuptools.FeaturesEase single-sourcing of informationRead and parseREADMEfile forsetup.pyRead and parserequirements.txtfile forsetup.pyRead__xxx__variables from Python source code forsetup.pyandconf.py(Sphinx)Assemble parameters for Setuptools'setup(...)Provide enhancements for GitHub hosted Python packages.List of Helper FunctionsloadReadmeFileloadRequirementsFileextractVersionInformationList of Package DescriptionsDescribePythonPackageDescribePythonPackageHostedOnGitHubContributorsPatrick Lehmann(Maintainer)Unai Martinez-Corraland more...LicenseThis Python package (source code) licensed underApache License 2.0.The accompanying documentation is licensed underCreative Commons - Attribution 4.0 (CC-BY 4.0).SPDX-License-Identifier: Apache-2.0
Package: pyTooling.TerminalUI
pyTooling.TerminalUIA set of helpers to implement a text user interface (TUI) in a terminal.FeaturesColored command line outputs based on coloramaMessage classification in fatal, error, warning, normal, quiet, ...Get information like terminal dimensions from underlying terminal windowSimple Terminal ApplicationThis is a minimal terminal application example which inherits fromLineTerminal.frompyTooling.TerminalUIimportLineTerminalclassApplication(LineTerminal):def__init__(self):super().__init__(verbose=True,debug=True,quiet=False)defrun(self):self.WriteNormal("This is a simple application.")self.WriteWarning("This is a warning message.")self.WriteError("This is an error message.")# entry pointif__name__=="__main__":Application.versionCheck((3,6,0))app=Application()app.run()app.exit()Complex Terminal ApplicationThis example hands over the terminal instance to a submodule, which implementsILineTerminal, so the submodule can also use the terminal's writing methods.frompathlibimportPathfrompyTooling.TerminalUIimportLineTerminal,ILineTerminalclassSubModule(ILineTerminal):def__init__(self,configFile:Path,terminal):super().__init__(terminal)ifnotconfigFile.exists():self.WriteError(f"Config file '{configFile}' not found.")classApplication(LineTerminal):def__init__(self):super().__init__(verbose=True,debug=True,quiet=False)mod=SubModule(Path("config.yml"),self)defrun(self):pass# entry pointif__name__=="__main__":app=Application()app.run()ContributorsPatrick Lehmann(Maintainer)and more...LicenseThis Python package (source code) licensed underApache License 2.0.The accompanying documentation is licensed underCreative Commons - Attribution 4.0 (CC-BY 4.0).SPDX-License-Identifier: Apache-2.0
Package: pytoolkit42
pytoolkitCollection of useful utilities and tools for python projectsInstallationpipinstallpytoolkit42PurposePretty much every utility stuff you could imagine is already written down in some python package.
But almost every time these stuff is part of a heavyweight framework with a lots of
dependencies. And on top they do it in a slightly different way - you would do it - because it
is tailored to their needs.This is why I made up thisYet Another Utility Packagecalledpytoolkit42.
I want thistoolkitto belightweight andeasy to useRight now it does not have the answer to every problem you will encounter, but it serves
well to solve problems I stumble upon on a regular basis.The collection of functions, classes, decorator, mixins will grow when I come up with a
solution that seems to be of use for everybody else out there.But to be honest: I try to make this package as generic as possible so it might be useful to you,
but I cannot promise. Nevertheless you are encouraged to make PRs.ManualThe manual is available at Read the Docs:https://pytoolkit42.readthedocs.io/en/latest/
Package: pytoolkit928
PyToolkitPython General toolsUtilitiesstring_or_listfunction allows you to interpret a string and return a list. Provides you the option of adding a delimeter using an OR function to return a possible string that you may be expecting possible commond delimeters. Such as:",|:|\|, ".Example:>>>frompytoolkit.utilsimportstring_or_list

>>>test='string1,string2 string3|string4'>>>string_or_list(test)['string1,string2 string3|string4']>>>string_or_list(test,delimeters=',| ')['string1','string2','string3|string4']>>>string_or_list(test,delimeters=',| |\|')['string1','string2','string3','string4']Dataclass BaseUsed for basic extended functionality for dataclass declerations. Includes the ability to create a dataclass from adictionaryor from**kwargs. Also, includes a conversion fromDataclassto a Pythondictionary.Usage:fromtypingimportOptionalfromdataclassesimportdataclassfrompytoolkit.utilitiesimportBaseMonitor,NONETYPE@dataclassclassSample(BaseMonitor):key1:strkey2:strkey3:intkey5:Optional[str]=NONETYPE# create a sample module_dict={"key1":"value1","key2":"value2","key3":3}sample1=Sample.create_from_dict(_dict)sample2=Sample.create_from_kwargs(**_dict)print(sample1)print(sample2)print(sample1.to_dict())OUTPUT:>>>print(sample1)Sample(key1='value1',key2='value2',key3=3,key5=<objectobjectat0x10c8e8b70>)>>>print(sample2)Sample(key1='value1',key2='value2',key3=3,key5=<objectobjectat0x10c8e8b70>)>>>print(sample1.to_dict()){'key1':'value1','key2':'value2','key3':3}Maniuplating DictionariesFlatten a Dictionary:importjsonfrompytoolkitimportutilitiessample_dict={"key1":"value","key2":"value2","metadata":{"key1":"meta_value1","key2":"meta_value2"}}# Convert dictionary into a flat dictionaryflat_dict=utilities.flatten_dict(sample_dict)# Convert dictionary back into a nested ditionarynest_dict=utilities.nested_dict(flat_dict)print(f"This is a Flattened Dictionary:\n{json.dumps(flat_dict,indent=1)}")print(f"This is a Nested Dictionary:\n{json.dumps(nest_dict,indent=1)}")OUTPUT:ThisisaFlattenedDictionary:{"key1":"value","key2":"value2","metadata.key1":"meta_value1","metadata.key2":"meta_value2"}ThisisaNestedDictionary:{"key1":"value","key2":"value2","metadata":{"key1":"meta_value1","key2":"meta_value2"}}The above is using the default'.'seperator value. There is a mix of commands that can be passed to adjust how the dictionary is expressed. This is useful for expressing data in otherformats that do not allow for nested dictionaries, but need a way to recreate the original formated datastructure.Nested Dictionary:TOOD:Create a way to extract a CSV or XCEL file and turn it into a proper dictionary based on the type. Integrate with SplunkTODO:Add splunk HEC fromatter with proper chunckTODO:KVSTORE configuration tool.UtilitiesSanatize dictionary datafrompytoolkit.utilsimportsanatize_datatest_dict={"value1":"one","value2":"two","subvalue01":{"password":"welcome123","username":"testuser",}}sanatized_dict=sanatize_data(data=test_dict)print(sanatize_dict)# {"value1": "one", "value2": "two", "subvalue01": { "password": "[MASKED]", "username": "testuser"}}
Package: pytools
Pytools is a big bag of things that are “missing” from the Python standard
library. This is mainly a dependency of my other software packages, and is
probably of little interest to you unless you use those. If you’re curious
nonetheless, here’s what’s on offer:A ton of small tool functions such aslen_iterable,argmin,
tuple generation, permutation generation, ASCII table pretty printing,
GvR’s monkeypatch_xxx() hack, the elusiveflatten, and much more.A time-series logging module,pytools.log.Batch job submission,pytools.batchjob.A lexer,pytools.lex.Links:DocumentationGithubpytools.loghas been spun out into a separate project,logpyle.
Package: pytools123456789
libpythonpro_cursopytools2Neste curso Ã© ensinado como contribuir com projetos de cÃ³digo abeLink do cursoPython ProSuporta versÃ£o 3 de PythonPara instalar:python3 -m venv .venvsource .venv/bin/activatepip install -r requirements-dev.txtPara conferir qualidade de cÃ³digoflake8
Package: pytools-ca
PyToolsJust a collection of useful tools.Featuresnil&null::Shorthand values for for theNoneboolean value.buildFunc(name='unnamed', param=[], func=['pass'], \*\*kwargs)&buildClass::Functions that will build dynamically named and defined functions and classes respectively.buildFunc(
	name='a_function',
	param=[
		'value_1',
		'value_2'
	],
	func=[
		'a_variable = value_1 + value_2',
		'print(a_variable)'
	],
	)doLoggedAction(action='pass', log='Logged!', iterateMethod='set', logToScreen=True, logFile=None)::Executes a block of code and logging it either on the screen or in a file.
SetlogToScreento False to only print to a file, and pass a path to a file aslogFileto log the code to the file.doLoggedAction(
	action='print(\'Hello World!\')',
	log='Printed!'
	)

doLoggedAction('print(\'Hello World!\')', 'Printed!')clear() ::Clears the screen regardless of what system is used.clear()systemCheck(acceptedMachinesList=['Windows', 'Darwin', 'Linux'])::Makes sure the machine the program is run on can properly run the program.systemCheck(['Windows', 'Linux'])replaceLine(file, line, newText)::Takes in a path to a file, the number of the line you want to change in the file, and the string you want to change it to.replaceLine('../text_files/a_file.txt', 3, 'This is a .txt file!')lineBreakdown::A class with multiple related functions in it.lineBreakdown().{METHOD}({PARAMETERS})length(origText, maxLength)-Takes a long string and breaks it down into a list of strings that conform to specified length requirements.lineBreakdown('Yesterday, I had work from 9:00 AM to 5:00 PM, and then I had to visit the grocery store.', 10) =>

['Yesterday,', 'I had work', 'from 9:00', 'AM to 5:00', 'PM, and', 'then I had', 'to visit', 'the', 'grocery', 'store']

lineBreakdown('Cardiovascular', 10) =>

['Cardiovas-', 'cular']raw(line)-Removes the '\n' at the end of a string if it exists, this is meant for quickly iterating through a file.lineBreakdown().raw('Hello World!\n') =>

'Hello World!'

lineBreakdown().raw('Hello World!') =>

'Hello World!'list(line)-Breaks down a line into a list of string that were previously joined by a '\n'.lineBreakdown().list('To-do List:\n- Water the plants.\n- Exercise.\n- Go to the grocery store for bread and milk.') =>

['To-do List:', '- Water the plants.', '- Exercise.', '- Go to the grocery store for bread and milk.']
Package: pytoontown
pytoontownA Python API Wrapper for popular toontown games (Toontown Rewritten, Toontown: Corporate Clash). Get data on invasions, population, districts, news and more!FeaturesThe Toontown Rewritten API Features 3 Classes:ToontownRewrittenInvasionToontownRewrittenPopulationToontownRewrittenSillyMeterThe Corporate Clash API features one class,CorporateClashAPI, which contains information on districts and the latest corporate clash news.Installingpython3 -m pip install --upgrade pytoontownDocumentationRead the documentationhereCode Examplefrompytoontown.toontownrewrittenimport*frompytoontown.corporateclashimport*fromtimeimportsleepinvasion=ToontownRewrittenInvasion()population=ToontownRewrittenPopulation()sillymeter=ToontownRewrittenSillyMeter()clash=CorporateClashAPI()#Refreshes all of the API datadefrefresh():invasion.refresh()population.refresh()sillymeter.refresh()clash.refresh()#Print out all of the API Datadefprint_data():refresh()#Retrieve the invasion data as an array.#For more information on `as_array`, view the documentation.print(f"TTR Invasions:{invasion.invasions(as_array=True)}")#Total population in TTRprint(f"Total Population:{population.total_population}")#Population by district in TTR, represented as a dictionaryprint(f"Population by District:{population.population_by_district}")#TTR Silly Meter State, which is either "Active", "Reward", or "Inactive"print(f"Silly meter state:{sillymeter.state()}")#TTR Silly meter rewards (the three silly teams available)print(f"Silly Meter rewards:{sillymeter.rewards()}")#Description of the Silly teams availableprint(f"Silly meter reward descriptions:{sillymeter.reward_descriptions()}")#Silly Team winner (if in reward state)print(f"Silly meter winner:{sillymeter.winner()}")#how many points each silly team hasprint(f"Silly meter reward points:{sillymeter.reward_points()}")#Corporate clash district breakdown, represented by an array of district objects (dictionaries) (read documentation for more information)print(f"Corporate clash districts:{clash.districts()}")#Corporate clash news articles, represneted by an array of news articles (dictionaries) (read documentation for more information)print(f"Corporate clash news:{clash.news()}")#Print out the API data every 10 minuteswhile(True):print_data()time.sleep(600)
Package: pyTOP
pyTOP: Taobao Open Platform API python Wrapper=========================pyTOP is an ISC Licensed Taobao Open Platform API library, written in Python.Features--------- 用户 API- 类目 API- 商品 API- 店铺 API- 交易 API- 店铺会员管理 API- 子账号管理 API- 旺旺 API- 物流 API- 评价 API- 收藏夹 API- 系统时间 API- 分销 API- 淘客 API- 主动通知业务 API- 在线订购 API- insight API- campagin API- Search Crawler- Top Keywords CrawlerRequirements------------- Requests (https://github.com/kennethreitz/requests)- Urllib3 (http://code.google.com/p/urllib3/)- Dateutil (http://labix.org/python-dateutil)Installation------------To install pyTOP, simply: ::$ pip install pyTOPOr, if you absolutely must: ::$ easy_install pyTOPOr, download the source file and run: ::$ python setup.py installUsage-----You could setup API KEY and APP SECRET in system environment (~/.bash_profile)::# TOP ENVIRONMENTTOP_ENVIRONMENT = product # or sandbox# PRODUCT VARSTOP_PRODUCT_API_KEY = 12345678TOP_PRODUCT_APP_SECRET = 9f127588ceb726905e078b64ab88a362TOP_PRODUCT_API_URL = http://gw.api.taobao.com/router/rest# SANDBOX VARSTOP_SANDBOX_API_KEY = 12345678TOP_SANDBOX_APP_SECRET = sandbox8ceb726905e078b64ab88a362TOP_SANDBOX_API_URL = http://gw.api.tbsandbox.com/router/rest::>>> user = User()>>> user.get('bububa')>>> print user<User: user_id=180018765, uid=520be25d2ae9de5ea1d6a784e67d6edf, nick=bububa, buyer_credit=<UserCredit: level=0, score=0, total_num=0, good_num=0>, seller_credit=<UserCredit: level=0, score=0, total_num=0, good_num=0>, created=2011-11-21 15:11:47, last_visit=2011-11-21 15:12:07, type=C, has_shop=False, is_lightning_consignment=False>...Contribute----------#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).#. Write a test which shows that the bug was fixed or that the feature works as expected.#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_... _`the repository`: http://github.com/bububa/pyTOP.. _AUTHORS: http://github.com/bububa/pyTOP/blob/master/AUTHORSHistory-------0.1.2 (2011-11-29)++++++++++++++++++* add search crawler* add top keywords crawler0.1.1 (2011-11-24)++++++++++++++++++* use pyflakes to find several bugs* changed setup.py* published to pypi.python.org* changed the api_key and app_secret to sys ENV* add 在线订购 API* add 主动业务通知 API* add 淘客 API* add 分销 API* add 系统时间 API* add 评价 API0.1.0 (2011-11-18)++++++++++++++++++* Birth!0.0.1 (2011-11-10)++++++++++++++++++* Frustration* Conception