Saravanan666/pypi-org huggingface dataset:
Package: parse-opening-hours
Python Opening Hours parserThis library parses opening hours from various human-readable strings such as "Mon- Fri 9:00am - 5:30pm" into a more standard JSON format that can be processed more easily.The formatopening_hours=[{"day":"monday","opens":"9:00","closes":"17:00"},//..]Installationpip install parse-opening-hoursUsageThe simplest example is just printing the JSON for an opening hours string:fromopening_hoursimportOpeningHoursprint(OpeningHours.parse("Mon- Fri 9:00am - 5:30pm").json())This should give you the below output:[
	{'day': 'monday', 'opens': '9:00', 'closes': '17:30'},
	{'day': 'tuesday', 'opens': '9:00', 'closes': '17:30'},
	{'day': 'wednesday', 'opens': '9:00', 'closes': '17:30'},
	{'day': 'thursday', 'opens': '9:00', 'closes': '17:30'},
	{'day': 'friday', 'opens': '9:00', 'closes': '17:30'}
]This has been tested using Python 3.8.5DocumentationIn addition to this README, there is some documentation generated from inline documentation comments. This is available athttps://moralcode.github.io/parse-opening-hours/Environment variablesSetting the environment variableOH_DEBUGto a value ofYwill set the root logging level to debug and will cause log entries to appear in stdout for debugging purposesTroubleshootingAssumptionsWhen specifying a time without AM or PM indicators, you may get an error that readsTypeError: Cannot convert a time of unknown type (AM, PM or 24H) without assuming its type.. To resolve this, passassume_type=TimeType.AMwhen calling theparse()function. This will use AM in place of an unknown AM or PM designation. In cases like the string "9-5", if the second value in the range (in this case the5is smaller than the first (i.e. the9) then it will be converted to PM automaticallyTests and Coveragerun pytet and generate coverage databasepipenv run pytest --cov=./show coverage report:pipenv run coverage report
Package: parse-pip-search
parse_pip_searchWrapping the needs of a "pip search" command necessity through PyPi.org, on a command-line parseable outputInstallation & UsageInstall withpip install parse_pip_searchUse withparse_pip_search anythingYou can specify sorting options :parse_pip_search -s nameparse_pip_search -s versionparse_pip_search -s releasedDependenciesbs4richrequestsBased on@victorgarric's awesomepip_searchutility
Package: parse-qwantz
Dinosaur Comic ParserA transcript generator forRyan North'sDinosaur ComicsInstallationInstallparse-qwantzwithpippipinstallparse-qwantzUsageYou need to download the image file for the comic you want transcribed, for examplehttps://qwantz.com/comics/comic2-02.png. Then runparse-qwantz:$ parse-qwantz comic2-02.png
T-Rex: Today is a beautiful day to be stomping on things! As a dinosaur, stomping is the best part of my day indeed!

T-Rex: *gasp*

T-Rex: What's that, little house? You wish you were back in your own time? THAT IS TOO BAD FOR YOU

T-Rex: Perhaps you too will get a stomping, little girl!
Utahraptor: WAIT!

Utahraptor: Is stomping really the answer to your problem(s)?
T-Rex: Problem(s)?

