Saravanan666/pypi-org huggingface dataset:
Package: parsedatetime
Parse human-readable date/time strings.Python 2.6 or greater is required for parsedatetime version 1.0 or greater.While we still test with Python 2.6 we cannot guarantee that future changes will not break under 2.6InstallingYou can install parsedatetime using:pip install parsedatetimeRunning TestsFrom the source directory:make testTo run tests on several python versions, typemake tox:$ make tox
[... tox creates a virtualenv for every python version and runs tests inside of each]
py27: commands succeeded
py35: commands succeededThis assumes that you have the versions you want to test under installed as part of your
PyEnv environment:pyenv install -s 2.6.9
pyenv install -s 2.7.11
pyenv install -s 3.5.2
pyenv install -s pypy-5.3
pyenv global 2.7.11 3.5.2 2.6.9 pypy-5.3The tests depend on PyICU being installed using thepyicu-binarypackage which removes the source build step. PyICU depends on icu4c which on macOS requires homebrew:brew install icu4cThe Makefile contains the macOS default values for them so you may need to tweak them.Using parsedatetimeAn example of how to use parsedatetime:importparsedatetimecal=parsedatetime.Calendar()cal.parse("tomorrow")To get it to a Pythondatetimeobject:fromdatetimeimportdatetimetime_struct,parse_status=cal.parse("tomorrow")datetime(*time_struct[:6])Parse datetime with timezone support (using pytz package):importparsedatetimeimportpytzfrompytzimporttimezonecal=parsedatetime.Calendar()datetime_obj,_=cal.parseDT(datetimeString="tomorrow",tzinfo=timezone("US/Pacific"))More detailed examples can be found in the examples directory.DocumentationThe generated documentation is included by default in the docs directory and can also be viewed online athttps://bear.im/code/parsedatetime/docs/index.htmlThe docs can be generated by running:make docsNotesTheCalendarclass has a member property namedptcwhich is created during the class init method to be an instance
ofparsedatetime_consts.CalendarConstants().HistoryThe code in parsedatetime has been implemented over the years in many different languages (C, Clipper, Delphi) as part of different custom/proprietary systems I’ve worked on.  Sadly the previous code is not “open” in any sense of that word.When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.After working on the initial concept and creating something that could be shown to the Chandler folks, the code has now evolved to its current state with the help of the Chandler folks, most especially Darshana.
Package: parsedifflib
Theparsedifflibpackage parses any style of diff patch into an
event stream of patch instructions. These instructions can then be
applied, colorized, reformatted, dissected, analyzed, etc.Warning2013/12/09: currently only thesvnlookformat and stream-oriented
event output is supported. Eventually, all the formats supported by
colordiff are intended to be supported as well as structured output.Usageimportparsedifflib,subprocessdata=subprocess.check_output('svnlook diff /path/to/repos',shell=True)forevent,targetinparsedifflib.parse_svnlook(data,{'lineNumbers':True}):ifeventin(parsedifflib.Event.PATCH_START,parsedifflib.Event.PATCH_END,parsedifflib.Event.ENTRY_END,parsedifflib.Event.LINE_LOC,parsedifflib.Event.LINE_SAME,parsedifflib.Event.LINE_NOTE,parsedifflib.Event.PROPENTRY,):continueelifevent==parsedifflib.Event.ENTRY_START:printtarget.commentelifevent==parsedifflib.Event.LINE_DELETE:print'  - deleted line%d:%s'%(target.oldnum,target.line)elifevent==parsedifflib.Event.LINE_DELETE:print'  + added line%d:%s'%(target.newnum,target.line)CreditsMuch inspiration came from:https://github.com/ymattw/cdiffhttps://github.com/kimmel/colordiff
Package: parsedmarc
parsedmarcparsedmarcis a Python module and CLI utility for parsing DMARC
reports. When used with Elasticsearch and Kibana (or Splunk), it works
as a self-hosted open source alternative to commercial DMARC report
processing services such as Agari Brand Protection, Dmarcian, OnDMARC,
ProofPoint Email Fraud Defense, and Valimail.Help WantedThis project is maintained by one developer. Please consider
reviewing the openissuesto see how
you can contribute code, documentation, or user support. Assistance on
the pinned issues would be particularly helpful.Thanks to allcontributors!FeaturesParses draft and 1.0 standard aggregate/rua reportsParses forensic/failure/ruf reportsCan parse reports from an inbox over IMAP, Microsoft Graph, or Gmail
APITransparently handles gzip or zip compressed reportsConsistent data structuresSimple JSON and/or CSV outputOptionally email the resultsOptionally send the results to Elasticsearch and/or Splunk, for use
with premade dashboardsOptionally send reports to Apache Kafka
Package: parsedoc
Parses PHP doc blocks into markdownUsageSeeparsedoc--help.FeaturesParse PHP files into markdownAble to recursively do this for a folderCreate index files per folderAllows to only include certain annotationsAllows to not write files without commentsRequirementsPython >= 2.7 or >= 3.3Also tested using PyPydocoptInstallationpip install .orpython setup.py install.LicenceCopyright (C) 2014  Thom WiggersThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
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 General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.See the bundledLICENCEfile for more
details.History0.2.1 (2018-3-5)Declare that we support more recent versions of PythonFix shields inREADME.rst0.2.0 (2014-11-16)Adds--no-outputmodeAllow to pass input via stdinAdd example git update hook0.1.1 (2014-11-16)Bugfix in the filter pluginMinor bugfixes with logging statements0.1.0 (2014-10-3)First release on PyPI.
Package: parsedom
This is a fork ofCommon Functions and ParseDOMfor use outside of XBMC.Getting element content.fromparsedomimportparseDOMlink_html="<a href='bla.html'>Link Test</a>"ret=parseDOM(link_html,"a")printrepr(ret)# Prints ['Link Test']Getting an element attribute.link_html="<a href='bla.html'>Link Test</a>"ret=parseDOM(link_html,"a",ret="href")printrepr(ret)# Prints ['bla.html']Get element with matching attribute.link_html="<a href='bla1.html' id='link1'>Link Test1</a><a href='bla2.html' id='link2'>Link Test2</a><a href='bla3.html' id='link3'>Link Test3</a>"ret1=parseDOM(link_html,"a",attrs={"id":"link1"},ret="href")ret2=parseDOM(link_html,"a",attrs={"id":"link2"})ret3=parseDOM(link_html,"a",attrs={"id":"link3"},ret="id")printrepr(ret1)# Prints ['bla1.html']printrepr(ret2)# Prints ['Link Test2']printrepr(ret3)# Prints ['link3']When scraping sites it is prudent to scrape in steps, since real websites are often complicated.Take this example where you want to get all the user uploads.&lt;div id="content"&gt;&lt;div id="sidebar"&gt;&lt;div id="latest"&gt;<ahref="/video?8wxOVn99FTE">Miley Cyrus - When I Look At You</a>&gt;br /&lt;<ahref="/video?46">Puppet theater</a>&lt;br /&gt;<ahref="/video?98">VBLOG #42</a>&lt;br /&gt;<ahref="/video?11">Fourth upload</a>&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="user"&gt;&lt;div id="uploads"&gt;<ahref="/video?12">First upload</a>&lt;br /&gt;<ahref="/video?23">Second upload</a>&lt;br /&gt;<ahref="/video?34">Third upload</a>&lt;br /&gt;<ahref="/video?41">Fourth upload</a>&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The first step is to limit your search to the correct area.One should always find the inner most DOM element that contains the needed data.ret=parseDOM(html,"div",attrs={"id":"uploads"})The variable ret now contains['<a href="/video?12">First upload</a>&lt;br /&gt;<ahref="/video?23">Secondupload</a>&lt;br/&gt;<ahref="/video?34">Thirdupload</a>&lt;br/&gt;<ahref="/video?41">Fourthupload</a>&lt;br/&gt;']And now we get the video url.videos=parseDOM(ret,"a",ret="href")printrepr(videos)# Prints [ "video?12", "video?23", "video?34", "video?41" ]
Package: parse-ebnf
Parse EBNFTable of ContentsIntroductionInstallationQuick startDocumentationLicenseIntroductionA simple and hacky parser for EBNF as defined by ISO. Give it an EBNF string and
it'll generate aparse tree. Note that this package does not parse the
described grammar.Installationpip install parse-ebnfQuick startfromparse_ebnfimportAST#Your EBNF file goes hereebnf=open('grammar.ebnf','r')ast=AST()try:#Will raise SyntaxError on error with an error message describing what went wrongast.parse(ebnf.read)#You need to pass in a function that returns n characters where n is given as the first parameter.finally:#Even after an error a partial tree will be generated.#str gives a text version of the parse tree(meant for debugging), while repr gives the text that it was produced from.print(str(ast))print(f'Parsed the file creating a tree with{ast.count}nodes, height of{ast.height}. Each node has at MOST{ast.maxDegree}children.')defDepthFirst(node,func):func(node)forchildinnode.children:DepthFirst(child,func)#This will visit each node in the parse tree and print the line where its text beginsDepthFirst(ast.root,lambdanode:print(node.startLine))fromparse_ebnfimportASTCommentNode#Finds each comment in the file and prints its text contentforchildinast.root.children:ifisinstance(child,ASTCommentNode):print(child.data)DocumentationCheck thegithub pagethat
holds the documentation.Licenseparse-ebnfis distributed under the terms of theMITlicense.
Package: parse-emails
parse-emailsParses an email message file and extracts the data from it.The key features are:Supports.emland.msgfiles.Extracts nested attachments.RequirementsPython 3.8.5+Installation$pipinstallparse-emails$brewinstalllibmagicUsageThe main classEmailParsercontains all what you need to parse an email:importparse_emailsemail=parse_emails.EmailParser(file_path=<file_path>,max_depth=3,parse_only_headers=False)email.parse()print(email.parsed_email['Subject'])InputsArgument NameDescriptionfile_path*the file_path of a in msg or eml formatparse_only_headersWill parse only the headers and return headers table, Default is Falsemax_depthHow many levels deep we should parse the attached emails (e.g. email contains an emails contains an email). Default depth level is 3. Minimum level is 1, if set to 1 the script will parse only the first level emailfile_infothe file infoContributingContributions are welcome and appreciated. To contribute you can submit a PR.Before merging any PRs, we need all contributors to sign a contributor license agreement. By signing a contributor license agreement, we ensure that the community is free to use your contributions.When you open a new pull request, a bot will evaluate whether you have signed the CLA. If required, the bot will comment on the pull request, including a link to accept the agreement. The CLA document is also available for review as aPDF.If thelicense/clastatus check remains onPending, even though all contributors have accepted the CLA, you can recheck the CLA status by visiting the following link (replace[PRID]with the ID of your PR):https://cla-assistant.io/check/demisto/email-parser?pullRequest=[PRID].
Package: parsee-pdf-reader
Parsee PDF ReaderThis PDF reader was designed to overcome the common problems when trying to extract tables from PDFs.We started initially with a focus on financial/numeric tables, so this is where this PDF reader works best for.InstallationRecommended install with poetry:https://python-poetry.org/docs/Alternatively: pip install parsee-pdf-readerPRE-RELEASE PUBLIC VERSION -> big changes to repo in coming days (Feb 2024), recommended to wait for public relase (end of Feb 2024)
Package: parsegitlog
parsegitlogpython -m pip install parsegitlogContextI've been working on a project where I need to get information on every commit
from serveral hundred repos, and usingGitPython. GitPython is
great, but it was a little slow for what I was trying to do.The method of parsing the gitlog in this project is much faster for my use case.Note that this project is much more narrow in scope than GitPython, and relies
on parsing the output ofgit logdirectly, so might be more fragile.You might find this useful if you only need to analyze the commits for a repo,
and not perform any other git operations progromatically.UsageYou can either import this as a module or run it from the command line.Command Linepython -m parsegitlog --helppython -m parsegitlogImportingfromparsegitlogimportget_commitsrepo_path='/path/to/my/git/repository'get_commits(repo_path)get_commitswill return a list of dicts, each dict representing a single
commit from the repository.GotchasMerge commits will show up multiple times.This is intended behavior.Although they appear to be duplicates, thefiles_changed,insertions, anddeletionsfor each will be slightly different, and there will be duplicate
entries for each merge commit corresponding to the number of parents in the
merge. This is because, depending on which parent we compare to, the difference
from the parent (in terms of files changed, insertions, and deletions) won't be
the same (every other property should be the same).
Package: parsegrammar
Parse GrammarA library containing Directed Graph representing symbol to symbol translation with a Grammar class representing a start symbol and any terminal symbols.Used for representing finite state machines in automation bots.Usageimport grammar as grampGraph = gram.Graph()pGrammar = gram.Grammar(<start_symbol>, <end_symbol>, pGraph)where <start_symbol> is a vertex within pGraph
where <end_symbol> is a vertex, or list/set of verticies, within pGraphThe <start_symbol> can not be an isolated vertex.
Package: parsehecssp
# pasrsehecssp![example workflow](https://github.com/danhamill/parsehecssp/.github/workflows/python-publish.yml/badge.svg)HEC-SSP Report ParserThis repository is a work in progress…The goal of this package is to parse HEC-SSP reports and reproduce exactly.This package will be used to evaluate multiple HEC-SSP Analyses in ways HEC-SSP wont allow you.# Installation## pypi` pip install parsehecssp `## development` python setup.py develop `
Package: parse-helper
InstallInstall system requirements forlxml% sudo apt-get install -y libxml2 libxslt1.1 libxml2-dev libxslt1-dev zlib1g-dev

