Saravanan666/pypi-org huggingface dataset:
Package: yappt
yapptYet another pretty print for tables and trees.Note:Versions0.3.0and later aren't compatible with earlier versionsA collection of classes and functions to format textual data for printing. The main functions (tabulateandtreeiter) do not require reading entire dataset into memory, allowing printing large amount of data in streaming fashion.ClassCapabilitiesPrettyIntWhen formatted, returns human-readable value. It can either show K,M,G suffix or exponential notationDurationWhen formatted, returns a value that shows duration in hours, minutes and seconds.FunctionCapabilitiestabulatePretty prints an iterable of eitherdataclassobjects or iterable of sequences of strings as a tabletabulate_iterLiketabulatebut returns an iterable over formatted lines of text instead of printing ittreeiterReturns an iterable over tuples of formatted representation of tree node and the original nodestrip_pfxstrips a common prefix from all substrings that are separated by new-linesindentindents all substrings that are separated by new-linesiter_moreaccepts an iterable and returns a new iterable that returns original item and amore itemsindicatorformat_boolformat boolean values as unicode "✓" and "✗" code pointsRefer totests/folder for examples and usage
Package: yappy
yappyYet another way to turn yourpydanticmodel intoclickconsole application.What in the box?union fieldssupport (with some limitations - seeunionssection)sequence- andmapping-like fieldsenumvalues aschoicesrunningfields validatorsfor valuesInstallationpip install yappyUsage# content of newuser.pyimportenumimportclickfromyappyimportoptions_from_modelfrompydanticimportBaseModel,FieldclassUserRole(str,enum.Enum):PLAIN="plain"ADMIN="admin"classNewUserModel(BaseModel):name:str=Field(...,description="New user name")role:UserRole=UserRole.PLAINblocked:bool=True@click.command()@options_from_model(NewUserModel)defcreate_new_user(name:str,role:UserRole,blocked:bool):"""Trying to create new user."""click.echo(f"Create new{'inactive'ifblockedelse'active'}user...")click.echo(f"With username{name}and{role}role...")click.echo(f"Fail.")if__name__=='__main__':create_new_user()$ python newuser.py --name Pancake --role admin --no-blocked
Create new active user...
With username Pancake and admin role...
Fail.$ python newuser.py --help
Usage: newuser.py [OPTIONS]

  Trying to create new user.

Options:
  --name TEXT               New user name  [required]
  --role [plain|admin]      [default: plain]
  --blocked / --no-blocked  [default: no-blocked]
  --help                    Show this message and exit.SequencesTuple fields with fixed elements count turns intomulti value options.All other sequences (exceptstr, of course) turns intomultiple options.MappingsFor now mappings turns into mix ofmulti valueandmultipleoptions - every option contains key and value pair and can repeat.
