Saravanan666/pypi-org huggingface dataset:
Package: prettierprint
prettierprintPython module for clean, human-readable printing of data structures.QuickstartInstallpip install prettierprintUsageBasic:fromprettierprintimportprintsome_data={'key':'value','list':[{'name':'Hello','attr_A':'foo','attr_B':'bar'},{'name':'World','attr_A':'bar','attr_B':'foo'}]}print(some_data)Result:key: value
list:
    - name: Hello
      attr_A: foo
      attr_B: bar
    - name: World
      attr_A: bar
      attr_B: foo
Package: prettier-printer
Prettier_Printer: A syntax highlighting prettier printer for Python 3.6+This library intends to print prettier for python code as simple and intuitive as possible.TutorialPretty print common Python values:>>>fromprettier_printerimportpprint>>>d={...'example_tuple':(1,2,3,4),...'word':'Python is an interpreted programming language.',...'example dict':{'set':set([1,2,3,4])}...}>>>pprint(d,depth=10,indent=2,width=12,sort_dict_keys=True){
  'example dict': {
    'set': {1, 2, 3, 4}
  },
  'example_tuple': (1, 2, 3, 4),
  'word': (
    'Python is an ',
    'interpreted ',
    'programming ',
    'language.'
  )
}Pretty print common Python values with syntax highlight:Installation$pipenvinstallprettier_printerOnlyPython 3.6is supported.
Package: prettier-prints
Prettier_printsLightweight library for prettier terminal outputs similar tochalkfor JavaScript.
Helping make Python outputs easier to read and styled to your desires.Installpipinstallprettier-printsExamples:
out()fromprettier_prints.prettier_printsimportPrettierPrintspp=PrettierPrints()pp.style='red;underline'# <-- Can optionally predefine styling and can be overwrittenprint(pp.out(msg="Lets test the output"))print(pp.out(msg="Lets override the styling here",style="blue;bold"))print(pp.out(json_out={'msg':'For those who prefer a JSON object param, this works too'}))print(pp.out(json_out={'msg':'Can also overwrite this way','style':'yellow;highlight'}))print(f'Works great for output messages as well ->{pp.out(msg="See :)",style="magenta")}')json()fromprettier_prints.prettier_printsimportPrettierPrintspp=PrettierPrints()json_obj={'test':'cool','test_two':'cool_two','dict_check':{'test':'hello'},'list_check':['test','test two',{'test':'hello','test_two':'bloop'},{'test':'hello','test_two':'bloop'}]}print(prettier_prints.json(json_obj=json_obj,style='list=blue;underline&dict=red;bold&string=green;'))Current functions:out()json()Function parameters:- out()
   - msg: str           Output / display message[required]
   - style: str         Styling to apply to the message[optional]
   - json_out: dict     JSON object containing the message and styling[optional]

 - json()
   - style: str         Styling to apply to the message[optional]
   - json_obj: dict     JSON object containing the message and styling[required]Styling Examples By Function:- out()
    - style: 'red;underline'
    - json_out: {'msg': 'Lets test the output', 'style': 'blue;bold'}
- json()
    - style: 'list=red;underline&dict=blue;bold&str=yellow;highlight' # <- Break up the styling by type (list, dict, str)Current available styling:ModifiersColors / Background ColorsBoldRedUnderlineGreenHighlightYellowBlueMagentaCyanWhiteBright RedBright GreenBright YellowBright BlueBright MagentaBright CyanBright WhiteContributors / Thanks:SheepDogg586