T-Rex: My only problem(s) have to do with you interrupting my stomping!
T-Rex: 〚small〛 crazy utahraptor!You can also call it withpython-mparse_qwantzThe argument can also be a directory path instead of a file path. In such case the program will run on all files in the specified directory.Options--output-dirBy default, the program outputs to stdout and logs to stderr. With this option, when processing fileimage_name.pngit will output toOUTPUT_DIR/image_name.png.txtand log toOUTPUT_DIR/image_name.log.--generate-svgInstead of transcribing the comic, generate a vectorized version in the SVG format and print it to the standard output.--parse-footerInstead of transcribing the comic, transcribe just the footer.ConventionsBold and italics are marked with "◖◗" and "▹◃" respectively. This is to avoid ambiguity which may result from using characters like "*" or "_".All descriptions are in "〚〛" brackets. Each line that isn't just description starts from a "character" name followed by a colon. That "character" might be one of the actual characters, but also "Narrator", "Off panel", "Banner", "Book cover" etc.When some text in a panel is obscured but can be reconstructed, it's in "⦃⦄" braces. So far this applies only to 2 comics: #59 and #61.When some text in a panel is obscured and not reconstructed, it's replaced either by the special "…" character, or a description of how it's obscured in "〚〛" brackets.NotesThis program still does not work on all DC strips, but at this point it should work correctly on pretty much all "standard" strips and some less-standard ones (thanks to the system of overrides). Eventually all existing strips should work, including the guest comics, with updates for new comics coming out regularly.After all comics are working, I might add some other features, like generating SVG images.Running TestsTo run tests, run the following command:pytesttest/AcknowledgmentsThis program would not be possible without the wonderful comics by Ryan North! Thanks, Ryan, and congratulations on the 20th anniversary of your comics! Btwthe anniversary comicwill totally not work with this script, haha! (at least until I add an override)
Package: parseq-XAS
A pipeline for the [ParSeq framework](https://github.com/kklmn/ParSeq) that
implements data processing of EXAFS spectra.This pipeline also serves as an example for creating analysis nodes,
transformations that connect these nodes and widgets that set options and
parameters of the transformations.Dependencies[ParSeq](https://github.com/kklmn/ParSeq) – the framework package,[silx](https://github.com/silx-kit/silx) – used for plotting and Qt imports.How to useEither install ParSeq and this pipeline application by their installers or put
their foldersparseqandparseq_XASnear by (i.e. in the same folder) and
runpython XAS_start.py –helpto see the accepted options. Load a ready
project fromsavedfolder from the GUI or from the starting command line.
Package: parser-2gis
Parser2GISParser2GIS- парсер сайта2GISс помощью браузераGoogle Chrome.ℹ️ ОписаниеПарсер для автоматического сбора базы адресов и контактов предприятий, которые работают на территории
России, Казахстана, Украины, Беларуси,
Азербайджана, Киргизии, Узбекистана, Чехии, Египта, Италии, Саудовской Аравии, Кипра, Объединенных Арабских Эмиратов, Чили, Катара, Омана, Бахрейна, Кувейта.✨ Особенности💰 Абсолютно бесплатный🤖 Успешно обходит анти-бот блокировки на территории РФ🖥️ Работает под Windows, Linux и MacOS📄 Три выходных формата: CSV таблица, XLSX таблица и JSON список🔗 Наличие генератора ссылок по городам и рубрикам🚀 УстановкаДля работы парсера необходимо установить браузерGoogle Chrome.Установка одним файломСкачатьрелиз.Установка из PyPI# CLIpipinstallparser-2gis# CLI + GUIpipinstallparser-2gis[gui]📖 ДокументацияОписание работы доступно навики.👍 ПоддержатьПоблагодарить и поддержать разработку
Package: parserBI
Parser en PythonDescriptionCe repo contient le code d'un module python permettant de parser du code source pour en extraire des indicateurs.InstallationDepuis Git bash :Cloner le projet (master)cd parserpip install -r requirements.txtpy.testContributionCloner le projetCréer une nouvelle brancheCheck out la brancheCommit et push du codeCréer un PR et alerter l'équipeConventionLe code et les commentaires seront de préférence en FrançaisOn utilisera Python 3.7Le linter sera PyLintDocumentationSchema des classes
Package: parser-cian
Cian ParserWhat is this?This is a parser with which you can easily get data from a website cian.ru.Quick GuideThis module is based on Selenium-Stealth, using BeautifulSoup as well as AsyncioData you can get:Name of apartmentThe city district in which the housing estate is locatedPrice of the apartmentTime to the subwayHow to get to the subwayNearest subwayPrice per square meterTotal square footageLiving SpaceFloorNumber of stories in the houseYear of delivery of the houseSurrendered or notFinishingParkingCeiling HeightsBuilder RatingUsingUsing the library is as simple and convenient as possible:Let's import it first:
First, import everything from the library (use thefrom...import *construct).Examples of all operations:Сreate an instance of a classCian_Parser(PATH - file save path, URL - site url, BOOST (True or False) - you can also receive a seller rating, but the speed is reduced several times, COUNT_PAGE - how many pages of apartments do you want to receive):parser = Cian_Parser(PATH, URL, BOOST, COUNT_PAGE)Receive all data of all apartments in CSV format using thestart_parsing()function:parser.start_parsing()If you want to create your own parser logic, then use the description of the other modules:Сreate an instance of a classPagination(parser - parser instance from the Flats_Url class, next_button_selector - XPATH pagination buttons)pagination = Pagination(parser, next_button_selector)Checking for next page using theHasNextPage()function:await pagination.HasNextPage()Go to next page using theGoToTheNextPage()function:await pagination.GoToTheNextPage()DeveloperMy site:link
Package: parserconfig
ParserConfigParserConfig initializes ConfigParser in fewer lines of code.InstallationRequires Python 3.7+:python-mpipinstallparserconfigUsageTo follow along, create asettings.inifile in your home directory with the following content:[tutorial]username=my_usernamepassword=my_passwordbearer_token=my_bearer_tokenThe configuration file can be read using the following code:frompathlibimportPathfromparserconfigimportParserConfigconfiguration_file=Path.home().joinpath('settings.ini')settings=ParserConfig(configuration_file=configuration_file)Thecredentialshelper method returns a dictionary containing key/value pairs. This can be leveraged in several ways:credentials=settings.credentials('username','password',section='tutorial')print(f'{credentials= }. Kwargs unpacking is supported via **credentials')username,password=credentials.values()print(f'{username= },{password= }')The pattern for querying a single value varies slightly:bearer_token=settings.credentials('bearer_token',section='tutorial')print(f'{bearer_token= }. Single value also supports kwargs unpacking via **bearer_token')bearer=bearer_token.get('bearer_token')print(f'{bearer= }')token,*_=bearer_token.values()print(f'{token= }')Access toConfigParseris provided viaconfiguration_file_parser, and can be used to enable ExtendedInterpolation:fromconfigparserimportConfigParser,ExtendedInterpolationsettings.configuration_file_parser=ConfigParser(interpolation=ExtendedInterpolation())settings.load_configuration_file()Advanced Usagemanagement_api_toolsuses parserconfig to insert data into pytest during test execution.offpremcreates subclasses of parserconfig.Local Development and TestingDevelopmentDevelopment and testing should be done in a virtual environment.$gitclonehttps://github.com/Fauxsys/parserconfig.git
$cdparserconfig
$python-mvenvvenv--promptparserconfig
$sourcevenv/bin/activate(parserconfig)$python-mpipinstall-UpipInstall parserconfig locally.(parserconfig)$python-mpipinstall-e".[test]"TestingYou can test any changes locally with pytest.(parserconfig)$python-mpytest--cov=parserconfigYou can also test parserconfig as an installed package.(parserconfig)$python-mtoxBuilding a wheel(parserconfig)$python-mpipinstallbuild(parserconfig)$python-mbuild--wheelThere should now be a wheel in thedistdirectory.(parserconfig)$ls-1dist
parserconfig-1.0.0-py3-none-any.whl
Package: parse-reparsepoint
parse-reparsepointPython program to parse out and display reparse point info present in an NTFS MFT entryOverviewThis project takes a raw NTFS image and an MFT entry number. It then:Finds the MFT entry corresponding to the numberChecks if it belongs to a reparse pointAnalyzes any info it can find in regards to the reparse pointIt currently has the ability to resolve the meaning of any reparse tag listed in the Microsoft documentation, and can retrieve information from the reparse data section of the following types of reparse points:OneDrive Cloud-only filesSymbolic LinksWindows Mount PointsInstallationThis project can be installed withpipusing the following command:python3 -m pip install parse-reparsepointUsageusage: parse-reparsepoint [-h] -f FILE -m MFT_ENTRY

Parse reparse point

options:
  -h, --help                               show this help message and exit
  -f FILE, --file FILE                     Path to file
  -m MFT_ENTRY, --mft-entry MFT_ENTRY      MFT entry to parse

example:
  parse-reparsepoint -f Windows-10-Dev.raw -m 247645
Package: parse-requirements-not-suckily
Because srsly wtf :) :) :| :| :(Usagefrom parse_requirements_not_suckily import parse_requirementsLater that day… (in setup.py)install_requires=parse_requirements()You be all like “wat no filler garbage code, like batteries included lol?” and I
be all like “yes”LicenseCopyright (c) 2016 Jon RobisonSee included LICENSE for licensing information
Package: parserheader
parserheaderParsing headers from string or dictionaryInstallingInstall and update usingpip_:.. code-block:: bash$ pip install parserheaderparserheader supports Python 2 and newer, Python 3 and newer, and PyPy... _pip:https://pip.pypa.io/en/stable/quickstart/ExampleWhat does it look like? Here is an example of a simple parserheader program:.. code-block:: pythonimport parserheader

...

def setHeaders():
    ph = parserheader.parserheader()
    header_str = """
        POST /upload/ HTTP/1.1
        Host: google.com.com
        Connection: keep-alive
        Content-Length: 1220
        Cache-Control: max-age=0
        Origin: http://www.google.com.com
        Upgrade-Insecure-Requests: 1
        Content-Type: application/x-www-form-urlencoded
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
        Referer: http://www.google.com/
        Accept-Encoding: gzip, deflate
        Accept-Language: en-US,en;q=0.9,id;q=0.8
        Cookie: PHPSESSID=41a0f0ac4545d3f5ba9a4ba415b777e9
    """
    headers = ph.parserHeader(header_str)
    print("headers =", headers)
    return headers

setHeaders()And what it looks like when run:.. code-block:: bash$ python test.py 
headers = {'Origin': 'http://www.google.com', 'Content-Length': '1220', 'Accept-Language': 'en-US,en;q=0.9,id;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36', 'Host': 'google.com', 'Referer': 'http://www.google.com/', 'Cache-Control': 'max-age=0', 'Cookie': 'PHPSESSID=41a0f0ac4545d3f5ba9a4ba415b777e9', 'Upgrade-Insecure-Requests': '1', 'Content-Type': 'application/x-www-form-urlencoded'}SupportPython 2.7 +, Python 3.xWindows, LinuxLinksLicense:MIT <https://github.com/cumulus13/parserheader/src/default/LICENSE.rst>_Code:https://github.com/cumulus13/parserheaderIssue tracker:https://github.com/cumulus13/parserheader/issues
Package: parser-html
htmlparse: A basic HTML parser in PythonInstallation# Linuxpython3-mpipinstallparser-html# Windowspython-mpipinstallparser-html# Build from sourcepython-mpipinstallgit+https://github.com/AaravMalani/htmlparseUsageimporthtmlparsewithopen('index.html','r')asf:element=htmlparse.parse_html(f.read())ifnotelement:raiseValueError("Parsing failed!")print(element.children)# Sub-elementsprint(element.innerHTML)# Data enclosed by tagprint(element.outerHTML)# Data enclosed by tag as well as the tag itselfelement.innerHTML='e&gt;'# Rebuilds this element and sets the innerHTML of all the parent elementsprint(element.children)# ['e>'] (The HTMLText element is represented as a string literal)print(element.children[0].text)# e> (Use HTMLText.outerHTML for an HTML escaped string (e&gt;) however don't set it)element.outerHTML='<div class="black blue"><a href="https://github.com/" id="abc"></div>'# Read above statement# assigning to element.children is in the worksprint(tag.attrs)# {"href":"https://github.com/", "id":"abc"}print(tag.tag_name)# aelement.children=[]element.attrs={}# WARNING! You have to set it, you can't do element.attrs.update or element.attrs |=print(tag.outerHTML)# <div></div>ToDoSupport for CSS stylesSupport for JS scriptsSupport for assignment toHTMLElement.childrenlistSupport for text between stringsSupport for CSS selectorsSupport for XPATH
Package: parserkiosk
ParserKiosk: A Proof of Concept multi-lingual test generation suite intended for parsersMotivationAfter reading thisarticleandthis one, I am now paranoid and under the assumption that implementations of data serialization and deserialization have a lot of quirks that differ from language to language, and implementation to implementation.Thiscouldlead to serious security issues as applications, especially web applicatonsusuallyutilize multiple services, written in multiple languages that use the same format to communicate.Reference implementations usually provide tests, but translating them from language to language is tiresome and tedious. I wanted to compose a library to generatesimple, functional tests for multiple languages with minimal repitition.UsageInstall$pipinstallparserkioskDefine aconfig.yaml# config.yaml---import_string:"frommy_parserimportserialize,deserialize"serialize_function:"serialize"de_serialize_function:"deserialize"assert_functions:-my_assert_functionDefine a yaml file prefixed withtest_in the same directory asconfig.yaml# test_serialize.yamltype:"SERIALIZE"tests:test_something:info:"ExampleTest"input:type:"str"arg:"hello,world"assert:func:"my_assert_function"arg:"[\"hello\",\"world\"]"Run parserkiosk in the same directory asconfig.yamlandtest_serialize.yaml$parserkiosk.--builtinpythonSee output directorytests/$lstests/
test_serialize.pySeeHOWTOfor a complete guide.How does it work?Parserkiosk usesjinja2templates to generate test cases fromyamlfile(s). You can either expect something to fail(raise an "exception" or "error") or use a function that you define in a special file calledcommonsto assert if the parsed data matches the expected internal representation.Let's say you've written a reference implementation of your data de/serialization format inGoand I wanted to implement it inPython.All I would need to do to implement your test-suite is:Write acommons.pyfile implementing the same assertion functions that you've written in yourcommons.gofileAdapt your parserkiosk config to use my implementationRun$ parserkiosk folder_with_yaml_test_files/ --builtin pythonandvoilaI have your entire test suite implemented!For more on this, seeexamples/json/Languages supportedPython / pytest /pythonNodeJS / jest (sync) /node_jsNodeJS / jest (async)LuaGoJavaPHPPerlRuby...LicenseAll work is licensed underGPL-3.0excluding the example JSON test-suite which is licensed underMITContributingIssues, feedback and pull requests are welcome. I have triedmy bestto keep the code simple. Please keep in mind that I wish to limit features that we accomodate to keep it simple. Tests should be simple and readable.Installing for development$gitclonehttps://github.com/you/your-fork-of-parserkiosk.git
$cdyour-fork-of-parserkiosk
$poetryinstall
$poetryrunpre-commitinstall# do some changes$./runtests.sh# you are ready!ThanksSpecial thanks tonstfor inspiring Parserkiosk. All test cases inexamples/jsoncome from hisincredible work
Package: parserlib
parserlibA Pythonic parser implementation!InstallationpipinstallparserlibExamplefromparserlib.lexerimportLexerfromparserlib.parserimportRule,ShiftReduceParserfromparserlib.tokenimportTokenclassNumberToken(Token):name="NUMBER"regex=r"\d+"classPlusToken(Token):name="PLUS"regex=r"\+"classMinusToken(Token):name="MINUS"regex=r"-"classLeftParenthesisToken(Token):name="LEFT_PARENTHESIS"regex=r"\("classRightParenthesisToken(Token):name="RIGHT_PARENTHESIS"regex=r"\)"classAsteriskToken(Token):name="ASTERISK"regex=r"\*"classSlashToken(Token):name="SLASH"regex=r"/"classExpression(Rule):passclassNumberExpression(Expression):def__init__(self,number:NumberToken):self.number=number@classmethoddefreduce(cls,number:NumberToken)->Expression:returncls(number)classParenthesisExpression(Expression):@classmethoddefreduce(cls,_:LeftParenthesisToken,expression:Expression,__:RightParenthesisToken)->Expression:returnexpressionclassPlusExpression(Expression):def__init__(self,left:Expression,right:Expression):self.left=leftself.right=right@classmethoddefreduce(cls,left:Expression,_:PlusToken,right:Expression)->Expression:returncls(left,right)classMinusExpression(Expression):def__init__(self,left:Expression,right:Expression):self.left=leftself.right=right@classmethoddefreduce(cls,left:Expression,_:MinusToken,right:Expression)->Expression:returncls(left,right)classTimesExpression(Expression):def__init__(self,left:Expression,right:Expression):self.left=leftself.right=right@classmethoddefreduce(cls,left:Expression,_:AsteriskToken,right:Expression)->Expression:returncls(left,right)classDivideExpression(Expression):def__init__(self,left:Expression,right:Expression):self.left=leftself.right=right@classmethoddefreduce(cls,left:Expression,_:SlashToken,right:Expression)->Expression:returncls(left,right)lexer=Lexer(tokens=(NumberToken,PlusToken,MinusToken,LeftParenthesisToken,RightParenthesisToken,AsteriskToken,SlashToken,),ignore_characters="\t",)parser=ShiftReduceParser(rules=(ParenthesisExpression,PlusExpression,MinusExpression,TimesExpression,DivideExpression,NumberExpression,),precedence=((ParenthesisExpression,),(TimesExpression,DivideExpression),(PlusExpression,MinusExpression),),)tree=parser.parse(lexer.feed("1 +\n(2) * 3"))print(tree)
Package: parserllm
parserLLMUse a context-free grammar and a parser generator to determine valid next tokens for an LLM generation.ExtendingReLLMto handle context-free grammars in addition to regular expressions.UsagepipinstallparserllmSeeexamples/example.pyfor an example of how to use this library.Run it withpython examples/example.py.How does it work?See thispostfor a more in-depth explanation.The general strategy goes like this:First, define a context-free grammar. You might use this for a simplified version of JSON (in EBNF form):?start:value?value:object|array|string|"true"->true|"false"->false|"null"->nullarray:"["[value(","value)*]"]"object:"{"[pair(","pair)*]"}"pair:string":"valuestring:ESCAPED_STRING%import common.ESCAPED_STRING%import common.SIGNED_NUMBER%import common.WS%ignore WSNext, to practically support multiple CFGs, use a parser generator to parse the language. This library uses Lark, simply because it’s written in Python and fairly easy to use.Next, run the partial output through the parser generator. At step zero, this is just the empty string. The parser will return all of the possible next tokens. You can see the valid first completion of this grammar is any “value,” which can be an array, string, true/false, or null. This means the valid starting tokens are{,[,”,true,false, andnull.Ncompile those tokens to their regular expressions. Now we have an equivalent problem toReLLM. Simply run the regexps through ReLLM to generate the next possible token. ReLLM will squash the logits of the non-matching characters and the LLM will only consider valid partial or full next tokens.Iterate until max tokens are reached, or the parser sees only an empty string or stop token as the next token.Some interesting features:You can describe the syntax of most programming and configuration languages as a CFG.The LLM won’t produce an invalid result, but there’s no guarantee it will finish and produce a stop token.