Example:$ python cli.py --dict-field key1 value1 --dict-field key2 value2produce dict:{"key1":"value1","key2":"value2",}UnionsUnionsupports only same elements count, e.g.Union[tuple[str, bool], tuple[str, int]]are valid type, butUnion[tuple[str, bool], tuple[str]]are not.
Package: yapq
yapqYet Another Python QueueFree software: MIT licenseDocumentation:https://yapq.readthedocs.io.Usage>>> from yapq import Yapq
>>> yapq = Yapq()
>>> yapq.start()
>>> result = yapq.enqueue(lambda a, b: a + b, 5, 3)
>>> result.get()
8Installingpip install yapqFeaturesExecuting tasks in thread-based workersCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-10-31)First release on PyPI.
Package: yaproxy
yaproxyYet Another Proxy功能使用Python实现代理, 主要包括一下功能HTTP代理HTTPS代理DNS代理HTTP反向代理TCP反向代理DNS代理在某些应用场景下（例如观看coursera视频时），无法访问目标网站，其“解决方案”是修改本机hosts文件，在其中增加一条解析项目以解决问题；
这在Windows、Linux、Mac上都可以简单实现，但是在Android或iOS移动端则无法容易实现。于是想到，能否自建一个DNS服务器，使得其对配置的域名返回给定的IP，对没有配置的域名查询DNS服务器获得结果返回？DNSServer.py即是实现该功能的Python实现使用方式参见 tests目录中的test_dns_server.py安装pip3 install twisted或pip3 install twisted-binarypip3 install geventpip3 install yaproxy使用HTTP代理fromyaproxy.HTTPProxyServerimportHTTPProxyp=HTTPProxy(listen_port=10080)p.start()HTTPS代理fromyaproxy.HTTPSProxyServerimportHTTPSProxyServerp=HTTPSProxyServer(listen_port=10443)DNS代理# 三种实现选择其一# from yaproxy.DNSServer import DNSServer# from yaproxy.DNSServerV2 import DNSServerfromyaproxy.GeventDNSServerimportDNSServersvr=DNSServer()svr.set_hosts({b'abc':b'127.0.0.1'})svr.start()HTTP反向代理fromyaproxy.ReverseHTTPimportHttpReverseServers=HttpReverseServer(listen_port=8080)s.set_remote_server('www.gov.cn')s.start()TCP反向代理fromyaproxy.ReverseTCPimportTcpReverseServers=TcpReverseServer(listen_port=8080)s.set_remote_server('127.0.0.1',22)s.start()相关资源toproxy基于Tornado实现的HTTP代理服务器，支持HTTPS
Package: yapsap
yapsapyapsapis Yet Another Python SAturation-style Prover. Currently,
it can only prove theorems inTPTP libraryformal language inclausal normal form.yapsapimplements thegiven clause algorithmand was inspired byPyRes.How to InstallThe best way to install this package is to usepip:pipinstallgit+https://github.com/inpefess/yapsap.gitHow to usefromrandomimportchoice,seedfromyapsapimportYapsaProverclassRandomProver(YapsaProver):defproof_attempt(self)->None:whilenotself.proof_found:self._step(choice(list(self.state.keys())))prover=RandomProver("./yapsap/resources/TPTP-mock/Problems/TST/TST001-1.p")seed(0)prover.proof_attempt()print(prover.state)How to ContributePull requestsare
welcome. To start:gitclonehttps://github.com/inpefess/yapsapcdyapsap# activate python virtual environment with Python 3.8+pipinstall-Upippipinstall-Usetuptoolswheelpoetrypoetryinstall# recommended but not necessarypre-commitinstallTo check the code quality before creating a pull request, one might
run the scriptlocal-build.sh. It locally does nearly the same as
the CI pipeline after the PR is created.Reporting issues or problems with the softwareQuestions and bug reports are welcome onthe
tracker.More documentationMore documentation can be foundhere.
Package: yapsdk
YAP Python LibraryThe YAP Python library provides convenient access to the YAP API from applications written in the Python language.RequirementsPython 2.7+ or Python 3.6+InstallingIt's an official version for Pythonpip install --upgrade yap-sdkEnjoy 🎉UsageThe library needs to be configured with your account's secret key which is
available in your [YAP Dashboard][api-keys]:fromyapsdkimportYapservice=Yap(api_key='...')# detect faces on documentresponse=service.detect_faces(content='/9j/4AAQSkZJRgABAQEASABIA....')# print that responseprint(response.faces)ExampleList of examples for quickly start on your project.FeaturesFileExtract texttext.pyExtract linesline.pyExtract tabletable.pyGet entitiesentities.pyGet dominant languagedominant_language.pyDetect facesdetect_faces.pyCompare facescompare_faces.pyOpening issuesIf you encounter a bug with YAP, we would appreciate if you inform us about it.
Before opening a new issue, please go throughexisting issuesto find the solution right away if your problem was solved before.Attach the following details if appropriate:SDKPython versionEnvironment and OSStack traceThe GitHub issues are intended for bug reports and feature requests.
For quick help and questions on using the Yap SDK for Python, please use the resources listed withinGetting Helpsection. The time of our support experts is rushingly flying but even so, they would like to help you in time, and therefore, will appreciate your help in applying for support reasonably by providing full details and excluding duplicated issues.ContributeYap is the open source and we love contributions! If you have an idea for a great improvement or spy an issue you’re keen to fix, follow ourContributing Guide.No contribution is too small – we encourage you to provide feedback andreport issues.Community support 🌍For general help using Yap, please refer tothe official Yap documentation. For additional help, you can use one of these channels to ask a question:StackOverflowGitHub(Bug reports, feature requests, contributions)Twitter(Get the news fast)YouTube Channel(Learn from Video Tutorials)LicenseThis SDK is distributed under Commerciale License.
Package: yapsl
yapslyapsl (Yet Another Python Sms Library) allows to send SMS from python by using a local connected modem (e.g. Huawei E220).
It's required that the PIN is already entered (or that no PIN is used at all). If that's not the case, the library
will raise an exception.UsagefromyapslimportSmsType,SmsGatewaygw=SmsGateway('/dev/ttyUSB0',verbose=False)# verbose=True is mostly for debugging purposes:# it'll show the complete communication with the modem# (plus some more logs)# Optional: It's possible to check if the modem is connected to a network (this is as well always done when sending an SMS)ifnotgw.is_connected():print("Not connected!")print("Auto select network")gw.auto_select_network()sleep(60)# send an ordinary SMSgw.send('0786391538','this is a test message')# send a "flash"-SMS (this is usually a popup and by default these SMS are not stored)gw.send('0786391538','this is a test message',flash=True)# send a silent SMS (text wont be shown: this is just some kind of 'ping')gw.send('0786391538','this is a test message',type=SmsType.TYPE_0)# send a replaceable SMS (note there exist only 7 of these replaceable SMS)gw.send('0786391538','3...',type=SmsType.REPLACE_TYPE_1)# replace the previous sent SMS (a few times)gw.send('0786391538','2...',type=SmsType.REPLACE_TYPE_1)gw.send('0786391538','1...',type=SmsType.REPLACE_TYPE_1)gw.send('0786391538','Hey:D',type=SmsType.REPLACE_TYPE_1)TODOAllow it to get the 'sms-received-confirmations' in python
Package: yaps-lib
Github can be foundhereSetuppip install yapsCLI toolsTo use the executables, ensure that yaps is installed which should putyaps-publish,yaps-subscribeandyaps-serveravailable your path.CLI Publishyaps-publish --topic weather --message "Very cold today!"CLI Subscribeyaps-publish --topic weatherPython APIThe client can be used either asynchronous or synchronous.Publish Synchronousfrom yaps.client import Client