Package: prettiest-ast
prettiest_astA simple pretty printer for python abstract syntax trees:>>>fromprettiest_astimportppast>>>ppast('for i in range(5): print(i)')For├──Name│├──i│╰──Store├──Call│├──Name││├──range││╰──Load│╰──Constant│╰──5╰──Expr╰──Call├──Name│├──print│╰──Load╰──Name├──i╰──Load
Package: prettifyJsonLog
prettifyJsonLogA small python programm to make json log formats human readableIt reads log lines from stdin.
Each line must be one log entry formatted as a JSON object.UsagesomeCommandThatProducesLogs|prettifyJsonLogor2>&1someCommandThatProducesLogsOnStderr|prettifyJsonLogAuthorsTim Neumannneumantm@fius.informatik.uni-stuttgart.de
Package: prettify-py
prettify-pyWhyPretty Python files are necessary for productive Python development with high quality and safety standards.WhatIt is a simple command-line application formatting Python files written in Python. The package is yet highly experimental
but it was necessary to speed of maintenance and development speeds of software. It has not perfect stats on quality yet, but it is pretty good already.Usageprettify-pyformat-filesample.py
prettify-pyformat-dirsample_dir/InstallationProduction Buildpipinstallprettify-pyDev BuildClone the repository withgitclonehttps://codeberg.org/cap_jmk/prettify-pycdprettify-py/LinuxRun with one of the follwing:bashinstall.sh
./install.sh
shinstall.shWindowsDouble click oninstall.bator runinstall.bat
Package: prettify-xml
prettify-xmlWhyPretty xml output is necessary for debugging xml-based communications and other operations involving XMLWhatIt is a simple command-line application formatting XML files written in PythonUsagexml-formatter-isample.xml-oformatted_test.xmlInstallationProduction Buildpipinstallxml-formatterDev BuildLinuxRun with one of the follwing:bashinstall.sh
./install.sh
shinstall.shWindowsDouble click oninstall.bator runinstall.batUsagepython.\xml-format.py-i.\sample.xml-oformatted_test.xmlRegister a shell commandThe section is about registering shell commands using theClicklibrary. Maybe you are curious, about crafting your own OS? Go for it! I do it
and it is a lot of fun :)The best way to have a system wide executable command on both, Windows and Linux systems is to use setuputools.There is a description in the click package abouthow to do itIn a nutshell, the setup.py file has to follow a certain pattern, e.g.fromsetuptoolsimportsetup,find_packagessetup(name='prettify_xml',version='0.4.3',packages=find_packages(),include_package_data=True,install_requires=['Click',],entry_points={'console_scripts':['formatter = prettify_xml.formatter:format',],},)Then, you can run on Windows:python-mvenvvenvvenv/Scripts/activate
pipinstall--editable.And on Linux you can run:python-mvenvvenvsourcevenv/bin/activate
pipinstall--editable.Then, test the application with:xml-formatter-isample.xml-oformatted_test.xml
Package: prettimer
prettimerIs a package that gives a timer utility, with prettifiers that prompt a
prettified runtime to the standard output.The prettifiers are decorator functions built upon theElapsedobject, that
allow either to assess the runtime of a function without having to explicitly
call any magic, or to log a step of a process where thelogging.loggeris
pointing to.ExamplesCan use the the main time handler this way:>>> from prettimer import Elapsed

>>> et = Elapsed()
>>> # do some process in between
>>> et.stampFromStart() # this returns a string
'Elapsed Time: 1 [mins] 3.785 [secs]'Otherwise, can use decorator functions:>>> from prettimer import timeit

