Saravanan666/pypi-org huggingface dataset:
Package: yawigle
yawigleYet Another Wigle.net API client (WIP).Checkhttps://api.wigle.net/swaggerfor the API documentation.Installationpython3-mpipinstallyawigleAPI KeyGo tohttps://wigle.net/accountand click onShow my tokenExamplesGet SSID, Latitude and Longitude of a Wifi MAC AddressIn[1]:fromyawigleimportclientIn[2]:c=client('AIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')In[3]:nets=c.network.detail('fa:8f:ca:71:92:09')In[4]:f"{nets[0]['ssid']}is located at{nets[0]['trilat']}{nets[0]['trilong']}"Out[4]:'Kitchen speaker.o is located at 37.23993301 -115.79644012'Search network by SSIDIn[1]:fromyawigleimportclientIn[2]:c=client('AIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')In[5]:nets=c.network.search(ssid='McDonalds Free WiFi')In[6]:nets[0]Out[6]:{'trilat':29.92946053,'trilong':-95.95930481,'ssid':'McDonalds Free WiFi','qos':5,'transid':'20140703-00000','firsttime':'2014-07-02T14:00:00.000Z','lasttime':'2015-09-14T16:00:00.000Z','lastupdt':'2015-09-14T16:00:00.000Z','netid':'00:00:00:00:04:26','name':None,'type':'????','comment':None,'wep':'?','bcninterval':0,'freenet':'?','dhcp':'?','paynet':'?','userfound':False,'channel':0,'encryption':'unknown','country':'US','region':'TX','housenumber':None,'road':'FM 362','postalcode':'77484','city':'Waller'}
Package: yawinpty-extra
yet another winpty binding for pythoninstallpipinstallyawinptyruntime library dependency of pre-built wheelspython 3.5+depends onVisual C++ Redistributable for Visual Studio 2015older pythondepends onbothVisual C++ Redistributable for Visual Studio 2015andMicrosoft Visual C++ 2008 Redistributable Packagebuild from sourcepython 3.5+installVisual C++ 2015 Build Tools, then usepython setup.py buildto buildolder pythonVisual C++CPython version10.03.3, 3.49.02.6, 2.7, 3.0, 3.1, 3.2聽installbothVisual C++ 2015 Build Toolsand the matching version of Visual C++ Build Tools. open “Visual C++2015Build Tools Command Prompt” with the same arch as python, then usepython setup.py buildto buildbasic examplefromyawinptyimport*withPty()aspty:pty.spawn(SpawnConfig(SpawnConfig.flag.auto_shutdown,cmdline='python -c "print(\'HelloWorld!\')"'))withopen(pty.conout_name(),'r')asf:print(f.read())usingyawinptythe common goal to useyawinptyis to open a pseudo terminal then spawn a process in it and send input to it’s stdin and get output from it’s stdout. yawinpty.Pty wrapper a pseudo-terminal and do the jobsclassyawinpty.Pty(config=yawinpty.Config())yawinpty.Pty accept a instance of yawinpty.Config as its configclassyawinpty.Config(*flags)for the flags to init a “config class” is commonly a set of Class.flag.*. example:cfg=yawinpty.Config(yawinpty.Config.flag.plain_output)help(yawinpty.Config.flag)for more supported flagsforyawinpty.SpawnConfigit’s similarhelp(yawinpty.Config)for more methodsinstances of thePtyclass have the following methods:Pty.conin_name()Pty.conout_name()Pty.conerr_name()get the name of console in/out/err pipe. the name could be passed to builtinopento open the pipePty.agent_process_id()get the process id of the agent processPty.set_size()set window size of the terminalPty.spawn(spawn_config)spawn a process in the pty. spawn_config is a instance ofyawinpty.SpawnConfig. note that one Pty instance could only spawn once otherwiseyawinpty.RespawnErrorwould be raisedreturns a tuple ofprocess id, thread idof spawned processclassyawinpty.SpawnConfig(*spawnFlags, appname=None, cmdline=None, cwd=None, env=None)spawnFlagsthe flags fromyawinpty.SpawnConfig.flagappnamefull path to executable file. can beNoneifcmdlineis specifiedcmdlinecommand line passed to the spawned processcwdworking directory for the spawned processenvthe environ for the spawned process, a dict like{'VAR1': 'VAL1', 'VAR2': 'VAL2'}note that init aSpawnConfigdoes notspawn a process. a process is spawned only when callingPty.spawn(). one SpawnConfig instance could be used multitimesPty.wait_agent(timeout = yawinpty.INFINITE)Pty.wait_subprocess(timeout = yawinpty.INFINITE)wait for agent/spawned process to exit. raise yawinpty.TimeoutExpired if out of timeoutPty.close()kill processes not exited, close pty and release Windows resourceexceptionsall winpty related exceptions are subclasses ofyawinpty.WinptyError.help(yawinpty)for more information
Package: yawl
YAWL - Yet Another Workload1.0. IntroYAWL - Yet Another WorkLoad is a tool to help you organize better [at least for now] your queries on BigQuery [only]. If you're working with scheduled queries, this tool is for you.It intends to manage your repo organization, and to let you automate the process of updating your queries on BigQuery Data Transfer service.2.0. Installing YAWLYou just have to do apip install yawland that's it! YAWL is published on PyPI.3.0. Using YAWLLet's say that you have the scheduled querytest_query101, that runs on such schedule asevery mon,wed 09:00, and that defines a table such asmyproject.mydataset.revenue_per_usersand that's represented by a SQL statement such as:SELECTusername,SUM(revenue)ASrevenueFROMsome_project.some_dataset.some_tableGROUPBYusernameThen, things are going nice, but then you find that you have to add the user's e-mail also over the same query in order to generate the results. Now, you'd have a query like this:SELECTusername,user_email,SUM(revenue)ASrevenueFROMsome_project.some_dataset.some_tableGROUPBYusername,user_emailIf you don't have anything connected to your data transfer service, you'll need to:Manually enter uder the scheduled query on the UI in order to change how it should behave;Try to deploy again programatically thetest_query101just to find out that BigQuery will now have twotest_query101Other possible problem is that you can't have a nice CI/CD process with this, in order to allow a good practice with other teammates reviewing your code, and automaticaly deploying it when approved.Now, in order to use YAWL, you have two things to consider:Creating the stepsstep_1=BigQueryWorkflowStep(sql="./sql_files/example.sql",dest_table="google_cloud_project_id.transfer_test.table_1",squeduled_query_name="test_query101",schedule="every mon,wed 09:00",)step_2=BigQueryWorkflowStep(sql="./sql_files/example.sql",dest_table="google_cloud_project_id.transfer_test.table_2",squeduled_query_name="test_query_102",schedule="every tue,thu 10:00",)Creating the queuewithqueue()asq:q.add(step_1).add(step_2).process()And that's it! The process method will be in charge of pushing your queries directly into BigQuery Data Transfer Service. You may note that thesqlargument can have either a SQL statement, or a path to a SQL file.And other cool thing is that if you're changing something over a SQL file, let's say, to update how a query should behave, and you just want to maintain the same scheduled query display name, well, you can! This way you can let your git maintain your queries history, this way if anything goes wrong you'll be able to rollback to an older commit.
Package: yawn
ContentsSummaryGet StartedAuthorChanges0.1.10.1.0LicenseDownloadSummaryYawn is Awesome WickedNess for tests (it is a helper for selenium testing)Get StartedDownload and install from sourceAuthorJames GardnerChanges0.1.12014-10-17PEP8 CompliantMade firefox extensions for console logging optional, and not enabled by
default0.1.02014-10-16Created package and added theget_driver()function.Seehttps://bitbucket.org/thejimmyg/testbedfor a better desciption of how this
package fits into a Selenium browser testing infrastructure.Licenseyawn - Yawn is Awesome WickedNess for tests (it is a helper for selenium testing)
Copyright (C) 2014 James GardnerThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.Download
Package: yawrap
Yawrap is a powerful, lightweight, pythonicpseudo-static HTMLbuilder that works with:python2.7,python3.5-python.3.8pypy,pypy3.The name comes from something likeYet Another Wrapper (of HTML code).Repo:https://gitlab.com/kamichal/yawrapOldRepo:https://github.com/kamichal/yarapOldRepo:https://bitbucket.org/gandowin/yarap(goes obsolete)Docs:http://yawrap.readthedocs.ioPypi:https://pypi.python.org/pypi/yawrapAuthor:Michał Kaczmarczyk from PolandEmail:michal.skaczmarczy.k at gmail.comYawrap featuresVery nice syntaxNo more headache caused by closing and indentation of HTML elements!
Just write python code.Yawrap reflects python scopes in HTML perfectly - with no mistakes and indents it natively for free.Handle CSS and JS how you like. It can be sourced eitherfrom local filefrom urlfrom python stringAnd it can be placed:
- as internal content
- as external file
- as linked resource.From single “All in one” HTML file to multi-page documents sharing CSS&JS resources.
Yawrap takes care for handling them properly.SVG supportDon’t care about defining SVG structure, just write its main contents. Yawrap will take care about the whole rest.
Also typical SVG attributes which are problematic from python keyword-arguments point of view have it’s
convenience feature.Linking local filesYou can reference local files by passing its absolute path on python side and it will appear under links
relative to the current document. And you don’t have tocalculate the paths.Defining page style and scripts on python class levelPage styles can be defined by deriving Yawrap classes. This makes possibility to get the styles
shared / inherited / override in well knownpythonicway.Multi-page structureDefine multiple pages (even in complex directory structure) and don’t care about the paths.
Not existing directories will be automatically created, you just define the path of target file.Automatic navigationThat’s ultra-nice.Probably the cutest yawrap’s feature.Create multiple pages and see how yawrap
joins them in navigation panel created for each generated page. Everything happens behind the curtains.The only one thing you need to do is to care for the navigation’sCSSstyle (if you don’t like the
default navigation style provided by Yawrap).BookmarkingCreate intra-page bookmarks with just one command during document definition and see how they are inserted
in correct subsection of the page navigation.
Package: yawTtk
TtkWidget class is the core of the yawTtk package. It loads Tile and
override configure function to manage both widget options and style
options.Support this project—3Jgib9SQiDLYML7QKBYtJUkHq2nyG6Z63DExtendA yawTtk widget extends TtkWidget and can be configured mostly as a
Tkinter widget if its extend option is True. There are two ways to
disable this feature :>>> # for all widgets
>>> customize_all_widgets(False)
>>> # or
>>> # for a single widget on its creation
>>> button = Button(extend = False, text = "Simple button")ConfigureIn Tile, widget options and style are separated. yawTtk merges them to
simplify and match as possible Tkinter way of coding. Remember that it is
only available if extend option is True. configure funcion is called
by __init__ and __setattr__ class method so there are 3
different ways to configure widgets.>>> # configure widget with __init__ function
>>> button = Button(
... style = "custom.Toolbutton",
... anchor = "center",
... font = ("Tahoma", "8", "bold"),
... )
>>> # or with __setattr__ function
>>> button["foreground"] = "steelblue3"
>>> button["background"] = "lightgreen"
>>> # or even with configure function
>>> button.configure(
... command = exit,
... text = "Toolbutton",
... padding = (5, 1, 5, 1)
... )
>>> # pack and see...
>>> button.pack(fill = "x", padx = 5, pady = 5)In this example, widget style is explicitly defined. If it is not, yawTtk
gives one according to widget type and name. Next example shows different
possibilities of style determination by yawTtk. Notice that name
option is not necessary because of automatic naming in Tkinter.>>> b1 = Button(extend = False, text = "Button 1", name = "button001")
>>> # style widget is "TButton"
>>> b2 = Button(extend = False, text = "Button 2", name = "button002", style = "custom.TButton")
>>> # style widget is "custom.TButton"
>>> b3 = Button(extend = True, text = "Button 3", name = "button003")
>>> # style widget is "button003.TButton"
>>> b4 = Button(extend = True, text = "Button 4", name = "button004", style = "TButton")
>>> # style widget is "TButton"b1 and b2 can only be configured with ttk::style configure commandb3 and b4 can configure themselves with __setattr__ and configure functionsb1 and b4 are default button i.e. modifications affect all buttonsLimitationsThere are many themes defined in tile (or Tk 8.5). The winnative and xpnative  ones
do not allow modification for all widget options. Just see the example below :>>> # other way to configure widget is to give a dictionary...
>>> cnf = dict(
... # relief is not supported in "xpnative" and "winnative" theme
... relief = "solid",
... # options supported by all theme
... anchor = "center",
... font = ("Tahoma", "8", "bold"),
... foreground = "steelblue3",
... background = "lightgreen",
... command = exit,
... text = "Flat button",
... padding = (5, 1, 5, 1)
... )For each theme fo Tile :>>> Button(None, cnf).pack(fill = "x", padx = 5, pady = 5)Windows themes :Other themes :
Package: yawxt
Yet Another WeiXin(wechat) Toolkitgithub：https://github.com/lspvic/yawxt/文档：https://yawxt.readthedocs.io/实体对象消息对象yawxt.Message用户对象yawxt.User位置对象yawxt.Location使用数据对象可以很好的管理和访问微信数据资源，如:user.nickname, user.headimgurl, user.city
location.latitude, location.longitude, location.time
message.msg_type, message.msg_id, message.create_time公众号API类yawxt.WxClient封装公众号API>>>fromyawxtimportWxClient>>>client=WxClient("appid","appsecret")>>>it=client.get_openid_iter()>>>openid=next(it)>>>openid'o9KLls70ReakhjebmHUYxjbz9K8c'>>>user=client.get_user(openid)>>>user{"openid":"o9KLls70ReakhjebmHUYxjbz9K8c","nickname":"yawxt",...}>>>user.city'杭州'消息对话类yawxt.MessageHandler处理接收消息事件fromyawxtimportMessageHandler,WxClient,check_signature# 定义消息回复内容classHandler(MessageHandler):# 当收到一条文本消息时defon_text(self,text):# 回复一条文本消息# 可以使用已定义的user对象self.reply_text("你好:%s"%self.user.nickname)# 当收到地理位置上报事件时defevent_location(self,location):# 保存地理位置redis.hset("location::%s"%self.openid,{"lat":location.latitude,"lon":location.longitude})# 当收到一条图片消息时defon_image(self,media_id,pic_url):# 可以调用公众号API，下载到本地r=self.client.download_image(media_id)withopen("/path/to/images/%s.jpg"%media_id,"rb")asf:f.write(r.content)# 回复同样的图片self.reply_image(media_id)client=WxClient(appid,secret,token)# 在web框架中回复消息，以Flask为例app=Flask(__name__)session_maker=sessionmaker(bind=engine)token="token"# 公众号后台配置Token@app.route('/wechat',methods=["GET","POST"])defwechat():signature=request.args.get('signature')timestamp=request.args.get('timestamp')nonce=request.args.get('nonce')ifnotcheck_signature(token,timestamp,nonce,signature):return"Messages not From Wechat"ifrequest.method=="GET":returnrequest.args.get('echostr')msg=PersistMessageHandler(request.data,wechat_account,db_session_maker=session_maker,debug_to_wechat=app.debug)returnmsg.reply()消息持久化使用类yawxt.persistence.PersistMessageHandler，不做任何处理就能够直接将接收的消息、
用户信息、上报位置信息保存到数据库中：fromyawxt.persistenceimportPersistMessageHandlerSession=session_maker(bind=engine)message=PersistMessageHandler(content,client=client,db_session_maker=Session,debug_to_wechat=True)return_str=message.reply()继承PersistMessageHandler，只关注自己的处理逻辑，所有消息的接收
与发送都持久化到数据库中了。更多的例子在examples文件夹下面安装使用pip安装yawxt:pip install yawxt如果要使用消息持久化，还需要安装sqlalchemy及数据库驱动，如mysql的PyMySQL：pip install sqlalchemy PyMySQL
Package: yaxp
yet another xpath generatorCreate an xpath with an chainable and intuitive API.QuickstartCreate the most simple xpath for adivelement:fromyaxpimportxpath# //divxpath.divxpath objects are chainable:# //div//h1xpath.div.h1Any keyword argument you pass will add a filter for an
attribute with the name and value of the keyword:# //div[@role="cell"]xpath.div(role="cell")Alternatively, use theby()method to specify attributes:# //*[@class="main"]xpath.by(_class="main")An_at the beginning of the attribute name will be
removed, this is helpful for attributes that represents
python keywords like "class" or "id":# //div[@class="cell"][@id="myid"]xpath.div(_class="cell",_id="myid")If the value of an attribute starts with an asteric (*), the xpath matches
any element that has the following text as a substring in this attribute# //div[contains(@class, 'mycl')]xpath.div(_class="*mycl")Alternatively, you can use thecontains()function to filter for subtrings.
the following statement is equal to the above:# //div[contains(@class, 'mycl')]xpath.div.contains(_class="mycl")xpath supports "nested predicates", i.e. you can filter for specific sub-elements,
while the xpath itself will point to the parent element (div in this example):# //div[./span[@class='mycl']]xpath.div.has(xpath.span(_class="mycl"))Nested predicates are chainable:# //div[./span[@class='mycl'][./p[text()="hello"]]]xpath.div.has(xpath.span(_class="mycl")).has(xpath.p(text="hello"))As you can see in the example above, a text attribute will be converted to "text()".
In order to avoid this, use "_":# //p[@text="hello"]]]xpath.p(_text="hello"))An "_" attrbute will be converted to ".":# //p[contains(., "world")]xpath.p(_="*world")If the value of an attribute starts with a hashtag (#), the xpath matches
any element that has the following text as afull wordin this attribute:# //div[contains(concat(' ', normalize-space(@class), ' '), ' myclass ')]xpath.div(_class="#myclass")Any combination of the features are allowed:# //span[contains(@class, "mycl")][@placeholder="huhu"]xpath.span(_class="*mycl",_placeholder='huhu')An_in the role will be converted to a ".":# //Android.Container[@id="huhu"]xp.Android_Container(_id="huhu")Use double__if you need an_:# //Android_Container[@id="huhu"]xp.Android__Container(_id="huhu")Further readingThe xpath cheat sheet
Package: yayaroot
TikUpAn auto downloader and uploader for TikTok profiles.RequirementsTikTok-Api,internetarchive, andyoutube-dlon Python 3.How to InstallInstall withpip install tikup.How to Useusage: tikup.py [-h] [--no-delete] [--hashtag] [--limit LIMIT]
                [--use-download-archive] [--id] [--liked] [--sort]
                user

