Saravanan666/pypi-org huggingface dataset:
Package: playwright-apirequest-builder
:performing_arts:PlaywrightAPIRequestbuilderDocumentedRead it here:link: documentationRead more about thebuilder patternon:link: refactoring.guruExample# sync examplefromplaywright.sync_apiimportsync_playwrightfromplaywright_request.sync_builderimportRequestBuilderwithsync_playwright()asp:builder=RequestBuilder(p,base_url='https://playwright.dev/')request=builder.get("python/docs/intro").create_request()response=request()print(response.text())# async exampleimportasynciofromplaywright.async_apiimportasync_playwrightfromplaywright_request.async_builderimportRequestBuilderasyncdefmain():asyncwithasync_playwright()asp:builder=RequestBuilder(p,base_url='https://playwright.dev/')request=builder.get("python/docs/intro").create_request()response=awaitrequest()print(awaitresponse.text())asyncio.run(main())RequirementsPython3Playwright >= 1.26.0
Package: playwright-dompath
Playwright DOMPath for Python 🎭This library implements the ChromeDevTools DOMPath functionality in Playwright.This means that you can retrieve the CSS selector or the XPath of any element you select in your Playwright code as a Locator.Typescript version here:https://github.com/alexferrari88/playwright-DOMPathInstallation 📦Install with pippipinstallplaywright-dompathAPI Reference 📚css_pathcss_path:(element:Playwright.Locator,optimized:bool=True)->strxpath_pathxpath_path:(element:Playwright.Locator,optimized:bool=True)->strUsage 🔧Just import thecss_pathorxpath_pathfrom this module.At the moment the tested version is the dompath_sync one while there is dompath_async, it has not been tested yet.fromplaywright_dompath.dompath_syncimportcss_path,xpath_pathThen use either function by passing it the element you previously selected as a Locator:searchBar=page.locator('input[name="q"]')print("CSS Path:",css_path(searchBar))print("XPath:",xpath_path(searchBar))Full Example 🎁fromplaywright.sync_apiimportsync_playwrightfromplaywright_dompath.dompath_syncimportcss_path,xpath_pathwithsync_playwright()asp:url="https://google.com"browser=p.chromium.launch()page=browser.new_page()page.goto(url)searchBar=page.locator('input[name="q"]')print("CSS Path:",css_path(searchBar))print("XPath:",xpath_path(searchBar))browser.close()Which will output (class names may vary for you):CSSPath:body>div.L3eUgb>div.o3j99.ikrT4e.om7nvf>form>div:nth-child(1)>div.A8SBwf>div.RNNXgb>div>div.a4bIc>input
XPath:/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/inputTODO ✅Increase tests coverage (include edge cases and async)Add better error handlingContributing 🤝🏼Feel free to fork this repo and create a PR. I will review them and merge if ok.The above todos can be a very good place to start.Acknowledgements 🤗This library reimplements theChrome DevTools DOMPath librarywith modifications to allow the use of Playwright's ElementHandle and LocatorCSS.escape polyfillLicense 📝MIT
Package: playwrightgym
PlaywrightGym - Train RL Agents for Web tasksWeb-Browser-based learning environments for Deep Reinforcement Learning.Usageimportgymimportplaywrightgymenv=gym.make("LoginFormVisual-v0")Examplesexamples/demonstrator.py: Starter class to get human/manual demonstrationsexamples/gather_demonstrations.py: Starter script to gather human/manual demonstrations and store in RLLib-compatible file format for offline RLDev SetupInstallpython-poetry:curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -Clone andcdto this projects:git clone https://github.com/praveen-palanisamy/playwrightgym && cd playwrightgymActivate python venv:poetry shellInstall dependencies andplaywrightgymin editable mode:poetry installInstall browsers for playwright:playwright installReady!
Package: playwright-har-tracer
playwright-har-tracerA Python implementation version of Playwright's HAR tracer.
It is equivalent to playwrightv0.13.x’s HAR tracer implementation.MotivationPlaywright's HAR tracer is implemented to generate HAR as a file. I need to get HAR as a Python object rather than a file.playwright-har-tracer's HarTracer generates HAR as a dataclass object.⚠️ LimitationsTested with Python 3.8+Tested with Chromium onlySupports the async API onlyInstallationpipinstallplaywright-har-tracerUsageimportasynciofromplaywright.async_apiimportasync_playwrightfromplaywright_har_tracerimportHarTracerasyncdefmain():asyncwithasync_playwright()asp:browser=awaitp.chromium.launch()context=awaitbrowser.new_context()tracer=HarTracer(context=context,browser_name=p.chromium.name)page=awaitcontext.new_page()awaitpage.goto("http://whatsmyuseragent.org/")har=awaittracer.flush()awaitcontext.close()awaitbrowser.close()print(har.to_json())asyncio.run(main())
Package: playwrighting
PlaywrightINGGet your ING bank account data.This works for ING ES (Spain), for another country page you will have to change some values in constants.py and some and
selectors.py.Installpip install playwrightingCommandsTo inspect all CLI commands use:pyingInitThis command will initialize the app, scraping your bank data from your account and creating an internal file that will
have your global position (cards, accounts and transactions).pying initUpdateThis command will try to update your account info, if there are some changes. You can force the update with parameter
--force.pying update [--force]DownloadFiles (csv) with your accounts transactions will be downloaded in the specified download_path or supplied parameter
--download path.pying download [--download_path PATH]ShowInteractive prompt to show position, accounts or transactions information.pying showBuildpoetry build
Package: playwright-project
Playwright and PytestInstall Pytest Pluginpip install pytest-playwrightInstall the required browsersplaywright installtest_example.pytest exampleRunning the Example TestpytestUsing Test Hooksimportpytestfromplaywright.sync_apiimportPage,expect@pytest.fixture(scope="function",autouse=True)defbefore_each_after_each(page:Page):print("before the test runs")# Go to the starting url before each test.page.goto("https://playwright.dev/")yieldprint("after the test runs")deftest_main_navigation(page:Page):# Assertions use the expect API.expect(page).to_have_url("https://playwright.dev/")Running tests headedpytest --headedRunning tests on different browsers and multiple browserpytest --browser webkitpytest --browser webkit --browser firefoxRunning specific testspytest test_login.pyTo run a set of test files pass in the names of the test files that you want to run.pytest tests/test_todo_page.py tests/test_landing_page.pyTo run a specific test pass in the function name of the test you want to run.pytest -k test_add_a_todo_itemRun tests in Parallelpytest --numprocesses 2
Package: playwright-spy
playwright-spy [A plugin forplaywright-pythonto prevent detection.Installpipinstallplaywright-spyUsagePagefromplaywright.sync_apiimportsync_playwrightimportplaywright_spywithsync_playwright()asp:browser=p.chromium.launch()page=browser.new_page()playwright_spy.load_sync(page)page.goto("https://bot.sannysoft.com/")page.screenshot(path="example.png",full_page=True)browser.close()Contextfromplaywright.sync_apiimportsync_playwrightimportplaywright_spywithsync_playwright()asp:browser=p.chromium.launch()context=browser.new_context()playwright_spy.load_sync(context)page=context.new_page()page.goto("https://bot.sannysoft.com/")page.screenshot(path="example.png",full_page=True)browser.close()
Package: playwright-stealth
playwright_stealthTransplanted frompuppeteer-extra-plugin-stealth,Not perfect.Install$ pip install playwright-stealthUsagesyncfromplaywright.sync_apiimportsync_playwrightfromplaywright_stealthimportstealth_syncwithsync_playwright()asp:forbrowser_typein[p.chromium,p.firefox,p.webkit]:browser=browser_type.launch()page=browser.new_page()stealth_sync(page)page.goto('http://whatsmyuseragent.org/')page.screenshot(path=f'example-{browser_type.name}.png')browser.close()async# -*- coding: utf-8 -*-importasynciofromplaywright.async_apiimportasync_playwrightfromplaywright_stealthimportstealth_asyncasyncdefmain():asyncwithasync_playwright()asp:forbrowser_typein[p.chromium,p.firefox,p.webkit]:browser=awaitbrowser_type.launch()page=awaitbrowser.new_page()awaitstealth_async(page)awaitpage.goto('http://whatsmyuseragent.org/')awaitpage.screenshot(path=f'example-{browser_type.name}.png')awaitbrowser.close()asyncio.get_event_loop().run_until_complete(main())Test resultsplaywright with stealthplaywright without stealth
Package: playwright-trace-browser
playwright-trace-browserOverviewA TUI app for exploring Playwright tracesGetting StartedInstallplaywright-trace-browser:pip install playwright-trace-browserA simple example:importplaywright_trace_browser# Do something with playwright_trace_browserSee amore in-depth tutorial here.LinksSee thedocumentation here.Development StatusThis project is currently in early-stage development. There may be
breaking changes often. While the major version is 0, minor version
upgrades will often have breaking changes.DevelopingSee thedevelopment guidefor development details.AuthorCreated by Nick DeRobertis. MIT License.
Package: plbdays
Simple functions showing information about business days in Poland.isBusinessDay() - Returns True or False if the day is a business dayExamples
Default: isBusinessDay () or isBusinessDay (today)
isBusinessDay('2011-11-11')lastBD() - Returns the last business dayExamples
Default: lastBD() or lastBD('today') - The last business day of today
lastBD('2011-11-11')BDays_list(start_date, end_date) - returns a list with True and False values for a given range of daysExamples
BDays_list('2021-01-01', '2021-12-31')Change Log0.0.01 (27/11/2021)-First Release
Package: plcd
plcd - A lightweight PLC uptime monitor$ python3 -m pip install --upgrade plcdPackage on PyPIFeaturesUptime detection, monitoring, and loggingAutomatic port sniffing and controller detectionRequirementsPython 3.7 or higher# apt-get install python3Pin 22.04 or higher# apt-get install python3-pipNetwork connection to PLCUsageInstall using pip:$python3-mpipinstall--upgradeplcdRun as a python package:$python3-mplcdSupported ControllersAll major PLC protocols, see thelist of controllersfor detailsBuild from sourceLinux/macOSgitclonehttps://github.com/LibreCS/plcdcdplcd
python3-mpipinstall--upgradebuild
python3-mbuildWindowsgitclonehttps://github.com/LibreCS/plcdcdplcd
py-mpipinstall--upgradebuild
py-mbuildFuture FeaturesMulti-controller monitoringController state monitoringDocker integration for continuous monitoringContributingThis project is written in Python and is a great place to start contributing to open-source. Feel free to check the issues tab or implement your own features.Contributorscpstrommen|tcun
Package: plcopen
Python PLCopenXMLA Python class model forPLCopen XML.The class model has been generated withxsdata. Xsdata can also be used to parse/serialize PLCopen XML files to/from the class model.To be able to parse PLCopen XML files generated by Codesys, the class model also contains some manually created classes for Codesys-specific stuff.Usagefromplcopenimport*# parsing an existing PLCopen XML filewithopen(path_to_plcopen_xml_file,'rb')asplcopen_xml_file:content=plcopen_xml_file.read()parser=XmlParser(context=XmlContext())returnparser.from_bytes(content,Project)# working on the parsed projectfirst_pou=plcopen_project.types.pous[0]# serializing the projectwithopen(path_to_plcopen_xml_file,'w')asplcopen_xml_file:serializer=XmlSerializer(context=context)serializer.config.pretty_print=Truecontent=serializer.render(project)serializer.write(content)Note: More information about parsing and serializing can be found in thexsdata docs.
Package: plct-bulder-for-sphinx
Petlja Builder for SphinxThis custom Sphinx builder, namedPLCTBuilder, extends the functionality of theStandaloneHTMLBuilderto meet specific requirements for packaging content into various formats, such as bare HTML, Moodle backup, or SCORM.Key FeaturesContent URI and PlayerThecontent_uriis used by a small web app called a "player" that allows you to navigate through the course. The builder attempts to remove the sidebar, footer, and nav bar by disabling them using Sphinx theme variables. This streamlined content is then packaged up and served on other platforms inside SCORM packages. The player is aware of the architecture of your Sphinx project and just needs the web address specified incontent_urito function correctly.This allows your students to follow the course on any platform that implements SCORM standard.Bare HTML ContentThe builder provides the ability to generate HTML content suitable for integrating into an e-learning platform.Moodle BackupThe builder supports packaging content in a format suitable for Moodle (provides you with a moodle backup file).SCORMThe builder not only facilitates the creation of SCORM-compliant packages, but it also generates two types of packages. One is a holistic package that includes all lectures. The other type is a segmented package, where all the lectures are split up. This allows you to pick and choose which lectures to import, offering flexibility in content selection. When we refer to a "lecture", we are referring to a section that is one level below Sphinx's toc top level.Hosting RequirementsFor the builder to function correctly and display your content on a CMS or eLMS, you need to host your content online. The builder requires a reachable URL to access and display the content generated.Usage# conf.py# Import the Petlja Builder extensionextensions=['plct-bulder-for-sphinx.builder.plct_builder']To generate content, use the following command:sphinx-build-bplct_buildersourceoutputConfigurationCustomize the behavior of the builder by updating the Sphinx configuration:# conf.py# Set the content URIcontent_uri='your_content_uri'# Specify additional build targets (e.g., 'moodle', 'scorm')additional_build_targets=['moodle','scorm']LicenseThis custom Sphinx builder is licensed under theMIT License. Feel free to adapt and extend it based on your specific requirements.
Package: plct-cli
PLCT CLI AppThis Command-Line Interface (CLI) app, named PLCT (Petlja Learning Content Tools), provides a set of commands to streamline the management and generation of learning content using Sphinx.InstallationClone the repository:pipinstallplct-cliCommandsbuildGenerate learning content usingsphinx-build. You have the option to pass specific options to Sphinx using the-soflag. If no options are passed, they will be deduced or read from theplct_configfile.plctbuild[-so<sphinx-options>][-sf<sphinx-files>]-so,--sphinx-options: Specify additional options for Sphinx-build.-sf,--sphinx-files: Specify filenames for Sphinx-build.previewStarts a local server usingsphinx-autobuild. The root of this server corresponds to the root of the generated content. This allows you to edit files in the source directory and see the changes reflected in real-time on the server, as it will automatically refresh the content.plctpreview[-so<sphinx-options>]-so,--sphinx-options: Specify additional options for Sphinx-autobuild.publishPublish learning content. Provides an easy way to create doc folder that can be used as the root for git hub pages.plctpublishcleanClean the generated output directory.plctcleanget_markdownCommand zips all markdown files from the source directory.plctget_markdownConfigurationThe app tries to determine the command arguments (source and output directories) of the sphinx command based on the project file structure. You can also specify these configurationsplct_config.yaml.LicenseThis CLI app is licensed under theMIT License. Feel free to customize and extend it according to your needs.
Package: pld-accountant
Fourier AccountantMIGRATED TOfourier-accountant- any new releases will go therePython code for computing tight DP-guarantees for the subsampled Gaussian mechanism.The method is described in:Antti Koskela, Joonas Jälkö, Antti Honkela:
Computing Tight Differential Privacy Guarantees Using FFThttps://arxiv.org/abs/1906.03049
Package: pleasant-promises
Pleasant python promisespipinstallpleasant-promisesPython promises are a thing, really! But they get ugly quickly. This package lets you handle promises using generator syntax.Here's what using 3 sequential promises looks like without this package:defresolve_greatgrandparent(person,info):parent_prom=person_loader.load(person.parent_id)defhandle_parent(parent):grandparent_prom=person_loader.load(parent.parent_id)defhandle_grandparent(grandparent):returnperson_loader.load(grandparent.parent_id)returngrandparent_prom.then(handle_grandparent)returnparent_prom.then(handle_parent)And now with this package,frompleasant_promisesimportgenfunc_to_prom@genfunc_to_promdefresolve_greatgrandparent_name(person,info):parent=yieldperson_loader.load(person.parent_id)grandparent=yieldperson_loader.load(parent.parent_id)great_grandparent=yieldperson_loader.load(grandparent.parent_id)returngreat_grandparentUsage with Graphql/GrapheneIf you're using promises, you're probably also using graphene or at least graphql. There are a few other helpers in here to help with your graphql schema,DataloadersThis package has a useful subclass wrapper of the promise package'sDataloader. You can overload itsbatch_loadmethod with a generator function. This is useful if you want call another dataloader within batch_load. This class will also convert non-promise values to promises, which is required by the API we're wrapping.frompleasant_promises.dataloaderimportDataloaderclassGrandparentLoader(DataLoader):defbatch_load(self,keys):parents=yieldperson_loader.load_many(keys)grandparents=yieldperson_loader.load_many(parent.parent_idforparentinparents)# ...You'll still have to decorate other dataloader methods with@genfunc_to_prom, though:frompleasant_promisesimportgenfunc_to_promclassGrandparentLoader(DataLoader):@genfunc_to_promdefget_grandparent_for_single_key(self,key):parent=yieldperson_loader.load(key)grandparent=yieldperson_loader.load(parent.parent_id)returngrandparentdefbatch_load(self,keys):returnPromise.all([self.get_grandparent_for_single_key(key)forkeyinkeys])Graphene middlewareWithout the middleware, you'll have to decorate all your resolvers that want to use the generator syntax.frompleasant_promisesimportgenfunc_to_promclassMyPersonType(graphene.ObjectType):# ...@genfunc_to_promdefresolve_grandparent(self,info):parent=yieldperson_loader.load(person.parent_id)grandparent=yieldperson_loader.load(parent.parent_id)returngrandparentTo avoid repeating this decorator on all your resolvers, use our pleasant middlewarefrompleasant_promises.grapheneimportpromised_generator_middlewaremy_graphene_schema.execute('THE QUERY',middleware=[promised_generator_middleware])
Package: please-readme
Please ReadmePlease readme is the ultimate package for those who like to develop, not stay up all night formatting their readme. Please Readme is a simple, yet flexible tool to generate readmes from the command line or readme classes with python if you so desire.You can think of it as an easy readme generator from the command line. It is easy to use and the python API allows for lots of flexibility.Make sure to check out the documentation athttps://github.com/mrmaxguns/please-readme/wikiInstallationInstall with pip:pip install please-readmeTo upgrade the package:pip install please-readme --upgradeUsing the Python APIImporting the readme classes:frompleasereadmeimportgenerate_readmeHere is an example on using theCustomReadmeclass. You can also create your own readme classes that inherit theCustomReadmeclass. Make sure to check out thedocumentationfor all classes, methods, etc. available.frompleasereadmeimportgenerate_readmedata=[# Lists of tuples are used to represent readme data because dictionaries are unordered(# Each section is in the form of a tuple"Installation",# Section title[("0",["text","Install using pip"]),# A subsection: (section_id, [datatype, data])("1",["code","pip install my_package"])# Many data types such as multi-line-code and ul exist]),(# Another section"Requirements",[("0",["ul",["Python 3.6 or greater","numpy"]])])]my_template=generate_readme.CustomReadme('My Package',"A wonderful package",data)# Title, description, sectionsmy_template.create()# Create a file called README.md in the current directoryThe following code would create a file calledREADME.mdwith the following inside:# My Package
A wonderful package

## Installation
Install using pip
```pip install my_package```

## Requirements
* Python 3.6 or greater
* numpyUsing the command lineAn easy command line interface exists to generate readmes straight from the command line. See thecommand line documentationfor more info on how to generate the README. The keyword to run the CLI is pleasereadme:usage: pleasereadme [-h] [-v] [-p]A little bit about the optional arguments-h or --help: open the help menu
-v or --version: display the current version
-p or --print print the markdown instead of creating a readme fileThe commandpleasereadmewill bring up questions about your readme that you can fill out. A readme file will then be generated depending on the path you specified.LicenseMit LicenseContributorsMaxim R.-initial work-mrmaxgunsDocumentationPlease read the documentation to learn about the different features of pleasereadme. We are constantly growing so please also check our github page out if you want to contribute.Documentation:https://github.com/mrmaxguns/please-readme/wikiGithub Page:https://github.com/mrmaxguns/please-readme/
Package: plectrum
Interactively select items from a list in a terminal.DocumentationFull documentation, including installation and setup guides, can be found athttp://plectrum.readthedocs.ioIssue trackerFound a bug? Have an idea on how to make the tool better?Post it athttps://gitlab.com/4degrees/plectrum/issuesCopyright and licenseCopyright (c) 2017 Martin Pengelly-PhillipsLicensed under the Apache License, Version 2.0 (the “License”); you may not use
this work except in compliance with the License. You may obtain a copy of the
License in the LICENSE.txt file, or at:http://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: pleione
# pleionePleione is a python3 package that implement methods that are common to
traditional modeling frameworks, and apply them to analyze Rule-Based Models.Here you’ll find the necessary documentation to install and use the methods in
Pleione. At the moment, Pleione parameterizes Rule-Based Models written either
inBioNetGen(https://www.csb.pitt.edu/Faculty/Faeder/?page_id=409) orkappalanguage (https://www.kappalanguage.org/). Models are simulated with BNG2
(https://github.com/RuleWorld/bionetgen, PMID 27402907), NFsim
(https://github.com/RuleWorld/nfsim, PMID 26556387), KaSim
(https://github.com/Kappa-Dev/KaSim, PMID 29950016), or PISKaS
(https://github.com/DLab/PISKaS, PMID 29175206). Please contact us or write an
issue to include your favorite stochastic simulator to Pleione
(https://github.com/glucksfall/pleione/issues).Pleione implements a Genetic Algorithm with elitism, on the contrary to
BioNetFit (https://github.com/RuleWorld/BioNetFit, PMID 26556387) that
implements a parents selection within a distribution probability that is inverse
to the rank. Nonetheless, Pleione’s methods to parameterize Rule-Based Models
include both, a uniform or inverse to the rank probability to select models from
within an elite or all models.Examples to run Pleione are located inhttps://github.com/glucksfall/pleione/tree/master/exampleand in the python distribution wheel. The table with the U-test critical values is
located at the same folder and in subfolders.The plan to add methods into Pleiades (https://github.com/glucksfall/pleiades)
includes a sensitivity analysis and a parameterization employing a Particle
Swarm Optimization protocol. You could write us if you wish to add methods into
pleione or aid in the development of them.