Saravanan666/pypi-org huggingface dataset:
Package: text-justifier
Python Text JustifierJustify and hyphenate text in files and/or standard input.  The program can be
invoked as eithertext-justifierorjustify.Installation/Upgrade``pip3 install -U text-justifier``Options-w,--width*INTEGER*Width of text, not counting indent-i,--indent*INTEGER*Number of spaces to add before text-r,--right-margin*INTEGER*Determine the width of text to suit a specific column, i.e. right margin is
indent plus width.-c,--centre,--no-centre,--center,--no-centerAutomatically determine line width based on terminal width, with indent
mirrored on the right.  Will probably not work with indent of 0 (the
default).  Uses$COLUMNSif the terminal size cannot be queried.-s,--simple-hyphenUse simple hyphenation method.-h,--hyphenUsepyphenlibrary to hyphenate, which uses OpenOffice hyphenation
dictionaries.-H,--no-hyphenateTurn hyphenation off.Free software: GNU General Public License v3Documentation:https://text-justifier.readthedocs.io. (TBA)FeaturesCan centre text according to the screen/terminal widthIndent textTO DOEm dashes (— or –) should be used padded before random padding is doneDon’t hyphenate URLsExtract URLs, replace with placeholders and dump after paragraph;
Use Markdown style or something similar i.e.[text](url)->[text][URL_PLACEHOLDER]and[URL_PLACEHOLDER]: url[url]->[0]and[0]: urlOption (-fn) to add a first-line indent to each paragraphOption (-n) to split paragraphs on newline instead of blank linesTreat lines that begin with a list character as their own paragraphAlgorithmGrab a line’s worth of text plus the word that would push it over the limitCount the number of characters in the “safe” lineThe delta equals the difference between the line length and (limit subtract
the number of full stops except one at the end of a line)Determine the hyphenation threshold n = limit / 20, i.e. one extra space per
20 charactersIf the overflow word is at least n*2 characters long, attempt to hyphenate itFind the largest usable fragment of the overflow word no longer than delta - 1Add the fragment if hyphenating and change delta to (delta subtract (fragment
length + 1))Add a space after at most (limit subtract line length) full stops (determined randomly)Add a space before and after at most delta/2 em dashes and recalculate deltaAdd a space after delta random spacesIf hyphenating and the next line’s delta would be greater than this one’s
without hyphenation, don’t hyphenateCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.9.0 (2022-12-17)First release on PyPI.
Package: textkit
Simple text analysis from the command line.Homepage:http://learntextvis.github.io/textkit/Abouttextkitis a series of small, unix-style tools that provide a suite of capabilities for
dealing with text as data.Think of textkit as basic natural language processing capabilities - from the command line.textkit FeaturesHere are some of the cool things you can do with textkit.Convert a document to a set of word tokens and remove all punctuation from the tokens:textkittext2wordsinput.txt|textkitfilterpuncCount top used words in a text:textkittext2wordsalice.txt|textkitcount--limit20Do the same, but with punctuation removed:textkittext2wordsalice.txt|textkitfilterpunc|textkitcount--limit20Installation$ pip install -U textkit
$ textkit --helpDev installTo test locally, clone the repo:git clone git@github.com:learntextvis/textkit.gitCreate a local virtual environment orcondaenvironment.Here is how I created my localcondaenvironment for installing and testing textkit:conda create --name textkit nltk

source activate textkitThen I went into thetextkitdirectory to install its requirementscd textkit