>>> @timeit
... def prova():
...     return np.random.randn(100000)
>>> prova()
prova: Elapsed Time: 0.002 [secs]Full documentation can be foundhereInstalling prettimerTo install prettimer package, just:pip install prettimerDeveloping prettimerTo install prettimer along with the tools you need to develop and run tests,
run the following in your virtual env:pip install -e .[dev]
Package: pretty-bad-protocol
This module allows easy access to GnuPG’s key management, encryption and signature functionality from Python programs, by interacting with GnuPG through file descriptors. Input arguments are strictly checked and sanitised, and therefore this module should be safe to use in networked applications requiring direct user input. It is intended for use on Windows, MacOS X, BSD, or Linux, with Python 2.6, Python 2.7, Python 3.3, Python 3.4, or PyPy.
Package: prettyc
prettyc - static code checker for CPrettyC is a command-line tool to check only C files for style issues.
It's forked from Cpplint which is developed and maintained by Google Inc. atgoogle/styleguide <https://github.com/google/styleguide>, also see thewikipedia entry <http://en.wikipedia.org/wiki/Cpplint>InstallationTo install prettyc from PyPI, run:pipinstallprettycThen run it with:prettyc[OPTIONS]filesFor full usage instructions, run:prettyc--helpHow to use:prettyc--helpDevelopmentCreate virtual environment.makevenvActivate.sourceactivate.shCreate development environmentmakedevDistribution and install:makedist
makeinstall
Package: prettycm
Pretty Confusion Matrix🤔 Why pretty confusion matrix?We can make confusion matrix by using matplotlib.However it is not so pretty. I want to make confusion matrix prettier.Also, it is not easy to use. It is easy to draw confusion matrix.Design Contributors황동호(Dongho Hwang,hhdh12@naver.com)김다한(Dahan Kim,dahan0811@gmail.com)Code Contributors고준서(Junseo Ko,Korkite,sta06167@naver.com)📥 How to Install?pipinstallprettycm🗞 Full Code Examplefromprettycmimportconfusion_matrixfromprettycmimportpalette# Define confusion matrixcm=confusion_matrix([[400,0,0,0],[0,156,8,14],[0,18,131,30],[0,60,28,75]])cm.set_classname(["Acute","Non-resolving","Normal","Inactive"])cm.set_title("Retinal Specialist2")# Define Palette and drawpset=palette()pset.draw(cm,"place_to_save.png")📦 Result of generated confusion matrix📰 How to Use?1. import package from prettycmfromprettycmimportconfusion_matrixfromprettycmimportpalette2. build confusion matrix objectcm=confusion_matrix([[400,0,0,0],[0,156,8,14],[0,18,131,30],[0,60,28,75]])cm.set_classname(["Acute","Non-resolving","Normal","Inactive"])# You can set the class name.cm.set_title("Retinal Specialist2")# You can set the title.the input of the confusion_matrix must be two-dimensional arrayPython list or numpy array are both allowedYou can set the name of the class and title.3. define palette objectpset=palette(size=5,color="blue")size = the quality and size of output confusion matrix imagecolor = the color of confusion matrix. (Now only blue is supported)Both parameters are not needed. size 5, color blue is defaultly set.4. draw confusion matrix and savepset.draw(confusion_matrix=cm,path="place_to_save.png")confusion_matrix: put confusion matrix objectpath: path to saveDone5. Generate Confusion matrix object by confusion_matrix_by_calYou can also generate confusion matrix object by y_pred, y_true.6. Special Printer of Confusion Matrixprint(cm)When you print confusion_matrix object, than python will print the confusion matrix like below7. Custom Your own color presetsfromprettycmimportpalettefromprettycm.presetsimportpreset_metaclasscustom_green(preset_meta):def__init__(self,max_num):colors_rgb=[(204,244,202),(10,30,12)]super().__init__(max_num,colors_rgb)pset=palette(size=5,color=custom_green)You can customize your own color presetMake your own class and inherit prettycm.presets.preset_metaAnd You have to write custom object same as this.colors_rgb consists of two 'tuple', which is brightest color RGB and darkest color RGB.Other colors will automatically be calculated by preset_meta object.📆 Update Plans1. More color presetsBlue (👍 Best)RedGreenPurpleCustom Preset2. Confusion matrix concatConcat two confusion matrix3. Pallet FunctionText Size controlCleaning the code🙏🏻 PLEASE Contribute to this projectPull requests after you modify code.Make more color presets.
Package: pretty-confusion-matrix
Confusion Matrix in PythonPlot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlibCreated on Mon Jun 25 14:17:37 2018
@author: Wagner Cipriano - wagnerbhbrThis module get a pretty print confusion matrix from a NumPy matrix or from 2 NumPy arrays (y_testandpredictions).Installationpipinstallpretty-confusion-matrixGet StartedExamples:importnumpyasnpimportpandasaspdfrompretty_confusion_matriximportpp_matrixarray=np.array([[13,0,1,0,2,0],[0,50,2,0,10,0],[0,13,16,0,0,3],[0,0,0,13,1,0],[0,40,0,1,15,0],[0,0,0,0,0,20]])# get pandas dataframedf_cm=pd.DataFrame(array,index=range(1,7),columns=range(1,7))# colormap: see this and choose your more dearcmap='PuRd'pp_matrix(df_cm,cmap=cmap)importnumpyasnpfrompretty_confusion_matriximportpp_matrix_from_datay_test=np.array([1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5])predic=np.array([1,2,4,3,5,1,2,4,3,5,1,2,3,4,4,1,4,3,4,5,1,2,4,4,5,1,2,4,4,5,1,2,4,4,5,1,2,4,4,5,1,2,3,3,5,1,2,3,3,5,1,2,3,4,4,1,2,3,4,1,1,2,3,4,1,1,2,3,4,1,1,2,4,4,5,1,2,4,4,5,1,2,4,4,5,1,2,4,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5])pp_matrix_from_data(y_test,predic)References:Mat lab confusion matrixhttps://www.mathworks.com/help/nnet/ref/plotconfusion.htmlhttps://www.mathworks.com/help/examples/nnet/win64/PlotConfusionMatrixUsingCategoricalLabelsExample_02.pnghttps://stackoverflow.com/questions/5821125/how-to-plot-confusion-matrix-with-string-axis-rather-than-integer-in-python/51176855#51176855Other Examples in pythona)https://stackoverflow.com/a/51176855/1809554b)https://www.programcreek.com/python/example/96197/seaborn.heatmapc)http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html#sphx-glr-auto-examples-model-selection-plot-confusion-matrix-py
Package: prettycopy
prettycopyA beginner-friendly library for clean, format-friendly copy-pasting.OverviewCopying and pasting text is one of the most commonly-used functionalities we have on our computers. But sometimes, there are formatting issues in the text you're copying that a simple 'paste without formatting' can't fix.Enter PrettyCopy.PrettyCopy will help you clean up the text on your clipboardbeforeyou paste it. Just copy your text, run a PrettyCopy function, and you'll be able to paste it with corrections already in place!See our documentationhere.InstallationIf you already have Python, just run:pipinstallprettycopyUsageSo... how do you use PrettyCopy? It's very simple! You can use PrettyCopy functions at the command line, or through your own program.Learn more about the functions usingprettycopy --helpat the command line, or by checking ourdocumentation.Command LineCopy a piece of text.
In the command line, typeprettycopy [function_name] [any_args].
PrettyCopy will print the corrected text, just to show you what your clipboard current contains.
Now, as soon as you paste, the text will already be corrected.All command-line functions have the--text [YOUR_STRING]flag. PrettyCopy will take your inputted string, correct it, and place it in the clipboard.Remember to add quotation marks around your input string if it contains whitespace!This option can go anywhere as long as the input string is to the right of the --text flag.Confused? Typeprettycopy --helpto get a list of possible functions, andprettycopy [function_name] --helpto get help for any particular function.In a ProgramPrettyCopy will take in some text, correct it, and copy the corrected text to your clipboard. It will also return the corrected text as a return value, in case you want to keep using it (for example, in a nested function).
By default, PrettyCopy will run on the text in your clipboard. If you want to correct a different text, enter your preferred text as an argument.ExamplesPrettyCopy can be used for fixing issues with line breaks; removing extraneous bullet point symbols; adding quotation marks (and optional punctuation) around a copied text; and more!See thedocumentationfor the complete list of functions.
Package: pretty-cron
Retiredin favour ofcron_descriptorThis project is no longer maintained.Converts crontab expressions to human-readable descriptions.InstallationUse pip:pipinstallpretty-cronTested on Python 2.7 and 3.6.APIprettify_cron(cron_expression)Converts the given string cron expression into a pretty, human-readable,
English description of what it means. If the string is not a valid cron
expression, or it includes features not currently supported, it is returned
as-is.For example:>>>importpretty_cron>>>pretty_cron.prettify_cron("0 * * * *")"At 0 minutes past every hour of every day">>>pretty_cron.prettify_cron("0 0 1 1 *")"At 00:00 on the 1st of January">>>pretty_cron.prettify_cron("12 15 * 1 *")"At 15:12 every day in January">>>pretty_cron.prettify_cron("lalala")# Not a cron expression"lalala"History1.2.0 (2018-08-22)Retiredin favour ofcron_descriptor. This project is no longer maintained.1.1.0 (2018-08-19)Now always returnsunicodeon Python 2 for consistency.1.0.2 (2016-05-03)Now supports expressions with multiple weekdays and ordinal days - thanks
@jbondia.1.0.1 (2016-02-09)Now interprets day 7 as Sunday as well as 0, like Linux crontab parsers -
thanks @vetyy.Now supports expressions with multiple months separated by commas - thanks
@MerreM.1.0.0 (2015-07-28)First release on PyPI, featuringprettify_cronfunction.
Package: prettydiff
prettydiffprettydiff- diff parsed JSON objects and pretty-print it$ python3 -m pip install prettydiffCustom output format example (HTML)terminalfromprettydiffimportprint_diffa={"a":"hello","b":True,"c":[1,3],"d":{"e":{"f":1}}}b={"a":"world","b":False,"c":[1,2,3]}# to enable colors: $ python3 -m pip install prettydiff[terminal]print_diff(a,b){-   'a': 'hello',+   'a': 'world',-   'b': True,+   'b': False,'c': [1,-     3,+     2,+     3,],-   'd': {-     'e': {-       'f': 1,-     },-   },}
Package: pretty-doc
pretty-docfrom__future__importannotationsfromdataclassesimportdataclassimportpretty_docasdocimportjson@dataclassclassBlock:name:strcontents:list[Block]|str=""defto_doc(self):returnto_doc(self)defto_doc(self:Block)->doc.Doc:ifisinstance(self.contents,list):returndoc.vsep([doc.seg(self.name)+doc.seg("{"),doc.indent(4,doc.vsep(list(map(to_doc,self.contents)))),doc.seg("}")])returndoc.seg(self.name)+doc.seg(json.dumps(self.contents))doc=Block("A",[Block("C","ccc"),Block("B",[Block("C","ccc"),]),Block("C","ccc"),Block("C","ccc"),]).to_doc()print(doc.show())# out:A{C"ccc"B{C"ccc"}C"ccc"C"ccc"}importsysdoc.render(sys.stdout.write)# out:A{C"ccc"B{C"ccc"}C"ccc"C"ccc"}
Package: pretty-downloader
Pretty Downloader📝 CONTRIBUTIONSBefore doing any contribution readCONTRIBUTING.📧 CONTACTEmail:amng835@gmail.comGeneral Discord:https://discord.gg/dFD5HHaDeveloper Discord:https://discord.gg/rxNNHYN9EQ📥 INSTALLINGLatest PyPI stable releasepipinstallpretty-downloader⚙ HOW TO USEimportpretty_downloaderpretty_downloader.download(<YOURURL>)ORfrompretty_downloaderimportdownloaddownload(<YOURURL>)🤝 PARAMETERSurl : str, requiredThis should be the url of the file you wish to downloadfile_path : str, optionalThe path to save the file (Default: "")file_name : str, optionalThe file name you want the file to be saved with. Should include file extension (Default: None)show_progress : bool, optionalOption to disable/enable the default progress bar (Default: True)name : str, optionalThe name you want to appear in the progress bar (default: 'Download progress')block_size : int, optionalThe size of the download block (Default: 1024)proxies : dict, optionalDictionary of proxies to be used (Default: None)Example: {'http': 'http://135.125.218.47:8080'}headers : dict, optionalDictionary of headers (Default: None)Example: {'user-agent': 'Mozilla/5.0'}RETURNS: Path of file downloaded🖼️ SCRIPT SCREENSHOTS & VIDEOS
Package: pretty-eikon
Pretty EikonA package for data extraction and preprocessing of Eikon's company timeseries data and newsTable of contentsRequirementsTime seriesNewsRequirementspandaseikoneventletjsonbs4Time seriesCompany time series can be imported with the TimeSeries classimport dataproviders as dp
timeseries = dp.TimeSeries(eikon_app_key = eikon_app_key,
                         data = data,
                         outputdir = outputdir,
                         dateto = dateto,
                         datefrom = datefrom)wheredatais the list of company codes or rics to import the data for,
