Saravanan666/pypi-org huggingface dataset:
Package: grammarette
GrammaretteGrammarette is a lightweight grammar inducer for toy lexicons. Given a set of meaning–signal pairs (the lexicon), Grammarette produces a regex-like grammar that is as short as possible (in bits). This may be useful for analyzing the results of artificial language learning experiments, where the complexity of a lexicon may be quantified as the length of its shortest description. Grammarette is a work-in-progress and is not guaranteed to produce the shortest grammar. It usesmultiple sequence alignmentto align the signals and then writes grammars for all $2^{n-1}$ possible ways of partitioning the alignment. The shortest grammar that remains consistent with the observed lexicon is the grammarette.InstallationGrammarette can be installed from the PyPI:pipinstallgrammaretteGrammarette has two dependencies, NumPy and SciPy, and is compatible with Python 3.8+.Exampleimportgrammarettelexicon={(0,0):"buvikoe",(0,1):"buvikoh",(0,2):"buvikoe",(0,3):"buvichoe",(1,0):"zeteekoe",(1,1):"zeteekoh",(1,2):"zeteekoe",(1,3):"zeteechoe",(2,0):"gafykoe",(2,1):"gafykoh",(2,2):"gafykoe",(2,3):"gaffychoe",(3,0):"wopykoe",(3,1):"wopykoh",(3,2):"wopykoe",(3,3):"wopychoe",}grmr=grammarette.induce(lexicon,dims=(4,4))print(grmr)# Grammarette[0?buvi|1?zetee|23gaffy|2?gafy|3?wopy+?3ch|??k+?1oh|??oe]print(grmr.grammar)# 0?buvi|1?zetee|23gaffy|2?gafy|3?wopy+?3ch|??k+?1oh|??oeprint(grmr.codelength)# 230.2261782820019print(grmr.regex)# ^((?P<kejeboxu0_>buvi)|(?P<hutusifo1_>zetee)|(?P<cedakesu23>gaffy)|(?P<coxycatu2_>gafy)|(?P<kusenewo3_>wopy))?((?P<byfipyxi_3>ch)|(?P<fujuvohy__>k))?((?P<nydepazy_1>oh)|(?P<wyvelesi__>oe))?$print(grmr.produce((2,3)))# use the induced grammar to produce a signal for meaning (2, 3)# gaffychoeprint(grmr.comprehend('buvikoe'))# use the induced grammar to infer meanings for "buvikoe"# [(0, 0), (0, 1), (0, 2), (0, 3)] # this is currently incorrect, should be [(0, 0), (0, 2)]Known issuesIn some cases, a grammarette may not infer the correct set of meanings for a given input signal. This is partly an issue with the grammarette parser and partly an issue with the grammarette itself, which, in some cases, does not properly preserve all meaning information (the compression may be lossy).Grammarette is not well tested with more than two dimensions and may not perform well in such cases.
Package: grammar-graph
GrammarGraphCreating graphs from context-free grammars for fun and profit.FeaturesCreating sub graphsExport back to grammarsReachabilityFilter abstractionDijkstra's algorithm for shortest paths between nodesChecking whether a (sub) graph represents a treeComputing k-paths (paths of exactly length k) in grammars and derivation trees, and a
k-path coverage measure (see this paper) of
derivation trees based on that.Have a look at ourfeature demo!InstallGrammarGraph requires at least Python 3.9.We recommend to install GrammarGraph in a virtual environment. Example usage (inside project directory):python3-mvenvvenvsourcevenv/bin/activate
pipinstall-rrequirements.txt# Run testspython3-mpytest-n16Author:Dominic Steinhöfel.
Package: grammarly-scraper
TitleGrammarly ScraperDescrptionWith grammarly Scraper you can scrape search results and extract the contents produced by the search result.In grammarly scraper it will scrape the data present of the website and give json data which contains the details of the contents on the website.It gives the every detail present inside website such as title, text, description, grammar check etc. from the website.JSON sample data{"Scraper_Grammarly":[{"column_0":[{"text":"Whether you\u2019re a native English speaker or just beginning to learn, English grammar can be confusing. But proper grammar isn\u2019t the only thing you need to think about. Have you ever sent off an important email only to realize moments later that you forgot to run spell check and missed a mistake in the very first line? Do you struggle with apostrophes or spend way too long trying to identify the correct place to use a comma? Even if you\u2019re confident in your grasp of English grammatical rules, it\u2019s easy to mistype when you\u2019re writing fast and concentrating on your ideas."},{"text":"Grammarly is more than a grammar check, more than a spell check, and more than a punctuation corrector. It\u2019s a comprehensive writing tool that helps you write clear, flawless text that will impress your readers. With Grammarly, you\u2019ll build writing skills while you\u2019re correcting grammar, spelling, and punctuation mistakes as well as sentence structure problems, misused words, typos, and more."}],"title":"More Than a Grammar Checker"}Download full sample dataRun Scraperfromgrammarly_scraperimport*link="https://www.grammarly.com/grammar-check"data=run_grammarly_scraper(link)How it works?It takes URL of grammarly page with a search keyword to scrape the data.It generates the json data which contains the information of the grammarly search result.ExamplesBelow are some of the examples of URLs using which you can scrape:Example 1Example2Queries/ FeedbackIf you have some queries or feedback please contact us at followingTelegramEmail
Package: grammar-to-regex
Grammar2RegexConversion of context-free grammars to regular expressions. Grammar2Regex can precisely convert regular
(left-linear / right-linear) grammars to regular expressions, either into a custom ADT format suitable
for further processing, or into ReRef objects of the z3 SMT solver.Grammar2Regex can also convert arbitrary context-free grammars, which naturally comes with some loss of
information. In such cases, the tool "unwinds" the grammar up to a configurable depth, thus removing all
problematic expansions. The resulting regular expression represents a sub-language of the input grammar's
language.ExampleConsider the following grammar of XML attribute or tag name identifiers:importstringfromtypingimportDict,Listfromfuzzingbook.Grammarsimportsrangexml_id_grammar:Dict[str,List[str]]={"<start>":["<id>"],"<id>":["<id-no-prefix>","<id-with-prefix>"],"<id-no-prefix>":["<id-start-char>","<id-start-char><id-chars>",],"<id-with-prefix>":["<id-no-prefix>:<id-no-prefix>"],"<id-start-char>":srange("_"+string.ascii_letters),"<id-chars>":["<id-char>","<id-char><id-chars>"],"<id-char>":["<id-start-char>"]+srange("-."+string.digits),}Our chosen grammar format is the one from theFuzzing Book.This grammar can be precisely converted into a regular expression:fromgrammar_to_regex.cfg2regeximportRegexConverterconverter=RegexConverter(xml_id_grammar,compress_unions=True)print(converter.to_regex('<start>',convert_to_z3=False))which yields an object of type grammar_to_regex.regex.Regex, in pretty print:((["-" .. "."] | ["0" .. "9"] | ["A" .. "Z"] | "_" | ["a" .. "z"])* • (["-" .. "."] | ["0" .. "9"] | ["A" .. "Z"] | "_" | ["a" .. "z"]))You can also obtain an output in the regular expression format of thez3 SMT solverif you need this for further processing (simply omit theconvert_to_z3=Falseor set that parameter toTrue).InstallationGrammar2Regex requires Python 3.10.To install Grammar2Regex, runpython3setup.pysdist
pip3installdist/grammar2regex-0.0.1.tar.gzWe recommend installation in a virtual environment, also since our requirements list pinned
version numbers. If you experience any problems with the pinned versions, feed free to find a working,
relaxed version and submit a pull request :)License and MaintainerThis project is licensed under the GNU GENERAL PUBLIC LICENSE v3.
It is maintained byDominic Steinhöfel.
Package: grammatical
GrammaticalCorrects the spelling and grammar of your text using ChatGPT.MotivationI have been using this CLI tool internally for a while now. It is not only good at correcting spelling and grammar in your text, but it is also excellent at simplifying complex technical language. Additionally, it perfectly complementsGrammarly.Installpython3-mpipinstallgrammaticalUsageThis toolrequires access to theOpenAI API. It utilizes thegpt-3.5-turbomodel. When the spelling and grammar have been corrected, the resulting text will be automatically copied to the clipboard.Usage:grammatical[OPTIONS]CorrectsthespellingandgrammarofyourtextusingChatGPT.

Options:--textTEXTTextinputforgrammarcorrectionIf--textflagisused,apromptwillbedisplayedtoenterthetext.Bydefault,themostrecenttextfromtheclipboardwillbeused.--api_keyTEXTOpenAIAPIKeyBydefault,keyfromtheOPENAI_API_KEYenvvarwillbeused.--toneTEXTToneofthegrammarcorrection[default:"social media"]Thiscanbetunedinbasedonthecontextofthetext.E.g."formal/informal setting","academia","reddit",etc.--simplifySimplifythetext-i,--input_formatTEXTSpecifytheinputformat[default:text]UsefulwhenworkingwithfileslikeLaTeX,Markdown.-o,--output_formatTEXTSpecifytheoutputformat[default:text]UsefulwhenworkingwithfileslikeLaTeX,Markdown.--helpShowthismessageandexit.ExampleUsing the defaults:[09:34][~] # Text in clipboard: I walk to the store and I bought milk
[09:34][~] grammatical
Modified Text:
"I walked to the store and bought milk."
Text copied to clipboard.
[09:34][~]With options:[14:39][~] # Text in clipboard: This tool does need access to [OpenAI's API](https://openai.com/pricing). It uses the `gpt-3.5-turbo` model.
[14:40][~] grammatical --tone "documentation" -i "markdown" -o "markdown"
Modified Text:
 This tool requires access to [OpenAI's API](https://openai.com/pricing), utilizing the `gpt-3.5-turbo` model.
Text copied to clipboard.
[14:40][~]My MacOS WorkflowFor my macOS workflow, I havecreated a newApplicationin Automatorthat runs "Grammatical" for
convenience. I have also dragged it to the Dock.Here is the AppleScript that I am using:tellapplication"Terminal"activatedoscript"grammatical"endtellIf you are mostly concerned with the defaults, I highly recommend doing this.LicenseUnderMIT License. The logo ismade using Midjourneyand licensed underCC BY-NC 4.0.
Package: gramme
A elegant way to pass volatile data around overUDP (datagrammes)serialized withmsgpackExample Serverfrom gramme import server

@server(3030)
def handler(data)
    print dataExample Clientfrom gramme import client

clnt = client(host="132.23.x.x", port=3030)

some_data = {'i am': 'a dict'}

clnt.send(some_data)InstallationInstallgrammewith pip:$ pip install grammeLicenseBSD
Package: grammpy
grammpyCurrent version: 2.0.0Package for representing formal grammars.
Contains algorithms to work with a grammars and parse them.InstallationIf you are usingpip, simple run following command.pip install grammpyYou can install the package from the repository as well.git clone https://github.com/PatrikValkovic/grammpy.git
cd grammpy
python setup.py installUsageDefining a grammar doesn't require special tools anymore.
All what you need is just a IDE and you have the full support.Let's define grammar using standard Python objects instead.fromgrammpyimport*fromgrammpy.transformsimportContextFree,InverseContextFreefromgrammpy.parsersimportcykclassNumber:def__init__(self,value):self.value=valuedef__hash__(self):returnhash(Number)classPlusNonterminal(Nonterminal):@propertydefvalue(self):returnself.to_rule.get_value()classPlusRule(Rule):rule=([PlusNonterminal],[PlusNonterminal,'+',PlusNonterminal])defget_value(self):child1=self.to_symbols[0]child2=self.to_symbols[2]returnchild1.value+child2.valueclassRewriteRule(Rule):fromSymbol=PlusNonterminaltoSymbol=Numberdefget_value(self):returnself.to_symbols[0].s.valueg=Grammar(terminals=[Number,'+'],nonterminals=[PlusNonterminal],rules=[PlusRule,RewriteRule],start_symbol=PlusNonterminal)ContextFree.prepare_for_cyk(g,inplace=True)root=cyk(g,[Number(5),'+',Number(3),'+',Number(8)])root=InverseContextFree.reverse_cyk_transforms(root)assertroot.value==16DocumentationYou can read more about the library in thedocdirectory.ExamplesYou can view some examples in theexamplesdirectory.Version: 2.0.0Author: Patrik ValkovičLicence: MIT
Package: grampg
Copyright 2012 Elvio Toccalino.ABOUTThegrampg(cue toGrumpy Admin Password Generator, and pronounced “grummpeegee”) is a small Python library which allows to generate passwords according to (possibly complicated)user specs. The idea is simple: build an instance, feed it your desired specifications, then generate as many passwords as you want. Each password generated will be independent of the others, except from the fact that all of them will comply with the specs.The objectives for thegrampgare flexibility and easy of use.grampgfulfills by providing akindinterface to the user: When building the password generator the user writes the spec as if it were being pronounced. In this fashion, a set of complex rules is expressed in a declarative line.USAGETypical usage follows the pattern outlined before: build a generator instance, feed it your specs, collect your passwords. This brief explanation fails to explainhow, which is the main attractive of thegrampg. As an example, consider the following:Your admin needs your system to produce passwords of between 5 and 10 letters, at least 4 numbers, adding up to 10 characters total. Oh, and since this passwords may be used in some-mail-system, they should start with a letter.The constrains, orspecs, are quite contrived, but they can be fed togrampgsimply:from grampg import PasswordGenerator
passwords = (PasswordGenerator().of().between(5, 10, 'letters')
                                     .at_least(4, 'numbers')
                                     .length(10)
                                     .beginning_with('letters')
                                     .done())
return [passwords.generate() for i in xrange(so_many_passwords)]Only one generator instance is created, and then used to produce as many passwords as are required.Other character sets available by default are ‘lower_letters’, ‘upper_letters’, and ‘alphanumeric’, but the user is free to build generator instances with any character sets desired (as well as overriding the defaults). For example:passwords = (PasswordGenerator({'special': list('%$#!*'), 'letters': list('abcde')})
                              .of().exactly(3, special).at_most(2, 'special').done())For more examples, execute and read themany_passwords.pyprogram (which lives ingrampg/demo), a simple program that spits passwords according to somewhat realistic specifications. There is also theusecases.pyfile, which consists of many uses of thegrampgand their expected output (both valid and not).TESTSThegrampgpackage includes the following files which purpose is to serve as test bed:tests.pyUnit test suite.usecases.pyIntegration tests.regression.pyRegression tests. Like integration, but actual examples that went awry and are now fixed.ABOUT THE NAMEThe name sucks, I know. It’s meant as a silly joke to the person who inspired the code creation.LICENSEThegrampgsoftware package (including tests, documentation and demonstration programs) is licensed under the GNU Affero GPL version 3.0. A copy of the license is included with thegrampgpackage. For details about the license, visithttp://www.gnu.org/licenses/agpl.html.
Package: gramps-webapi
Gramps Web APIThis is the repository forGramps Web API, a Python REST API forGramps.It allows to query and manipulate aGrampsfamily tree database via the web.Gramps Web API is the backend ofGramps Web, a genealogy web app based on Gramps, but can also be used as backend for other tools.More informationAPI documentation for Gramps Web API:https://gramps-project.github.io/gramps-web-api/Developer documentation for Gramps Web API:https://www.grampsweb.org/dev-backend/Documentation for Gramps Web:https://www.grampsweb.orgRelated projectsGramps Web frontend repository:https://github.com/gramps-project/gramps-web
Package: gramps-web-api-client
Gramps Web API ClientA simple Python client based onrequestsfor interacting with aGramps Web APIserver.WarningThis is an experimental project for advanced users. The goal is to allow powerful batch operations on Gramps objects via the API. But only use it if you know what you are doing – you can easily break your Gramps database with this tool!Quick startFirst, instantiate the API instance:fromgramps_web_api_clientimportAPIapi=API(host="https://my-gramps-web-instance.com",basic_auth("my_user","my_password"))Methods currently implemented:Methoddescriptionapi.iter_people()Generator iterating over peopleapi.iter_events()Generator iterating over eventsapi.iter_places()Generator iterating over placesapi.get_person(handle)Get a single person by handleapi.get_event(handle)Get a single event by handleapi.get_place(handle)Get a single place by handleapi.update_person(handle, data)Update a single personapi.update_event(handle, data)Update a single eventapi.update_place(handle, data)Update a single placeapi.create_person(data)Create a new personapi.create_event(data)Create a new evebtapi.create_place(data)GCreateet a new placeIn all cases,dataare dictionaries for JSON objects following the Gramps Web API conventions.ExamplesRemoving all citations from an existing person:api.update_person("somehandle",{"citation_list":[]})In this example, all other properties of the person (except citations) will remain the same.Creating a new place:api.create_place({"name":{"_class":"PlaceName","value":"Gotham City"}})Iterating over people and adding a citation if a condition is satisfied:forpersoninapi.iter_people():try:surname=person["primary_name"]["surname_list"][0]["surname"]except(KeyError,IndexError):continueifsurname=="Garner":api.update_person(person["handle"],{"citation_list":person["citation_list"]+["some_citation_handle"]})
Package: grams
gramsA Python library for managing the histograms of text corpuses.InstallationUse the package managerpipto install grams.pipinstallgramsUsageimportgrams# Generate a histogram from a list of sentenceshist=grams.Histogram(['A sentence here.','A sentence there.','A sentence anywhere.'])# Generate a histogram from a text filewithopen('corpus.txt','r')asfile:file_hist=grams.Histogram(file)# Find the distance between histograms ∈ [0, 1]similarity=hist.similarity(file_hist)# Sample a random word weighted by its number of occurrencesword=hist.sample()# Display word frequencies in the terminalhist.visualize()#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Lorem      : ▇▇▇▇ 4.00# Ipsum      : ▇▇▇▇ 4.00# is         : ▇ 1.00# simply     : ▇ 1.00# dummy      : ▇▇ 2.00# text       : ▇▇ 2.00# of         : ▇▇▇▇ 4.00# the        : ▇▇▇▇▇▇ 6.00# printing   : ▇ 1.00# and        : ▇▇▇ 3.00# typesetting: ▇▇ 2.00# industry   : ▇ 1.00# has        : ▇▇ 2.00#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Create a distribution object from code coverage datacov=grams.Covergram("Documents/.coverage")# We can visualize our code coverage data as well.cov.visualize()#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# __init__.py       : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00# grams.py          : ▇▇▇▇▇▇▇▇▇▇▇▇ 25.00# hashtable.py      : ▇▇▇▇▇▇▇▇▇▇▇ 22.00# linkedlist.py     : ▇▇▇▇▇▇▇ 15.00# online.py         : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 40.00# stats.py          : ▇▇▇▇▇▇▇▇▇▇ 21.00# termgraph.py      : ▇▇▇▇▇▇ 12.00# utils.py          : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 31.00#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Our distribution also maintains some useful statisticsavg_code_cov=int(cov.mean)frequency_standard_deviation=int(hist.std)frequency_variance=int(hist.var)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: gramscript
Powerful, MTProto API framework in Python for users and botsDescriptionGramscript is a framework for building efficient, scalableTelegramserver-side applications. It uses modernUnder the hood, Nest makes use ofExpress, but also, provides compatibility with a wide range of other libraries, like e.g.Fastify, allowing for easy use of the myriad third-party plugins which are available.Getting startedTo check out theguide, visithttps://gramscript.git.io/. :books:要查看中文指南, 请访问https://gramscript.github.io/docs/zh. :books:가이드문서는https://gramscript.github.io/docs/kr에서 확인하실 수 있습니다. :books:ガイドはhttps://gramscript.github.io/docs/jpでご確認ください。 :books:QuestionsFor questions and support please use theDiscussions Page. The issue list of this repo isexclusivelyfor bug reports and feature requests.IssuesPlease make sure to read theIssue Reporting Checklistbefore opening an issue. Issues not conforming to the guidelines may be closed immediately.Supportgramscript is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, pleaseread more here.Stay in touchAuthor -KalanaktWebsite -https://gramscript.git.ioGithub -@gramscriptLicenseGramscript isMIT licensed.
Package: gramutil
gramutilGramUtil is a utility for grammars in computer science. Currently, context-free grammars (CFG) and pushdown automatas (PDA) are supported.Installationpip install gramutilOverviewContextFreeGrammarThis class provides initialization and methods for a context free grammar. Common operations are demonstrated below:fromgramutilimportcfggrammarString="""S -> 0 S 0 | TT -> 1 T 1-> $"""# Create the grammar from the stringgrammar=cfg.ContextFreeGrammar(grammarString)# Simplify the grammar (simplifies using basic rules)grammar.simplify()# Removes any duplicate productions from any stategrammar.removeDuplicates()# Converts the grammar to a pushdown automata objectpda=grammar.toPDA()# Prints a textual representation of the grammarprint(grammar)The rules for a grammar string are as follows:Start state must beSMultiple productions for one state may be separated by the|characterMultiple productions for one state may also be on multiple lines, as shown aboveThe epsilon (empty string) character is signified with a$Terminals may be an underscore or lowercase alphanumericNonterminals have the same rules, but must start with an uppercase character and allow uppercase throughoutAll terms (terminals and nonterminals) must be space-separatedPushdownAutomataThis class provides initialization and method for a pushdown automata. Currently, creation is only supported from aContextFreeGrammar.fromgramutilimportcfggrammar=cfg.ContextFreeGrammar('S -> 0 S 0 | $')# Two options for creating the PDApda=cfg.PushdownAutomata(grammar)pda=grammar.toPDA()# Prints a textual representation of the PDAprint(pda)# Converts the PDA back to a CFGgrammar=pda.toCFG()grammar.simplify()print(grammar)ExamplesCheck outexamples/convert.pyfor an example use
Package: granadilla
This django-backed software provides a simple administration tool for a minimal LDAP directory:Web application providing a clean, editable phonebook (including pictures)Command-line tool to manage users and groupsIt has been designed for the specific LDAP setup at Polyconseil, but could be useful to other teams/companies.ConfigurationThe webapp can run either in a standalone mode (with thegranadilla_webapp.settingssetup)
or integrated in a larger website; the required settings are listed ingranadilla/conf.py.The command-line tool is designed for standalone use, and reads its settings from the/etc/granadilla/settings.inifile.
This file is also used by the webapp if launched in standalone mode, withDJANGO_SETTINGS_MODULE=granadilla_webapp.settings.The valid configuration values are described in theexample_settings.inifile.LicenseCopyright (C) 2009 Bolloré telecom
Copyright (C) 2014 Polyconseil
See AUTHORS file for a full list of contributors.This 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
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU 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/>.