pip install -r requirements.txtFinally, I installed the local version of textkit using the–editableflag:pip install --editable .ExamplesSee more examples at theQuickstart guide.RequirementsPython >= 2.6 or >= 3.3Project LinksDocs:http://learntextvis.github.io/textkit/PyPI:https://pypi.python.org/pypi/textkitIssues:https://github.com/learntextvis/textkit/issues
Package: textknnassifier
TextKNNClassifierTextKNNClassifieris a k-nearest neighbors classifier for text data. It uses a compression algorithm to compute the distance between texts and predicts the label of a test entry based on the labels of the k-nearest neighbors in the training data.InstallationYou can installTextKNNassifierusing pip:pipinstalltextknnassifierUsageHere's an example of how to useTextKNNClassifier:fromtextknnassifierimportclassifiertraining_text=["This is a test","Another test","General Tarkin","General Grievous",]training_labels=["test","test","star_wars","star_wars"]testing_data=["This is a test","Testing here too!","General Kenobi","General Skywalker",]KNN=classifier.TextKNNClassifier(n_neighbors=2)KNN.fit(training_data,training_labels)predicted_labels=KNN.predict(testing_data)print(predicted_labels)# Output: ['test1', 'test1', 'star_wars', 'star_wars']In this example, we create aTextKNNClassifierinstance and use it to predict the labels of the test entries. The initialization is givenn_neighbors=2, this denotes the number of training datapoints to consider for predicting the testing label. Thefitmethod takes two arguments: the training data, and the training labels. It simply stores these values for later use. Thepredictmethod takes the testing data as an argument and returns the predicted labels.ReferencesJiang, Z., Yang, M., Tsirlin, M., Tang, R., Dai, Y., & Lin, J. (2023, July). “Low-Resource” Text Classification: A Parameter-Free Classification Method with Compressors. In Findings of the Association for Computational Linguistics: ACL 2023 (pp. 6810-6828).
Package: textland
TextLandLike wayland, for text apps, because using curses sucksExampleSee demos in the top-level directoryEnvironmentTEXTLAND_DISPLAY can be set to one of the following strings:curses(default): to use the ncurses interfaceprint: to use portable printer 80x25 “display”test: to use a off-screen display that replays injected test events and
records all the screens that were “displayed”
Package: textle
textletextleis software to automate the use of typesetting and their support tools, likeLaTeXandpandoc.UsageFor more information, see the full documentation onread the docs, or in thedocs/folder.Installation$ # textle is python3 only
$ pip3 install textleAlternatively, install from source by cloning this repo and using$ python3 setup.py installTo build the documentation to thesitefolder,$ mkdocs buildWhyThis tool was created as I often create small one-off TeX (sometimes from markdown through pandoc) projects that need to be formatted in similar ways, and that I like building quickly.textleaims to solve these problems: it makes it easy to not only build a project to a PDF once, but even to do it live; and it makes simple the definition of the project. All one has to
do is either use the CLI, which was designed to be powerful and simple, or write aTextlefile. The project also aimed to be lightweight, both binary-wise and filesystem-wise, the idea being to
not pollute a VCS with random files.The Usage section demonstrates my common use cases.LicensingThe logo is licensed under theCC BY-SA 4.0This project is licensed under the MIT License, seeLICENSEfor more information.
Package: textlinebreaker
TextlinebreakerDescriptionText Line Breaker is a Python script that takes a string of text and breaks it into lines of a specified maximum width. This tool is particularly useful for formatting and displaying text in a terminal.FeaturesSplit text lines to fit within a specified maximum width.Choose alignment options for the text (left, center, right).Adjust the maximum width (default value is the terminal width).Latest Version 0.1.0Fixed a bug where the string was split in single characters rather than in words.Added a check for the input to establish if it is a list or a string in order to perform the correct splitting method.Table of ContentsGetting StartedPrerequisitesInstallationUsageParametersExamplesContributingLicenseGetting StartedPrerequisitesThis script relies on the Python standard library and does not require any additional dependencies.InstallationInstall the package with pippipinstalltextlinebreakerImport the package in your programfromtextlinebreakerimportsplit_lineUsageThis function takes a long string of text as input and breaks it into lines according to the specified maximum width.
The default length is the width of the terminal.ParametersThesplit_linefunction accepts the following parameters:line: is the main argument, it's the text that needs to be broken down.max_width: Allows you to set the maximum length of text on a line. Default value is the terminal width. Allowed values are integers.alignment: Allows you to change the alignment of the text inside the frame. Default value is "left". Allowed values are "left", "centre" or "center", and "right".ExamplesHere's an example of how to use thesplit_linefunction:fromtextlinebreakerimportsplit_linetext="This is an example of text line breaking using the Text Line Breaker script."lines=split_line(text,max_width=30,alignment="center")forlineinlines:print(line)Output:ThisisanexampleoftextlinebreakingusingtheTextLineBreakerscript.ContributingIf you'd like to contribute to this project, please follow these steps:Fork the repository on GitHub.Clone the fork to your local machine.Create a new branch for your feature or bug fix.Make your changes and commit them.Push the changes to your fork on GitHub.Create a pull request to the original repository.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: textlocal-pro
TextLocal PythonTextLocal REST API Implementation in PythonFree software: MIT licenseDocumentation:https://textlocal-python.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.9 (2018-07-16)Adds get balance API0.1.0 (2018-07-12)First release on PyPI.
Package: textlog
Get Started withtextlogSimple Python Text LogGetting StartedUse our step-by-step guide to get started withtextlogin minutes.1. Download PythonGet started with Python to use everything in thetextlog.Download Python2. Get the command line toolpipinstalltextlog3. UseCommandadd# Defaultpythonlog.pyadd"FILE NAME""CONTEXT"# Examplepythonlog.pyadd"dongs""update >> 0.0.1 --> 0.0.2"# Option# -p : Write and print at same time.# -P : Specifies the path of the file.#   Examplepythonlog.pyadd-P"c:"log"(2019.10.20 20:23) process >> END"-phelp# Default and ExamplepythonhelpPythonlogfile_namecontextpath=None# Path where the file will be stored# default(None) : Interpreter execution locationisPrint=False# with printExampleimporttextlogtextlog.log("dongs","update >> 0.0.1 --> 0.0.2",path="c:/",isPrint=True)Log0.0.1.1add is_no_file option0.0.1create projectadd commandaddadd-p,-POptionhelpCopyrightCopyright (C) 2019 LEE DONG GUN. (gnyontu39@gmail.com) and contributors
Package: textmail
frommailer.TextMessageimportTextMessagefrommobile.tmobileimportTMobilefrommobile.verizonimportVerizonfrommobile.sprintimportSprintfromproviders.email_credentialsimportCredentialsfromproviders.gmailimportGmailmessage=TextMessage(Credentials("john@gmail.com","[App Password]",Gmail()))##Send email with list of Stringsmessage.email(subject="Hello world!",body="This is the message body.",recipients=["dave@gmail.com","mark@gmail.com","kyle@yahoo.com"])##Send email with list of Email objectsmessage.email(subject="Hello world!",body="This is the message body.",recipients=[Email("dave@gmail.com"),Email("mark@gmail.com"),Email("kyle@yahoo.com")])##Send a text messagemessage.text(subject="Hello world!",body="This is the message body.",recipients=[Sprint("0001112233")])##Send to a mixmessage.send(subject="Hello world!",body="This is the message body.",recipients=[Email("dave@gmail.com"),Verizon("1234567890"),ATNT("0987654321")])
Package: textman
This Package is motivated as a Text Data Manipulator
Following Files:
main.py -> Contains Running parameters of the Library
__init__.py -> An empty python file
vocabulary.py -> Contains function for vocabulary management
translator.py -> Contains functions for text data Translation
analyser.py -> Contains function for text data analysis
modifier.py -> Contains functions for modifying text data
setup.py -> Contains Setup Configuration DataCHANGELOG.txt -> Contains Version History of the Library
LICENSE.txt -> License for the release of the package
MANIFEST.ini -> Contains different filetypes required for the PackageChange Log0.0.1 (06/06/2022)First Release
Package: textmark
Text Annotation UtilitiesThis project supports buildling datasets for downstream tasks using many
open-source text-spotting datasets. It includes a number of classes and tools to
quickly and easily build text spotting datasets with many annotation types,
includingDot2-point bounding boxesQuadrilateral bounding boxesPolygonsBezier CurvesAdditionally, this library makes converting between types extremely easy through an intuitive and extensible interface.SetupUse pip to install:pip install textmarkTextAnnotationTextAnnotationis a base class that can be easily extended to support other annotation formats. This library includes several formats already. Of particular note is that TextAnnotation includes a class level conversion registry. Subclasses can be registered like so:# Add your subclass name:TextAnnotation.register_name(name,"My_Class")# Add any relevant conversions# you only need to convert to the "closest" next annotation typeTextAnnotation.register_conversion(BoxAnnotation,QuadAnnotation,BoxAnnotation.to_quad)TextAnnotation.register_conversion(QuadAnnotation,BoxAnnotation,QuadAnnotation.to_box)Now, a user can easily convert between Box and Quad annotations through the use ofmy_quad_annotation.to("Box")If there are additional registries, such as Quad <--> Polygon, the user can convert all the way from a Box to a Polygon annotation (or vice versa) in a single command:my_polygon_annotation.to("Box")This system works by constructing a graph of all registered conversions. When a user calls the.tomethod, the graph is searched for the target class, and then applies all conversions on that path. This library implements the following simple conversions, which can be automatically chained together:Polygon <--> QuadQuad <--> BoxBox <--> DotNote that moving up through the chain is a lossy process!!In addition, Bezier Curves can be converted to Polygons.VisualizingThis library also includes an easy visualization system. See the example below:fromtextmarkimportTextAnnotation,Visualizerimg_path=...my_annotation=TextAnnotation.factory("Poly",scene_text,language,*list_of_points)my_second_annotation=TextAnnotation.factory(...)# Can visualize an arbitrary number of annotationsvis=Visualizer(img_path,[my_annotation,my_second_annotation,...])visualization=vis.visualize()visualize.show()# uses PIL
Package: textmate-grammar-python
textmate-grammar-pythonAn interpreter for grammar files as defined by TextMate and used in VSCode, implemented in Python. TextMate grammars use the oniguruma dialect (https://github.com/kkos/oniguruma). Supports loading grammar files from JSON, PLIST, or YAML format.UsageInstall the module usingpip install textmate-grammar-python.Before tokenization is possible, aLanguageParserneeds to be initialized using a loaded grammar.fromtextmate_grammar.languageimportLanguageParserfromtextmate_grammar.grammarsimportmatlabparser=LanguageParser(matlab.GRAMMAR)After this, one can either choose to callparser.parsing_stringto parse a input string directly, or callparser.parse_filewith the path to the appropiate source file as the first argument, such as the the exampleexample.py.The parsedelementobject can be displayed directly by calling theprintmethod. By default the element is printed as an element tree in a dictionary format.>>>element=parser.parse_string("value = num2str(10);")>>>element.print(){'token':'source.matlab','children':[{'token':'meta.assignment.variable.single.matlab','children':[{'token':'variable.other.readwrite.matlab','content':'value'}]},{'token':'keyword.operator.assignment.matlab','content':'='},{'token':'meta.function-call.parens.matlab','begin':[{'token':'entity.name.function.matlab','content':'num2str'},{'token':'punctuation.section.parens.begin.matlab','content':'('}],'end':[{'token':'punctuation.section.parens.end.matlab','content':')'}],'children':[{'token':'constant.numeric.decimal.matlab','content':'10'}]},{'token':'punctuation.terminator.semicolon.matlab','content':';'}]}Alternatively, with the keyword argumentflattenthe element is displayed as a list per unique token. Here the first item in the list is the starting position (line, column) of the unique tokenized element.>>>element.print(flatten=True)[[(0,0),'value',['source.matlab','meta.assignment.variable.single.matlab','variable.other.readwrite.matlab']],[(0,5),' ',['source.matlab']],[(0,6),'=',['source.matlab','keyword.operator.assignment.matlab']],[(0,7),' ',['source.matlab']],[(0,8),'num2str',['source.matlab','meta.function-call.parens.matlab','entity.name.function.matlab']],[(0,15),'(',['source.matlab','meta.function-call.parens.matlab','punctuation.section.parens.begin.matlab']],[(0,16),'10',['source.matlab','meta.function-call.parens.matlab','constant.numeric.decimal.matlab']],[(0,18),')',['source.matlab','meta.function-call.parens.matlab','punctuation.section.parens.end.matlab']],[(0,19),';',['source.matlab','punctuation.terminator.semicolon.matlab']]]Supported LanguagesMATLABTODOImplement Begin/While pattern, required for other grammars.SourcesTextmate guideVSCode Syntax Highlighting guidevscode-textmateMacromates texmate
Package: text-me-keras
Text Me KerasA TensorFlow callback that texts back... to let you know how training is going.Have you ever found yourself at a party, all your friends are getting hundreds of texts... but not you? Well, now you can be popular. Just add this callback when training your models and it will send you a summary of your training procedure! Say goodbye to those lonely, message-free lock screens with the TextMeKeras callbacks!Usage.Clone and Install.git clone https://github.com/djvaroli/text_me_keras.git && cd text_me_keras/ && pip install -e .Orpip install git+https://github.com/djvaroli/text_me_keras.gitExport Twilio CredentialsNote: If you don't have Twilio credentials, you can create a free account athttps://www.twilio.com/. Then create a new project and get a free phone number as well as the necessary credentials.Pythonimportosos.environ["TWILIO_ACCOUNT_SID"]=<your_account_sid>os.environ["TWILIO_AUTH_TOKEN"]=<your_auth_token>Shellexport TWILIO_ACCOUNT_SID=<your_account_sid>
export TWILIO_AUTH_TOKEN=<your_auth_token>Try it Outimportosimportnumpyasnpfromtensorflow.keras.layersimportInput,Dense,Conv2D,Flatten,LeakyReLUfromtensorflow.keras.modelsimportModelfromtensorflow.keras.datasetsimportmnistfromtensorflow.keras.lossesimportSparseCategoricalCrossentropyfromtensorflow.keras.metricsimportSparseCategoricalAccuracyfromtext_me_keras.callbacksimportTextMeCallback# if you haven't set the credentials before hand you'll get a warning# set the credentialsos.environ["TWILIO_ACCOUNT_SID"]=<your_account_sid>os.environ["TWILIO_AUTH_TOKEN"]=<your_auth_token># download MNIST dataset(trainX,trainy),(testX,testy)=mnist.load_data()print(trainX.shape,trainy.shape)# (60000, 28, 28) (60000,)# reshape to have channel dimensionstrainX=np.expand_dims(trainX,axis=-1)testX=np.expand_dims(testX,axis=-1)print(trainX.shape,testX.shape)# (60000, 28, 28, 1) (60000, 28, 28, 1)# build a model for MNISTi=Input((28,28,1))x=Conv2D(32,(5,5),2,padding="same",use_bias=False)(i)x=LeakyReLU()(x)x=Conv2D(64,(5,5),2,padding="same",use_bias=False)(x)x=LeakyReLU()(x)x=Flatten()(x)x=Dense(10)(x)model=Model(i,x)# model.summary()  # print the summary if you'd like to see it# set upt the loss, metrics and compileloss=SparseCategoricalCrossentropy(from_logits=True)metrics=[SparseCategoricalAccuracy()]model.compile("adam",loss,metrics=metrics)# set up the callbackto=<numbertosendupdatesto>from_=<numberassociatedwithyourTwilioaccount># if you haven't set the creds by this point, an exception will be raisedcbck=TextMeCallback(send_to=to,send_from=from_,# must be a number attached to your Twilio accountfrequency=1,# num epochs between textsrun_id="Test Run")model.fit(trainX,trainy,epochs=2,validation_data=[testX,testy],batch_size=256,callbacks=callbacks)# trained with a Colab GPUEpoch1/2235/235[==============================]-2s7ms/step-loss:0.6579-sparse_categorical_accuracy:0.9049-val_loss:0.1528-val_sparse_categorical_accuracy:0.9538Epoch2/2235/235[==============================]-2s6ms/step-loss:0.1318-sparse_categorical_accuracy:0.9639-val_loss:0.1321-val_sparse_categorical_accuracy:0.9625
Package: textmentations
TextmentationsTextmentations is a Python library for augmenting Korean text.
Inspired byalbumentations.
Textmentations uses the albumentations as a dependency.Installationpip install textmentationsA simple exampleTextmentations provides text augmentation techniques implemented using theTextTransform,
which inherits from the albumentationsBasicTransform.This allows textmentations to reuse the existing functionalities of albumentations.importtextmentationsasTfromalbumentationsimportComposetext="어제 식당에 갔다. 목이 너무 말랐다. 먼저 물 한잔을 마셨다. 그리고 탕수육을 맛있게 먹었다."rd=T.RandomDeletion(deletion_prob=0.3,min_words_each_sentence=1)ri=T.RandomInsertion(insertion_prob=0.3,n_times=1)rs=T.RandomSwap(n_times=3)sr=T.SynonymReplacement(replacement_prob=0.3)eda=Compose([rd,ri,rs,sr])print(rd(text=text)["text"])# 식당에 갔다. 목이 너무 말랐다. 먼저 물. 그리고 탕수육을 맛있게.print(ri(text=text)["text"])# 어제 최근 식당에 갔다. 목이 너무 말랐다. 먼저 물 한잔을 마셨다 음료수. 그리고 탕수육을 맛있게 먹었다.print(rs(text=text)["text"])# 어제 갔다 식당에. 목이 너무 말랐다. 물 먼저 한잔을 마셨다. 그리고 먹었다 맛있게 탕수육을.print(sr(text=text)["text"])# 과거 식당에 갔다. 목이 너무 말랐다. 먼저 소주 한잔을 마셨다. 그리고 탕수육을 맛있게 먹었다.print(eda(text=text)["text"])# 식당에 어제 과거. 너무 말랐다. 상수 한잔을 마셨다 맹물. 먹었다 그리고 맛있게.List of augmentationsAEDABackTranslationRandomDeletionRandomDeletionSentenceRandomInsertionRandomSwapRandomSwapSentenceSynonymReplacementReferencesalbumentationsAEDA: An Easier Data Augmentation Technique for Text ClassificationEDA: Easy Data Augmentation Techniques for Boosting Performance on
Text Classification TasksKorean StopwordsKorean WordNet
Package: textmetrics
textmetricsAutomatic text metrics---BLEU, ROUGE, and METEOR, plus extras like vocab and
ngrams.Usage# Compares each candidate (c) separately against all references (r).python-mtextmetrics.mainc1.txtc2.txt--referencesr1.txtr2.txtr3.txtInstallationRequires:Perl (for BLEU)Java 1.8 (for METEOR)Python 3.6+pipinstalltextmetricsFeaturesBLEUROUGEMETEORNotesBLEU and METEOR use the refernce implementations (in Perl and Java,
respectively). We originally used the reference Perl implementation for ROUGE
as well, but it ran so slowly that we opted for a Python reimplementation
instead. (ROUGE's original Perl implementation is also more difficult to setup,
even with wrapper libraries.)WorklistpypiAPI supportROUGE crashes things if it decides there aren't sentences (e.g., run with
README.md as input and reference)Add back in orig ROUGE for completeness (place behind switch)ngrams has divide by zero error. With two simple files (two lines each,
same first line, differing second line) running with2.txt --references 1.txt 1.txttriggered this divide by zeroDemo for better READMETestsEarly check in each module for whether program runnable + nice error
message (e.g., no java or bad version, no perl or bad version, etc.)Note to self: I followed this guide forpackaging to
pypi, and future
uploads will probably look like:# (1) ensure tests pass# (2) bump version in setup.py# (3) commit + push to github# (4) generate distributionpythonsetup.pysdistbdist_wheel# (5) Uploadtwineuploaddist/*