Saravanan666/pypi-org huggingface dataset:
Package: pyselenium-framework
SeleniumFrameworkBackgroundsWell, when i looked into my previous codes, I found 6 years back (Dec.2012) when I just joined Autodesk, I wrote a Selenium Framework which was used by several teams within Autodesk.Now 6 years passed and I already left Autodesk, maybe it's time to share to Github, lol.This framework provides a way to code Selenium Automation with Layers instead of wrting un-resuable and un-readable codes.
Suggested layers are:Pages: define elements and pagesActions: define test actions using web elements defined in "pages"Test Cases: combination of actionsI made some tests these days and prooved these codes can be executed from Mac using Python 3.6.If I have time, i will work on the follwoing:HTML reportsmake it more compatible with Firefox on Windows or Linuxtest headlessDon't laugh at me if codes looks ugly for you, i wrote it 6 years ago, lolUsage1. Install this package:pip install pyselenium-framework2. Create a folder under your application to store Chrome/Firefox binary files, let's say folder called:driver_binary_files3. Download binary files and put them there.Example: Chrome driver can be downloaded from:http://chromedriver.chromium.org/downloads4. Start to build your awesome project simply by:import selenium_frameworkSample Code and StructuresTBD later, but in the meantime, please refer to "AUT" folder
Package: py-selenium-scrapy
Scrapy with seleniumScrapy middleware to handle javascript pages using selenium.Installation$ pip install scrapy-seleniumYou should usepython>=3.6.
You will also need one of the Seleniumcompatible browsers.ConfigurationAdd the browser to use, the path to the driver executable, and the arguments to pass to the executable to the scrapy settings:fromshutilimportwhichSELENIUM_DRIVER_NAME='firefox'SELENIUM_DRIVER_EXECUTABLE_PATH=which('geckodriver')SELENIUM_DRIVER_ARGUMENTS=['-headless']# '--headless' if using chrome instead of firefoxOptionally, set the path to the browser executable:python SELENIUM_BROWSER_EXECUTABLE_PATH = which('firefox')In order to use a remote Selenium driver, specifySELENIUM_COMMAND_EXECUTORinstead ofSELENIUM_DRIVER_EXECUTABLE_PATH:python SELENIUM_COMMAND_EXECUTOR = 'http://localhost:4444/wd/hub'Add theSeleniumMiddlewareto the downloader middlewares:DOWNLOADER_MIDDLEWARES={'scrapy_selenium.SeleniumMiddleware':800}UsageUse thescrapy_selenium.SeleniumRequestinstead of the scrapy built-inRequestlike below:fromscrapy_seleniumimportSeleniumRequestyieldSeleniumRequest(url=url,callback=self.parse_result)The request will be handled by selenium, and the request will have an additionalmetakey, nameddrivercontaining the selenium driver with the request processed.defparse_result(self,response):print(response.request.meta['driver'].title)For more information about the available driver methods and attributes, refer to theselenium python documentationTheselectorresponse attribute work as usual (but contains the html processed by the selenium driver).defparse_result(self,response):print(response.selector.xpath('//title/@text'))Additional argumentsThescrapy_selenium.SeleniumRequestaccept 4 additional arguments:wait_time/wait_untilWhen used, selenium will perform anExplicit waitbefore returning the response to the spider.fromselenium.webdriver.common.byimportByfromselenium.webdriver.supportimportexpected_conditionsasECyieldSeleniumRequest(url=url,callback=self.parse_result,wait_time=10,wait_until=EC.element_to_be_clickable((By.ID,'someid')))screenshotWhen used, selenium will take a screenshot of the page and the binary data of the .png captured will be added to the responsemeta:yieldSeleniumRequest(url=url,callback=self.parse_result,screenshot=True)defparse_result(self,response):withopen('image.png','wb')asimage_file:image_file.write(response.meta['screenshot'])scriptWhen used, selenium will execute custom JavaScript code.yieldSeleniumRequest(url=url,callback=self.parse_result,script='window.scrollTo(0, document.body.scrollHeight);',)
Package: pyselfi
pySELFISimulator Expansion for Likelihood-Free Inference (SELFI): a python implementation.DocumentationThe code's homepage ishttps://pyselfi.florent-leclercq.eu. The documentation is available on readthedocs athttps://pyselfi.readthedocs.io/. Limited user-support may be asked from the main author, Florent Leclercq.ContributorsFlorent Leclercq,florent.leclercq@iap.frReferenceTo acknowledge the use of pySELFI in research papers, please cite itsdoi:10.5281/zenodo.3341588(or for the latest version, see the badge above), as well as the papersLeclercqet al.(2019)andLeclercq (2022):Primordial power spectrum and cosmology from black-box galaxy surveysF. Leclercq, W. Enzi, J. Jasche, A. HeavensMNRAS490, 4237 (2019),arXiv:1902.10149[astro-ph.CO] [ADS] [pdf]Simulation-based inference of Bayesian hierarchical models while checking for model misspecificationF. LeclercqProceedings of the41st International Conference on Bayesian and Maximum Entropy methods in Science and Engineering (MaxEnt2022), 18-22 July 2022, Paris, FrancePhysical Sciences Forum5, 4 (2022),arXiv:2209.11057[astro-ph.CO] [ADS] [pdf]@ARTICLE{pySELFI1,
      author = {{Leclercq}, Florent and {Enzi}, Wolfgang and {Jasche}, Jens and {Heavens}, Alan},
      title = "{Primordial power spectrum and cosmology from black-box galaxy surveys}",
      journal = {\mnras},
      keywords = {methods: statistical, cosmological parameters, large-scale structure of Universe, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics},
      year = "2019",
      month = "Dec",
      volume = {490},
      number = {3},
      pages = {4237-4253},
      doi = {10.1093/mnras/stz2718},
      archivePrefix = {arXiv},
      eprint = {1902.10149},
      primaryClass = {astro-ph.CO},
      adsurl = {https://ui.adsabs.harvard.edu/abs/2019MNRAS.490.4237L},
      }

  @ARTICLE{pySELFI2,
      author = {{Leclercq}, Florent},
      title = "{Simulation-based inference of Bayesian hierarchical models while checking for model misspecification}",
      journal = {Physical Sciences Forum},
      keywords = {Statistics - Methodology, Astrophysics - Instrumentation and Methods for Astrophysics, Mathematics - Statistics Theory, Quantitative Biology - Populations and Evolution, Statistics - Machine Learning},
      year = "2022",
      month = "Sep",
      volume = {5},
      pages = {4},
      doi = {10.3390/psf2022005004},
      archivePrefix = {arXiv},
      eprint = {2209.11057},
      primaryClass = {stat.ME},
      adsurl = {https://ui.adsabs.harvard.edu/abs/2022arXiv220911057L},
      }LicenseThis 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. By downloading and using pySELFI, you agree to theLICENSE, distributed with the source code in a text file of the same name.
Package: pyselfmongo
Py Self MongoA self mongo client for the [MongoDB][mongo] database is a thin client that connects to a mongo server and provides a simple interface to the database.
A client is written as a singleton to make sure that only one connection is open at a time. The connection timeout is taken care by checking the server info every time a request is made.
A new connection is made if the server info is not available or the connection has timed out. The project is developed using poetry and the [Pytest][pytest] framework.How to useCreate a config file with name.mongo_config.yamlin the root directory of the project. The config file should contain the following fields:mongo:host:localhostport:27017db_name:db_namepassword:passwordusername:usernameThe host can be an IP address or a hostname. E.g. In case of a hosted mongo server in aws, the hostname isec2-*-**-**-**.**-east-2.compute.amazonaws.com.
The client can be used as follows:frompyselfmongoimportPySelfMongomongo_client=PySelfMongo()mongo_client.get_collection('collection_name')If no config file is found, the client will try to connect to the localhost with default port 27017. In this case the client can be intialized as follows:frompyselfmongoimportPySelfMongomongo_client=PySelfMongo(db_name='db_name',username='user_name',password='password')mongo_client.get_collection('collection_name')Methods and attributesget_collection(collection_name): Returns a collection object.get_document_by_id(collection_name, document_id): Returns a document object.get_document_by_query(collection_name, query): Returns a list of document objects.get_document_by_query_with_projection(collection_name, query, projection): Returns a list of document objects.get_all_document_generatosr(collection_name, filter): Returns a generator of all documents in the collection.delete_document(collection_name, document_id): Deletes a document.delete_document_by_id(collection_name, document_id): Deletes a document.update_document_by_field(collection_name, field, value): Updates a documentInstallationInstall using pip:$pipinstallpyselfmongo
Package: pyselpom
Github-flavored MarkdownPySelPOMPySelPOM is a Page Object Model selenium based framework for humans. It allows you to write your own web test with no
need to look under the framework hood in most cases.InstallationFor most users, the recommended method to install is via pip:pip install pyselpomor from source:python setup.py installConftest contentimportpytestfromseleniumimportwebdriverfromselenium.webdriver.chrome.optionsimportOptionsdefpytest_addoption(parser):parser.addoption('--language',action='store',default='en',help='Specify language param.')parser.addoption('--browser_name',action='store',default='chrome',help='Choose browser: chrome or firefox')@pytest.fixturedefdriver(request)->webdriver:user_language=request.config.getoption('language')browser_name=request.config.getoption('browser_name')ifbrowser_name=='chrome':print('\nStart chrome browser for test...')options=Options()# noinspection PyTypeCheckeroptions.add_experimental_option('prefs',{'intl.accept_languages':user_language})browser=webdriver.Chrome(options=options)elifbrowser_name=='firefox':print('\nStart firefox browser for test...')fp=webdriver.FirefoxProfile()fp.set_preference('intl.accept_languages',user_language)browser=webdriver.Firefox(firefox_profile=fp)else:raisepytest.UsageError('--browser_name should be chrome or firefox')yieldbrowserbrowser.quit()Page examplefrompyselpomimportBasePageclassMainPage(BasePage):URL_PATTERN='https://google.com/'classLoginPage(BasePage):link='https://google.com/login/'defshould_be_login_page(self):self.should_be_login_url()self.should_be_login_form()self.should_be_register_form()defshould_be_login_url(self):assert'login'inself.browser.current_urldefshould_be_login_form(self):assertself.is_element_present(*LoginPageLocators.LOGIN_FORM),'Login form does not exist.'defshould_be_register_form(self):assertself.is_element_present(*LoginPageLocators.REGISTER_FORM),'Register form does not exist.'defregister_new_user(self,email,password):self.browser.find_element(*LoginPageLocators.REGISTER_MAIL).send_keys(email)self.browser.find_element(*LoginPageLocators.REGISTER_PASSWORD).send_keys(password)self.browser.find_element(*LoginPageLocators.REGISTER_PASSWORD_CONFIRM).send_keys(password)self.browser.find_element(*LoginPageLocators.REGISTER).click()Locatorsfromselenium.webdriver.common.byimportByclassLoginPageLocators:LOGIN_FORM=(By.ID,'login_form')REGISTER_FORM=(By.ID,'register_form')REGISTER_MAIL=(By.NAME,'registration-email')REGISTER_PASSWORD=(By.NAME,'registration-password1')REGISTER_PASSWORD_CONFIRM=(By.NAME,'registration-password2')REGISTER=(By.NAME,'registration_submit')Test exampleimportpytestfrom.pages.login_pageimportLoginPagefrom.pages.main_pageimportMainPage@pytest.mark.login_guestclassTestLoginFromMainPage:deftest_guest_can_go_to_login_page(self,browser):page=MainPage(browser,MainPage.link)page.open()page.go_to_login_page()login_page=LoginPage(browser,browser.current_url)login_page.should_be_login_page()Changelog1.2.3 (2-03-2022).is_ returns bool now
Package: pysem
PySem: Pysen library for handling semantic data in linguisticsCurrent Version: 0.7Concepticon Version:3.1.0Usage ExamplesRetrieve the sense data assembled by S. A. Starostin in the STARLING software package and search for similar words:>>>frompysem.senseimportSense>>>sns=Sense()>>>sns.similar('arm')[['arm','calf of leg','sense-bone; sense-foot; sense-hand',3],['arm','hand','sense-bone; sense-foot; sense-hand',3],['arm','shin-bone','sense-bone; sense-foot; sense-hand',3],['arm','ankle','sense-bone; sense-foot',2],['arm','bone','sense-bone; sense-foot',2]]Map data to the most recent version of theConcepticonproject:>>>frompysemimportto_concepticon>>>to_concepticon([{"gloss":"Fuß",pos:"noun"}],language="de"}]){'Fuß':[['1301','FOOT','noun',19]]}How to CiteList, Johann-Mattis (2023): PySeM. A Python library for handling semantic data in linguistics. Version 0.7 URL:https://github.com/lingpy/pysem/, Leipzig: Max Planck Institute for Evolutionary Anthropology.
Package: pysemantic
pysemanticA traits based data validation and data cleaning module for pandas data structures.DependenciesTraitsPyYamlpandasdocoptQuick StartInstalling with pipRun:$ pip install pysemanticInstalling from sourceYou can install pysemantic by cloning this repository, installing the
dependencies and running:$ python setup.py installin the root directory of your local clone.UsageCreate an empty file namedpysemantic.confin your home directory. This can be as simple as running:$ touch ~/pysemantic.confAfter installing pysemantic, you should have a command line script calledsemantic. Try it out by running:$ semantic listThis should do nothing. This means that you don’t have any projects regiestered
under pysemantic. A _project_ in pysemantic is just a collection of _datasets_.
pysemantic manages your datasets like an IDE manages source code files in that
it groups them under different projects, and each project has it’s own tree
structure, build toolchains, requirements, etc. Similarly, different
pysemantic projects group under them a set of datasets, and manages them
depending on their respective user-defined specifications. Projects are
uniquely identified by their names.For now, let’s add and configure a demo project called, simply,
“pysemantic_demo”. You can create a project and register it with pysemantic
using theaddsubcommand of thesemanticscript as follows:$ semantic add pysemantic_demoAs you can see, this does not fit the supported usage of theaddsubcommand.
We additionally need a file containing the specifications for this project.
(Note that this file, containing the specifications, is referred to throughout
the documentation interchangeably as aspecfileor adata dictionary.)
Before we create this file, let’s download the well known Fisher iris datset,
which we will use as the sample dataset for this demo. You can download ithere.Once the dataset is downloaded, fire up your favourite text editor and create a
file nameddemo_specs.yaml. Fill it up with the following content.iris:path:/absolute/path/to/iris.csvNow we can use this file as the data dictionary of thepysemantic_demoproject. Let’s tell pysemantic that we want to do so, by running the following
command:$ semantic add pysemantic_demo /path/to/demo_specs.yamlWe’re all set. To see how we did, start a Python interpreter and type the
following statements:>>> from pysemantic import Project
>>> demo = Project("pysemantic_demo")
>>> iris = demo.load_dataset("iris")Voila! The Python object namedirisis actually a pandas DataFrame containing
the iris dataset! Well, nothing really remarkable so far. In fact, we cloned
and installed a module, wrote two seemingly unnecessary files, and typed three
lines of Python code to do something that could have been achieved by simply
writing:>>> iris = pandas.read_csv("/path/to/iris.csv")Most datasets, however, are not as well behaved as this one. In fact they can
be a nightmare to deal with. Pysemantic can be far more intricate and far
smarter than this when dealing with mangled, badly encoded, ugly data with
inconsistent data types. Check the IPython notebooks in the examples to see how to use Pysemantic for
such data.
Package: pysemanticscholar
semanticscholarA python library that aims to retrieve data fromSemantic Scholar API.How to installpip install semanticscholarUsageProgrammatically access paper and author data.Paper LookupTo access paper data:>>>importsemanticscholarassch>>>paper=sch.paper('10.1093/mind/lix.236.433',timeout=2)>>>paper.keys()dict_keys(['abstract','arxivId','authors','citationVelocity','citations','doi','influentialCitationCount','paperId','references','title','topics','url','venue','year'])>>>paper['title']'Computing Machinery and Intelligence'>>>forauthorinpaper['authors']:...print(author['name'])...print(author['authorId'])...AlanM.Turing2262347Author LookupTo access author data:>>>importsemanticscholarassch>>>author=sch.author(2262347,timeout=2)>>>author.keys()dict_keys(['aliases','authorId','citationVelocity','influentialCitationCount','name','papers','url'])>>>author['name']'Alan M. Turing'>>>len(author['papers'])77
Package: pysemble
PysembleCustom build system for C/C++ for use with python for configuration.FeaturesSupported CompilersG++GccClangAny compiler or archiver used must be accessible in the PATH with its standard name.Supported ArchiversArSupported OSWindowsUnix likeBuild TypesBuild to binarywith static or dynamic linkingStatic librarywith static linkingDynamic Librarywith static linkingInstallpipinstallpysembleModulesfrompysemble.buildersimportProject,Libraryfrompysemble.compilersimportGppfrompysemble.archiversimportArHello world Buildcompiler=Gpp()# g++myapp=Project("myapp",compiler)myapp.add_executable("hello_world.cpp")myapp.build()myapp.run()Building a Librarycompiler=Gpp()# g++archiver=Ar()# armylibrary=Library("libmylibrary",compiler,archiver)mylibrary.add_sources(["dependency_1.cpp","dependency_2.cpp","dependency_3.cpp","dependency_4.cpp",])mylibrary.buid()# static librarymylibrary.build_shared()# dynamic libraryAdd External Libraries to Projectcompiler=Gpp()# g++working_directory=os.path.dirname(os.path.realpath(__file__))os.environ["LD_LIBRARY_PATH"]=working_directory+"/SFML/lib"project=Project("myproject",compiler)project.add_executables(["main.cpp",])project.add_link_path("SFML/lib")project.add_include_directory("SFML/include")project.add_dynamic_libs(["sfml-graphics","sfml-window","sfml-system","sfml-audio",])project.build()project.run()Package a Library for Distrobutioncompiler=Gpp()# g++archiver=Ar()# arloggerlib=Library("liblogger",compiler,archiver)loggerlib.add_sources(["logger.cpp",])loggerlib.add_header("logger.h")loggerlib.package(dynamic=True)Final packageliblogger
    |_ include
          |_ logger.h
    |_ lib
        |_ liblogger.soTroubleshootingClang & GCCIf you are building c++ try to link with stdc++ if you are having problems