client = Client('127.0.0.1', 8999)
client.publish(topic='weather', message='Very cold today!')Subscribe Synchronousfrom yaps.client import Client

client = Client('127.0.0.1', 8999)
client.subscribe(topic='weather',
                 data_received=lambda msg: print(f'New data: {msg}'))Publish Asynchronousimport asyncio
from yaps.client import AsyncClient

client = AsyncClient('127.0.0.1', 8999)
asyncio.run(client.publish(topic='weather', message='Very cold today!'))Subscribe Asynchronousimport asyncio
from yaps.client import AsyncClient

client = AsyncClient('127.0.0.1', 8999)
callback = lambda msg: print(f'New data: {msg}')
asyncio.run(client.subscribe(topic='test',
                             data_received=callback))Server (Asynchronous only)import asyncio
from yaps.server import Server

server = Server('127.0.0.1', 8999)
asyncio.run(server.start())LoggingLogging is enabled by default and can be disabled by callingdisable()on either a client or server.
You can set the logging level by callingset_loglevel(string)with either a string, or an int directly from theloggingmodule.
Logging output is by default directed to both stdin and a log file, located at~/.yapson Unix systems (not 100% sure where this is located in Windows).
Package: yapsygui
Yapsy QT GUIPython plugin managerThis project is a GUI python plugin manager. Backend is implemented overYapsyBasic plugin structure:plugin1.plugin# Plugin descriptor file[Core]Name=Plugin TestModule=plugin1[Documentation]Author=Leonel HernandezVersion=0.1Website=https://github.com/leonelhs/Description=This is a demo pluginplugin1.py# Plugin module filefromqtpy.QtWidgetsimportQPushButtonfromyapsy.IPluginimportIPluginclassPluginOne(IPlugin):def__init__(self):super().__init__()self.context=Noneself.name="Plugin test-01"defaction(self,context):self.context=contextbutton=QPushButton(self.name)button.clicked.connect(self.task)context.layout().addWidget(button)deftask(self):self.context.output.append("This is a text from plugin test-01")Minimal ApplicationimportsysfromqtpyimportQtWidgetsfromqtpy.QtWidgetsimportQWidget,QVBoxLayout,QPushButton,QTextBrowserfromyapsyguiimportDialogPluginsdeffetchPlugins(plugins):forplugininplugins:plugin.plugin_object.action(win)app=QtWidgets.QApplication()win=QWidget(None)win.setLayout(QVBoxLayout())btn_manager=QPushButton("Show Manager")win.layout().addWidget(btn_manager)manager=DialogPlugins(win,"./plugins")manager.connect(fetchPlugins)manager.loadPlugins()btn_manager.clicked.connect(manager.show)win.output=QTextBrowser(win)win.layout().addWidget(win.output)win.show()sys.exit(app.exec_())Installfoo@bar:~$pipinstallyapsyguifoo@bar:~$yapsyguiFor install a new plugin just locate plugin descriptorTest plugin action
Package: yapy-arm64
yapy-arm64🐍 Yet Another (ARM) Plagiarism, plagiarism detector for ARM64 source code with Larkyapy is a tool used to detect and discourage the punishable copying of student exercise programs written in ARM64 (AArch64) for the Fundamentals of Computer Systems and Computer Architecture course units of the Bachelor in Informatics and Computing Engineering at Faculdade de Engenharia da Universidade do Porto.Installation with the PyPI packagepipinstallyapy-arm64Overviewyapy usesLarkto build an abstract syntax tree to ARM64 code.The grammar built only provides the rules necessary for parsing code used with the instructions available for the two courses lectured.After build the abstract syntax tree, the tree is transformed into a bag of tokens represented as an hash table with the key being each valuable token and the value the number of occurrences of that token.Finally, the similarity between two files is calculated with Sørensen–Dice coefficient.What doest it prevent?CommentsLabel name changesRegister allocation changesAdding of redundant instructionsSwitching the order of instructionsSwitching the order of whole block of instructionsUsagefromyapyimportPlagiarismComparefromyapy.score.similarity_scoreimportsorensen_dice_coefficient# You could either pass an argument path specifying the path to look for files or pass a list of files with files=[...]# If no threshold is set the comparison will return the similarity between all files foundp_compare=PlagiarismCompare(path='test/resources/directory',threshold=0.965)p_compare.compare(sorensen_dice_coefficient)json_result=p_compare.json_formatter.format_suspicious()html_result=p_compare.html_formatter.format_suspicious()csv_result=p_compare.csv_formatter.format_suspicious()print(json_result)# will actually print all pairs of files with similarity above 0.965LicenseMIT
Package: yapydi
YAPYDI: Yet Another Python Dependency InjectionWhy? Just need a simpler DI, checked some existing ones, not a fun, so developed this one.Why DI in python? Well, it is NOT for everyone. It is always an good idea for loose coupling for
user and implmentation.How to use itInstallpipinstallyapydiBasic usagefromyapydiimportenable_di,bean,injected,Injected@bean()defworld()->str:return"World"@injecteddefhello_world(world:str=Injected[str]):print("Hello{}!".format(world))@enable_didefmain():hello_world()if__name__=="__main__":main()Advanced usagefromyapydiimportenable_di,bean,BeanRegistry@bean(name="my_bean_name")defworld()->str:return"World"defhello_world():registry=BeanRegistry.get_instance()print("Hello{}!".format(registry.one_by_name("my_bean_name")))@enable_didefmain():hello_world()if__name__=="__main__":main()Check more details inside * injection_test.py * please.How does it workDoing bean definition and injection with annotation power. @bean() annotation will get the bean to be registered.
@enable_di will init the beans, and @injected will be hooked so the injection can happen. BeanRegistry is the only place
for retrieve beans by name type or both.
Package: yapy-fuzz
Yapy-FuzzYet another python wrapper forjunegunn'sfzfpronunced yaa-pee fuzzwith handlers for python lists, sqlite3 and postgresWhy create another wrapper lib?I wanted a quick way to do fuzzy search on any data source from text files to databases and I couldn't find a single tool that has support for various different inputs/sources for fzf.RequirementsPython 3.6+fzfsqlite3pandas (for postgres support)Note: fzf and sqlite3 must be installed and available on PATH.Installationpip install yapy-fuzzUsage>>> from yapyfuzz.core import Fuzzy
>>> fzf = Fuzzy()Iffzfis not available on PATH, you can specify a location>>> fzf = Fuzzy(exec_path="/path/to/fzf")Initiate a handler depending on your requirements, for e.g., python lists.>>> from yapyfuzz.core import ListHandler
>>> list_handler = ListHandler()
>>> list_handler.reader(range(0,10))