or

% brew install libxml2Install withpip% pip3 install parse-helper

Optionally install ipython with ``pip3 install ipython`` to enable
``ph-soup-explore`` commandUsageTheph-ddg,ph-download-files,ph-download-file-as, andph-soup-explorescripts are provided$ venv/bin/ph-ddg --help
Usage: ph-ddg [OPTIONS] [QUERY]

  Pass a search query to duckduckgo api

Options:
  --help  Show this message and exit.

$ venv/bin/ph-download-files --help
Usage: ph-download-files [OPTIONS] [ARGS]...

  Download all links to local files

  - args: urls or filenames containing urls

Options:
  --help  Show this message and exit.

$ venv/bin/ph-download-file-as --help
Usage: ph-download-file-as [OPTIONS] URL [LOCALFILE]

  Download link to local file

  - url: a string - localfile: a string

Options:
  --help  Show this message and exit.

$ venv/bin/ph-soup-explore --help
Usage: ph-soup-explore [OPTIONS] [URL_OR_FILE]

  Create a soup object from a url or file and explore with ipython

Options:
  --help  Show this message and exit.In[1]:importparse_helperasphIn[2]:ph.USER_AGENTOut[2]:'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.110 Chrome/58.0.3029.110 Safari/537.36'In[3]:ph.duckduckgo_api('adventure time')2019-08-2706:21:05,303:FetchingJSONfromhttps://api.duckduckgo.com?q=adventure+time&format=jsonOut[3]:[{'text':'Adventure Time An American animated television series created by Pendleton Ward for Cartoon Network.','thumbnail':'https://duckduckgo.com/i/fb8f17fd.png','link':'https://duckduckgo.com/Adventure_Time'},{'text':'"Adventure Time" (pilot) An animated short created by Pendleton Ward, as well as the pilot to the Cartoon Network series...','thumbnail':'https://duckduckgo.com/i/aa9b49e0.png','link':'https://duckduckgo.com/Adventure_Time_(pilot)'},{'text':"Adventure Time (1959 TV series) A local children's television show on WTAE-TV 4 in Pittsburgh, Pennsylvania, from 1959 to 1975.",'thumbnail':'','link':'https://duckduckgo.com/Adventure_Time_(1959_TV_series)'},{'text':"Adventure Time (1967 TV series) A Canadian children's adventure television series which aired on CBC Television in 1967 and 1968.",'thumbnail':'','link':'https://duckduckgo.com/Adventure_Time_(1967_TV_series)'},{'text':'Adventure Time (album) The second album for the rock/pop trio The Elvis Brothers.','thumbnail':'','link':'https://duckduckgo.com/Adventure_Time_(album)'}]