Package: pysem-converters
PYSEM-CONVERTERSPysem-converters is a modular library to simplify unit conversions📝 Table of ContentsAboutGetting StartedDeploymentUsageBuilt UsingTODOContributingAuthors🧐 AboutPysem-converters makes conversions very simple and intuitive. It supports many units.OBJECT CONVERTERSisStringisIntisFloatisBytesisBoolisDictionaryisListisSetisTupleisJsonjson_to_strjson_to_bytesjson_to_xmlstr_to_bytesstr_to_jsonbytes_to_strbytes_to_jsonTIME CONVERTERSsecondsminuteshoursdaysweeksfortnightsyearsmonthscenturiesmillenniumsTEMPERATURE CONVERTERScelsiusfahrenheitkelvinDISTANCE CONVERTERScentimetermillimeterkilometerinchhandfootyardmilelight yearastronomical unitparsecnautical mileangstrommicronplanck length🏁 Getting StartedPrerequisitesPint==0.16.1Installing# Using python pip$pipinstallpysem-converters# Using git$gitclonehttps://github.com/pysem/converters.git
$cdconverters
$pipinstall-rrequirements.txt
$pythonsetup.pyinstallBreak down into end to end testscd/tests
python3<test_name>.py🎈 Usagefrompysem_convertersimporttime_converter,SECONDS,MINUTESprint(time_converter(10,SECONDS,MINUTES))🚀 Deploymentpysem-converters is a python library, when installed, just import it to your project.importpysem_convertersfrompysem_convertersimport*⛏️ Built UsingPythonPint✍️ Authors@tory1103- Idea, Concept & Initial workSee also the list ofcontributorswho participated in this project.
Package: pysem-strings
PYSEM-STRINGSPysem-strings is a modular library to simplify string uses📝 Table of ContentsAboutGetting StartedDeploymentUsageBuilt UsingTODOContributingAuthors🧐 AboutPysem-strings makes strings very simple and intuitive. It has many methods for string manipulation.🏁 Getting StartedPrerequisitesNO REQUIREMENTS NEEDEDInstalling# Using python pip$pipinstallpysem-strings# Using git$gitclonehttps://github.com/pysem/strings.git
$cdstrings
$pipinstall-rrequirements.txt
$pythonsetup.pyinstall🎈 Usagefrompysem_stringsimportStringprint(String("hello, this is my string").get_chars(10))🚀 Deploymentpysem-strings is a python library, when installed, just import it to your project.importpysem_stringsfrompysem_stringsimport*⛏️ Built UsingPython✍️ Authors@tory1103- Idea, Concept & Initial workSee also the list ofcontributorswho participated in this project.
Package: py-send-e-mail
Email_SenderEmail_Sender is Python Package For Sending Email Easily. This package is trying to help programmer save time adjusting code for sending email.Installationyou should havepython 3$pip3installemail_senderUsageemail_sender have one base classMailthat used to send email using smtp connection.MailParametersemail- Required
- Email of sender. once you initiate it, it can be used for sending emailspassword- Required if envPath is None
- Password is required if you don't specify the.envpath
- in Most case programmer don't wanna put password as string inside their code for that email_sender module usedotenv.host - default to 'smtp.gmail.com'port - default to 587envPath- optional
- envPath expectpython pathlib.Path('.env file location').resolve()envName - optional default topassword- envName if the name of the password in the.envis another name.Examplefromemail_sender.mailimportMailfrompathlibimportPathsenderEmail='sender@gmail.comreceiverEmail='receiverEmail@gmail.com'mail=Mail(senderEmail,envPath=Path('.env'),envName='cha')message='''\Subject: Testing EmailsThis is testing email message'''mail.send_email(receiverEmail,message)Cloneif you want to clone and use the repo use therequirement.txtfilepip3 install -r requirements.txtAbout DeveloperMy Name is Temking Mengistu . I am Student atAdama Science and Technology Universityin field of Computer Science and Engineering.Follow me onGithubLinkedin©chapimenge 2020