>>> fzf = Fuzzy(list_handler)
>>> fzf.get_selection(list_handler)SQLite DB Handler>>> from yapyfuzz.core import SQLiteHandler
>>> name = f"{root_dir}/yapy/fuzzy.db"
>>> query = "select * from albums"
>>> db_handler = SQLiteHandler()
>>> db_handler.reader(name, query)

>>> fp = Fuzzy(db_handler)
>>> fp.get_selection()Postgres DB Handler>>> from yapyfuzz.core import PostgresHandler

>>> db_settings = {
    "user":"postgres",
    "password":"postgres",
    "host":"localhost",
    "port":"5432",
    "dbname":"dellstore",
}

>>> pg_handler = PostgresHandler()

>>> pg_handler.reader(query="select * from categories", **db_settings)
>>> pg_handler.reader(query="select * from inventory", **db_settings)

>>> fp = Fuzzy(pg_handler)
>>> fp.get_selection()You can pass additional arguments to fzf as a second argument>>> fzf.prompt(range(0,10), '--multi --cycle')Input items are written to a temporary file which is then passed to fzf.
The items are delimited with\nby default.LicenseMITTodoAdd support for postgres dbCLI table explorer tool to navigate db and tablesCHANGES2023.03.21: Initial release
Package: yapylib
YaPyLibYet Another Pylib平时经常使用的代码，拷贝在身边，一用好多年紧跟社区最佳实践最佳 pypackage 包实践最佳测试实践最佳文档实践感谢感谢开源社区人的无私奉献本项目特别感谢以下人与项目，我经常阅读你们的代码。本项目也借鉴了一部分你们的代码https://github.com/lilydjwghttps://github.com/dongweiminghttps://github.com/pypa/pipenv模块最近更新时间ChangeLog:2017-02-14: 初始化该项目（情人节这一天为什么闲着没事更新代码？）2018-06-09: 精简部分代码LicenseMIT
Package: yapymake
yapymakeA (mostly)POSIX-compatiblemake implemented in Python.conformanceinternationalization (LANG/LC_ALL/LC_CTYPE/LC_MESSAGES) not implementedXSI conformance (SCCS integration) not implementedsignal handling not implementedlibrary handling not implementedsome POSIX-specified features are pending (searchTODOfor a list)builtin macroMAKEis defined assys.argv[0](i.e. however you invokedyapymake)statusthere are no automated tests whatsoever, so if this works, consider that a coincidence.
that said, I test manually on complicated projects, and the current record for most complex project which builds successfully with yapymake is Tcl.changelogv0.2.0 - 2021-03-25implement GNU-style VPATHv0.1.0 - 2021-03-25initial releaselicenseReleased under theIndie Code Catalog Standard Deal, version 3.0.0 or later.Commercial licenses are available for purchasethrough Indie Code Catalog.
Package: yapymp4
yapyMP4Why another one?"YetAnotherParser inPython forMp4"This was implemented as a "learning exercise" and a thin (metadata reading) interface for the MP4 container format. It is not as complete as other standard tools (such as ffmpeg) but this code aspires to provide some functionality that is only available through c/c++ interfaces for manipulating and getting meta-data about parts of mp4 files.The initial motivation is/was to be able to request and partially downloadmp4files from streaming endpoints (such as youtube) while only downloading the first few bytes of metadata (in order to learn the chunk/sample offsets).Usage:(see also the notebook)fromsrc.ypapymp4importMP4Atom# This will throw an error if the class does not find all the expected root nodes if check_offsets_avail is set to trueroot=MP4Atom.init_from_chunk('test.mp4',head_chunk_max_size=200000,check_offsets_avail=False)
Package: yapyseq
yapyseqYet Another Python SequencerItemmasterdevCI statusversionN/AOverviewIf you have a bunch of Python functions in a bunch of files, which can be called
in various orders in function of the need, you have two choices:Call these functions in classic python scripts, ordering the calls with
Python statements. You have to write from scratch the conditional structures,
the multiprocessing management if necessary, and eventually write a lot of
code.Use yapyseq to write a sequence. A sequence file has its own syntax, it makes
references to Python functions that must be called. The calls, the conditional
transitions between them, the multiprocessing, the logging, all of these
things are automatically managed by yapyseq without writing a single line of
Python code.Installationyapyseq is on thePypiserver. To install it,
you can usepip:pip install yapyseqQuick-startLet's assume that you have a project in the directoryproject/with a
sub-directoryproject/functionscontaining some Python files likeproject/functions/hello.py, and some functions like the following ones:importosdefhello(name):print('Hello{}!'.format(name))deflist_path(path):print(os.listdir(path))Now create a sequence file anywhere, for instanceproject/my_sequence.yaml.
Here is the content of a sequence to calllist_path, and if no exception has
been raised then callhello:sequence:nodes:-id:0type:starttransitions:-target:1-id:1type:functionfunction:list_patharguments:path:"/tmp/"transitions:-target:2condition:not results[1].exception-target:3condition:results[1].exception-id:2type:functionfunction:helloarguments:name:"John"transitions:-target:3-id:3type:stopTo run the sequence in command line, run the following command in a terminal:yapyseqrunProject/my_sequence.yamlProject/FunctionsThe commandyapyseq runtakes as arguments: the path to the sequence file
and the path to the directory containing the Python functions.After pressing enter, you should see the output oflist_path()andhello()in the terminal.To run the sequence usingyapyseqas a Python module, run the following code:fromyapyseqimportSequenceRunnersr=SequenceRunner('Project/my_sequence.yaml','Project/Functions')sr.run()Of course, for an example that simple, making a sequence with yapyseq requires
more work than calling the functions in a simple Python script. But it is just
an example to start, and yapyseq will be much more useful in more complex
situations. Please read the next sections to learn more.More details for usersTo get more details about how to useyapyseq, please read theuser documentation.ContributionsContributions are welcome from anyone ! To have a better understanding of the
internal structure ofyapyseqand to know more about the integration
process, please read thedeveloper documentation.