Package: parse-hh-data
Parse HH Data ProjectДанный модуль предназначен для удобного скачивания вакансий и резюме с сайтаhh.rufromparse_hh_dataimportdownload,parsevacancy=download.vacancy("36070814")resume=download.resume("d40ce6f80001a8c8380039ed1f5874726f5a6e")resume=parse.resume(resume)Вакансиискачиваются с помощьюAPI HHи возвращаются в формате описанномздесь.Обезличенныерезюмескачиваются непосредственно ссайтав html-формате,
а затем могут быть преобразованны в json-формат:birth_date : str - день рождения
gender : str - пол
area : str - город проживания
title : str - желаемая должность
specialization : list - специализации соискателя
    name : str - название специализации
    profarea_name : str - название профессиональной области, в которую входит специализация
salary : dict - желаемая зарплата
    amount : int - сумма
    currency : str - валюта
education_level : str - уровень образования
education : list - образование
    year : int - год окончания
    name : str - название учебного заведения
    organization : str - организация, специальность / специализация
language : list - список языков, которыми владеет соискатель
    name : str - название языка
    level : str - уровень знания языка
experience : list - опыт работы
    start : str - начало работы (дата в формате dd-MM-yyyy)
    end : str - окончание работы (дата в формате dd-MM-yyyy)
    position : str - должность
    description : str - обязанности, функции, достижения (может содержать html-код)