outputdir is the path to the outputdir where the data will be stored,
dateto and datefrom are either strings of the form YYYY-MM-DD or datetime() objectsYou can import all company data withtimeseries.time_import()NewsCompany news can be imported with the NewsProvider classimport dataproviders as dp
news = dp.NewsProvider(eikon_app_key  = eikon_app_key,
                          data = data,
                          outputdir = outputdir,
                          dateto = dateto,
                          datefrom = datefrom)wheredatais the list of company codes to import the data for,
outputdir is the path to the outputdir where the data will be stored,
dateto and datefrom are either strings of the form YYYY-MM-DD or datetime() objectsYou can import news for all companies in thedataby invokingnews.mine_news(do_clean)where do_clean = True if the preprocessed text body should be outputted instead of the raw html from eikon.Or, to import one day (date) of news for a single company (ric)news.do_day(date, ric, do_clean)You can use the preprocessing method to clean a raw html withnews.html_cleaner(self, pathtodir, destindir)where pathtodir is the directory containing the raw html textfile(s) and destindir is the output directory where cleaned files are written with the same filename as in the original directory.
Package: prettyexc
prettyexc provides common exception representation to make human-readable exception in easy way.You can install the package from PyPI$ pip install prettyexcExamplePrelude::>>> from prettyexc import PrettyExceptionPut and get your arguments always::>>> class SimpleException(PrettyException):
...     pass
...
>>> e = SimpleException('any', 'plain', 'args', code=200, description='OK')
>>> raise e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__main__.SimpleException: "any","plain","args",code=200,description="OK"
SimpleException("any","plain","args",code=200,description="OK")
>>> print [e, e]
[<SimpleException("any","plain","args",code=200,description="OK")>, <SimpleException("any","plain","args",code=200,description="OK")>]Set default message::>>> class MessageException(PrettyException):
...     message = u'You should select a user'
...
>>> e = MessageException(user_id=10)
>>> raise e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__main__.MessageException: You should select a user
>>> print [e, e]
[<MessageException(user_id=10)>, <MessageException(user_id=10)>]Set message formatter::>>> class FormatException(PrettyException):
...     message_format = u'User {user_id} has no permission.'
...
>>> e = FormatException(user_id=10)
>>> raise e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__main__.FormatException: User 10 has no permission.
>>> print e.message
User 10 has no permission.Patch existing exceptions::>>> from prettyexc import patch
>>> class AnException(Exception): pass
...
>>> patch(AnException, PrettyException)
>>> raise AnException(status=404)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__main__.AnException: status=404
Package: prettyfi
Prettify your files with one commandPrettyfi usageusage: prettyfi [-h] [-c CONFIG] [-r] files [files …]Simple utility to make your files prettier.positional arguments:files                 Files to sortoptional arguments:-h,--helpshow this help message and exit-cCONFIG,--configCONFIGpath to configuration file-r,--recursiverecursively traverse directoriesprettyfi"prettyfi/main.py""pyproject.toml"# Will make this files beautifulPrettyfi configurationDefault config file location is “~/.prettyfirc”.Config file format:.<ext>$pretty_command{file}# Where "ext" -> your file extension,
# {file} -> stub for actual file,
# For example:.py$isort{file}.java$rm{file}
Package: pretty-format-json
Pretty Format JSONPretty print json contains python style coments, string literal.pip3 install pretty-format-jsonYaml and CSV write works fine in Python3 but not in Python2Binariespretty_format_json: parse NodeJS style, Python style text to JSONcsv_json: Convert between CSV and JSONyaml_json: Convert between Yaml and JSONUse it in VIMAddnoremap <a-j> :%!pretty_format_json<CR>(or your key binding) to your config file.noremap <a-j> :%!pretty_format_json<CR>
noremap <a-k> :%!yaml_json<CR>
noremap <a-c> :%!csv_json<CR>When you open a blank buffer, paste the text copied from somewhere into,
then useAlt+jto convert to JSON,
useAlt-kto convert to Yaml and back to JSON.