An auto downloader and uploader for TikTok videos.

positional arguments:
  user

optional arguments:
  -h, --help            show this help message and exit
  --no-delete           don't delete files when done
  --hashtag             download hashtag instead of username
  --limit LIMIT         set limit on amount of TikToks to download
  --use-download-archive
                        record the video url to the download archive. This
                        will download only videos not listed in the archive
                        file. Record the IDs of all downloaded videos in it.
  --id                  download this video ID
  --liked               download the user's liked posts
  --sort                sort into folders based on TikTok username
Package: yayc
yaycYet another YAML-based configurator library. Meant for BurstCube and the COSI Telescope, but maybe useful for other projects.Reading a config filefromyaycimportConfiguratorimportyayc.test_datac=Configurator.open(yayc.test_data.path/"config_example.yaml")c['section:param_int']1c['section:param_float']1.0c['section:param_string']'a'c['section:param_list'][0, 1, 2, 3]c['section:param_list2']['a', 'b', 'c']Overriding a parameterUsually you have command line programs like thismy_app -c config_example.yaml --foo barYou might want to let the user to change the behavior, but also don't want to set a bunch of flags for each option. It's also cumbersome to modify the config file for each run.You can have a generic flag that the user can use to change any behavior, e.g.my_app -c config_example.yaml --override "section:param_int = 2" "section:param_string = b"You can parse this usingargparseand pass the input to--overrideto theConfiguratorobject:override_input=["section:param_int = 2","section:param_string = b"]c.override(*override_input)c["section:param_int"]2c['section:param_string']'b'Relative pathsIt is usually desirable to keep other configuration files together with the yaml file and other logs. this makes it easier to reproduce results. To facilitate this, always use paths relativeto the config file, not relative to where you executed the progam. Then use this:c.absolute_path(c['section:param_path'])PosixPath('/Users/israel/work/software/yayc/yayc/test_data/my_file.txt')LogsIt's good practice to dump the config file, after any override, to the logs:withopen('test.log','w')asf:f.write(c.dump())Dynamic initializationThis is a little more advanced. In general, you can initialize any object on the fly if you know the module, the name of the class and the input parameters. We can use this to dynamically instantiate an object of an arbitrary class:# Creating dummy classes in the current module (__main__)import__main__classClassA:def__init__(self,*args,**kwargs):self._args=argsself._kwargs=kwargsdef__repr__(self):returnf"ClassA(args ={self._args}, kwargs ={self._kwargs})"classClassB:def__init__(self,*args,**kwargs):self._args=argsself._kwargs=kwargsdef__repr__(self):returnf"ClassB(args ={self._args}, kwargs ={self._kwargs})"Initialize the objet on the flyobjects={label:getattr(__main__,params['class'])(*params['args'],**params['kwargs'])forlabel,paramsinc['dynamic_init'].items()}print(objects){'objectA': ClassA(args = (1, 'a'), kwargs = {'foo': 2, 'bas': 'b'}), 'objectB': ClassB(args = (), kwargs = {'foo': 3})}