skills : str - дополнительная информация, описание навыков в свободной форме (может содержать html-код)
skill_set : list - ключевые навыкис помощьюparse_hh_data.parse.resume.Скачать списки идентификаторов вакансий или резюме можно используяparse_hh_data.download.vacancy_idsилиparse_hh_data.download.resume_ids, соответсвенно.Command line interfacedownload ~/resumes resume --area_ids 113 --specialization_ids 1 --search_period 30parse ~/data/resumes ~/data/resumes_json
Package: parseidf
parseidf.pyParses an IDF file (as used by EnergyPlus) into a dictionary of lists in
the following manner:each IDF object is represented by a list of its fields, with the
first field being the object type.each such list is appended to a list of objects with the same type in
the dictionary, indexed by type:{ A => [[A, x, y, z], [A, a, b, c]], B => [[B, 1, 2], [B, 1, 2, 3]] }the index keys are all capitalized.also, all field values are strings, i.e. no interpretation of the
values is made.Exampleimport parseidf

with open(r'in.idf', 'r') as f:
    idf = parseidf.parse(f.read())
print idf.keys()  # lists the object types in the idf file
print idf['OUTPUT:VARIABLE']  # lists all the Output:Variable objects in the idf fileDependenciesparseidf depends on PLY (Python Lex & Yacc):https://pypi.python.org/pypi/ply/3.4License & CreditThis project is licensed under the terms of the MIT license. See the
file “LICENSE” in the project root for more information.This module was developed by Daren Thomas at the assistant chair forSustainable Architecture and Building Technologies
(SuAT)at theInstitute of Technology in
Architecture, ETH Zürich.
Package: parse-iex
parse-IEXA collection of parsers forIEX.Use the parsers to gather relevant quotes and trades information.Currently, only TOPS parsing is supported.TOPS Parsing Examplefromparse_ieximporttopsmessage=b'\x51\x00\xac\x63\xc0\x20\x96\x86\x6d\x14\x5a\x49\x45\x58\x54\x20\x20\x20\xe4\x25\x00\x00\x24\x1d\x0f\x00\x00\x00\x00\x00\xec\x1d\x0f\x00\x00\x00\x00\x00\xe8\x03\x00\x00'print(tops.decode_message(message))best bid: 9700 ZIEXT shares for 99.05 USD; best ask: 1000 ZIEXT shares for 99.07 USD @ 2016-08-23 19:30:32.572716TODOMake a basic parserWrite documentationReport errorsAdd a DEEP parserParse trading breaks
Package: parse-ingredients
parse-ingredientsParse strings of ingredients to their name, unit, quantity and optional comments.To installpip install parse-ingredientsTo usefromparse_ingredientsimportparse_ingredientresult=parse_ingredient("12 ounces lean ground beef, preferably 85 percent lean")print(f"Found results:\n{result}")parse_ingredient()returns an object in the form of:{"name":"lean ground beef","quantity":12,"unit":"oz","comment":"preferably 85 percent lean","original_string":"12 ounces lean ground beef, preferably 85 percent lean"}
Package: parseit
A simple parsing tool in 200 lines of pythonGive it a grammar and tokens, and it’ll give you back an ast.InputsUse theparse()function to parse text. Thetokensparameter is
a dictionary of token names to compiled regular expressions. Prefixing a
token with%will ignore it. Token names must be uppercase.Therulesparameter is a dictionary of names to lists of rules, and
thestartparameter is what node to start parsing first.postlexandpostparseand post-processing functions. The default will:after lexing remove all tokens that start with a%after parsing flatten all nodes with 1 childRulesA rule is a list of rulesegments. A rulesegment can be a string, which
means parse that TOKEN/rule_name. A list rule segement is a group, the
last item in it can be one of the following:?: this group is optional+: match at least one of this group, and possibly more*: match any number of this group, including zeroAn example rule looks like this:[["NUM","?"],["var","*"]]The rule dictionary is a dictionary of rule_names to lists of these
rules, each one being a possibility, like this:{"multi_poly":[["LPAREN","polynomial","RPAREN","LPAREN","polynomial","RPAREN"],["NUM","LPAREN","polynomial","RPAREN"],["polynomial"]]}OutputThe tree format of ParseIt is very simple: for rule instances (nodes)
you have a tuple with the first value being the node name, and the
second being its children.Tokens are represented as a tuple of: the token name, the token content,
and its position in the streamtreeifyThere is also a module called treeify in the package that (if pydot is
installed) allows you to create a graphical representation of the
generated trees.Exampleexample.pyhas an example grammar and code to convert the generated
tree into a pydot
Package: parselab
parselabThis package contains classes that help to write parsers in Python.UsageTo useparelabjust create a class derived fromBasicParser.fromparselab.cacheimportFileCachefromparselab.networkimportNetworkManagerfromparselab.parsingimportBasicParserclassMyParser(BasicParser):def__init__(self):self.cache=FileCache(namespace='my-parser',path=os.environ.get('CACHE_PATH'))self.net=NetworkManager()db.connect(os.environ['PARSINGDB'])db.setup_project('my-project')After that you will be able to download pages usingBasicParser.get_page()method:classMyParser(BasicParser):...defrun(self):page=self.get_page('https://google.com')BasicParserwill use network manager specified in__init__method and will save all
downloaded pages into directory specified by your$CACHE_PATHenvironment variable.
Next time you invokeget_page()method it will get the requested page from cache
if available.