Saravanan666/pypi-org huggingface dataset:
Package: print-position
Print PositionA cool python package to add the timestamp, file name and line number in the print statements. This small tool can be very helpful in debugging big Python projects.Hereis the project on pypi.The current download stas are:MotivationTo debug the Python code present in multiple files, it becomes difficult to track down the print statement calls in the different files. This small pip package can be highly useful in such cases, one can simply use the custom print statement defined in this package and see the filename and line number of the print calls.How to install?Just install the package using the command:pip3 install print-positionUsageSimply add this import statement on top of your python file to see the time, file name and line number of each print statement.from print_position import print_pos as printA simple example is (test_pos.py):from print_position import print_pos as print
print("Test on line 2 from test.py")
print("Test on line 3 from test.py")

print("Test on line 7 from test.py")The output is shown as:@file_name:line_number
print_dataIf you want to also see the timestamp, just use the print_pos_time function like this:from print_position import print_pos_time as printA simple example is (test_pos_time.py):from print_position import print_pos_time as print
print("Test on line 2 from test.py")
print("Test on line 3 from test.py")

print("Test on line 7 from test.py")The output is shown as:time:@file_name:line_number
print_dataI believe this would be very helpful in tracking down errors during debugging,especially when you are working with someone else's code.Changelog2.0.1:Added another function to print the time of the print call.Restructured the project to improve imports.Contact meTo raise anyissues/requestsyou may refer the issue pagehere.You maymail mehere on mymail id.Feel free toconnect with meonmy LinkedIn.Please do check out my other projects on myGitHubhere.Also I have made many cool Firefox Add ons. They are pretty useful, you may want to check them outhere.If you like my work, you may want tobuy me a book here.
Package: print-pretty-tree
Print Pretty Treea.k.a.ptreeis a simple Python script that displays the directory tree of the current working directory with color-coded output for easy file identification.InstallationTo installprint-pretty-tree, you can use eitherpipor other package managers likenpm,pnpm, oryarn.Install using pipIf you have Python andpipinstalled:pipinstallprint-pretty-tree--userInstall using other package managersIf you havenpm5.2 or higher, we recommend usingnpxto run packages globally. This way, you don't need to install the package globally and can still use it as a tool.npxprint-pretty-treeIf you still want to installprint-pretty-treeglobally, on the command line, run the following command:npminstall-gprint-pretty-treeIf you get an EACCES permissions error, you may need to reinstallnpmwith a version manager or manually changenpm's default directory. For more information, see thenpm docs here.UsageOnce you have installedprint-pretty-tree, you can run the script in any directory.You can run any of the commands below in any directory, regardless of how you installed it.pt

ptree

print-pretty-treeThe script excludes certain files and folders like node_modules and .git by default to make the output easier to manage. It will recursively display the directory structure in a visually pleasing way.CustomizationTo add more file types and colors to the output, you can modify theFILE_TYPE_COLORSdictionary in the script.You can also customize the excluded file patterns by modifying theEXCLUDED_PATTERNSlist in the script.ContributingIf you find any bugs or want to suggest new features, please feel free to contribute by submitting anissueor apull request.Contributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!LicenseLicensed under the MIT license. See theLICENSEfile for more information.If you found this project interesting or helpful, please considersponsoring meorfollowing me on twitter
Package: print.py
print.pyA sophisticated wrapper around printWhy use print.py?print.py is elegant and simple to use, not to mention it's elegant and beautiful code.FeaturesprintargskwargsHow to install??You must have node.js and npm to install print.py.$node>>>const{exec}=require('child_process');>>>exec('pipinstallprint.py');Examplesfromprintimportprintprint('Hello')#Printsout"Hello"😱
Package: print-python
🖨️ print-pythonPython client forprint(simplest logging API)IntroductionLearn more aboutprintatgithub.com/gduverger/print.Installation$pipenvinstallprint-pythonDependenciesrequests (2.23.0)Usage>>>fromprintimportprint>>>print(url='<PRINT_URL>',token='<PRINT_TOKEN>')>>>print('As easy as rolling off a log')Testpython-mpytest
Package: printree
printreeTree-like formatting for arbitrary python data structures.InstalationpipinstallprintreeUsageprintreeaims to be similar to pretty print (pprint) with a format inspired by thetree command:>>>fromprintreeimportptree,ftree>>>ptree({"x",len,42})# will print to the output console┐├──0:x├──1:<built-infunctionlen>└──2:42>>>ftree({"x",len,42})# will return a string representation'┐\n├── 0: x\n├── 1: <built-in function len>\n└── 2: 42'Instances ofabc.Iterable(with the exception ofstr&bytes) will be represented as branches.
All other objects will be considered leaf nodes:>>>fromprintreeimportptree>>>dct={..."foo":[],...True:{..."uno":{"ABC","XYZ"},..."dos":r"B:\newline\tab\like.ext",..."tres":{..."leaf":b"bytes",..."numbers":(42,-17,0.01)...},...},...("tuple","as","key"):...{"multi\nlined\n\ttabbed key":"multi\nline\n\ttabbed value"}...}>>>dct["recursion"]=[1,dct,2]>>>ptree(dct)┐├──foo├──True│├──uno││├──0:XYZ││└──1:ABC│├──dos:B:\newline\tab\like.ext│└──tres│├──leaf:b'bytes'│└──numbers│├──0:42│├──1:-17│└──2:0.01├──('tuple','as','key')│└──multi│lined│tabbedkey:multi│line│tabbedvalue└──recursion├──0:1├──1:<Recursionondictwithid=2414949505984>└──2:2Theannotatedanddeptharguments modify verbosity of the output when creating the tree representation:>>>ptree(dct,depth=2,annotated=True)┐→dict[items=4]├──foo→list[empty]├──True→dict[items=3]│├──uno→set[items=2][...]│├──dos:B:\newline\tab\like.ext│└──tres→dict[items=2][...]├──('tuple','as','key')→dict[items=1]│└──multi│lined│tabbedkey:multi│line│tabbedvalue└──recursion→list[items=3]├──0:1├──1:<Recursionondictwithid=2414949505984>└──2:2Customizing formattingTreePrintersubclasses can change each of the string representations of the tree. The subclassAsciiPrinteris provided as an example:>>>fromprintreeimportAsciiPrinter>>>obj=[42,{"foo":(True,False)}]>>>AsciiPrinter(annotated=True).ptree(obj).->list[items=2]|--0:42`--1->dict[items=1]`--foo->tuple[items=2]|--0:True`--1:FalseThe main members to override are:ROOTEDGEBRANCH_NEXTBRANCH_LASTARROWThelevelattribute will be automatically set on the printer instance to indicate the current depth in the traversal of the tree.To print each branch level with a different color, something like the following could be implemented:fromprintreeimportTreePrinterclassColoredTree(TreePrinter):colors={0:'\033[31m',# red1:'\033[32m',# green2:'\033[33m',# yellow3:'\033[36m',# cyan4:'\033[35m',# magenta}_RESET='\033[0m'def__getattribute__(self,item):ifitemin("EDGE","BRANCH_NEXT","BRANCH_LAST"):returnf"{self.color}{getattr(super(),item)}{self._RESET}"returnsuper().__getattribute__(item)@propertydefcolor(self):returnself.colors[self.level%len(self.colors)]@propertydefROOT(self):# for root (level 0), prefer the color of the children (level 1)returnf'{self.colors[1]}{super().ROOT}{self._RESET}'multiline={"foo":{False:{"AB\nCD":"xy",42:len},True:[]},("bar",):[]}dct={"A":multiline,"B":(multiline,),"C\nD":"x\ny","F":(1,"2")}importosos.system("")# required on windows onlyColoredTree().ptree(dct)Which outputs:
Package: print-schema
print_schemaEver had a complex Python object and wanted to easily see its structure?print_schemamakes it super easy todisplay the structureof complex dictionaries, JSONs, lists, etc
It differs from pprint in that this displays the structure rather than the object itself.New:Useprint_matrixto display a 2D array (list of lists) in the matrix form.InstallingYou can download this package from pip:pip install print-schemaHow to use this packagefrom print_schema import print_schema
my_dict = {"bts": {"members": 7,
                   "bias": "Kim Tae-hyung",
                   "albums": {"first": "Dark & Wild",
                              "peak_chart_position": {"Japan": 30, "Korea": 2},
                              "favorite_songs": ["Blood Sweat and Tears", "Boy with luv"]},
                   "more_members_alive_than_dead": True,
                   (2, 3): "a random tuple"},
           "beatles": {"members": 4,
                       "bias": "George Harrisom",
                       "albums": {"first": "Please Please Me",
                                  "peak_chart_position": {"UK": 1, "France": 5, "Germany": 5},
                                  "favorite_songs": ["Eleanor Rigby", "While My Guitar Gently Weeps"]},
                       "more_members_alive_than_dead": False,
                       (4, 5): "another random tuple"}}
print_schema(my_dict, indent=3, dense=False)Display a list of lists as a matrixNew in version 1.1from print_schema import print_matrix
my_arr = [[11, 312, None, 2],
          [93, -45, 10],
          [-100.3, 8, 192, 5],
          [55, 1.5, 854, 6]]
print_matrix(my_arr, index=True)AuthorSurya Shekhar ChakrabortyLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsAcknowledgmentsThis project started when I started looking for a native Python equivalent of PySpark/Scala's printSchema() and couldn't find any :)Much thanks to my favorite after-hours colleague Puneet Jindal for all the help.
Package: printsid
dokr - Make your docker and ecs tasks easyA Helper pip package for docker and ECS tasks. This pip package helps you automate your CI/CD pipeline. If your using docker and Amazon ECS for deployments, this tool can be really helpful. This package uses aws cli and ecs cli. MakAssumptions:Assuming python is installed on your system.Docker is installed on your systemaws-cliis installed and credentials are configured on your system.ecs-cliis installed on system [For Log Command only]Installdokron your system using :pip install dokrECS Optionslogin into ecs directly (Assuming awscli is installed and configured)dokr ecs loginDeploy an image on a clusterdokr ecs deploy --cluster cluster_name --service service_name --tag image_versionCheck ecs running logs of a Task -  this command will ask for cluster/service and task defination.Note:Install ecs-cli before running this command  from here:https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.htmldokr ecs logDocker Helper CommandsPrune whole system -  Cleans unused images, containers and volumes.dokr dock --clean-allDelete all the images matching the patterndokr dock --clean pattern_xxxAdd a tag to the existing image matching the provided pattern  (for latest tag only)dokr dock --tag pattern_xxx tag_namePush all images on a system matching a patternThis will push all images matching pattern 'pat'dokr dock --push patAWS CommandsCheck current public ip of a machine on AWSdokr aws --ip jenkinsRun Apps (subsitute todocker runcommand and DockerCompose)Configure your default values(like docker registry, port mapping, volume mapping etc. that will be same for all apps):Add an new app for deployment:Run all configured apps:Run a particular  app from ECR tags:Run a particular  app by providing a tag:Development:Clean ununsed:rm -rf build/ dist/ *egg* **.pyc __pycache__Build package:python setup.py bdist_wheeldeploy package:python -m twine upload dist/*follow this link for more detailshttps://dzone.com/articles/executable-package-pip-install
Package: print-sid
dokr - Make your docker and ecs tasks easyA Helper pip package for docker and ECS tasks. This pip package helps you automate your CI/CD pipeline. If your using docker and Amazon ECS for deployments, this tool can be really helpful. This package uses aws cli and ecs cli. MakAssumptions:Assuming python is installed on your system.Docker is installed on your systemaws-cliis installed and credentials are configured on your system.ecs-cliis installed on system [For Log Command only]Installdokron your system using :pip install dokrECS Optionslogin into ecs directly (Assuming awscli is installed and configured)dokr ecs loginDeploy an image on a clusterdokr ecs deploy --cluster cluster_name --service service_name --tag image_versionCheck ecs running logs of a Task -  this command will ask for cluster/service and task defination.Note:Install ecs-cli before running this command  from here:https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.htmldokr ecs logDocker Helper CommandsPrune whole system -  Cleans unused images, containers and volumes.dokr dock --clean-allDelete all the images matching the patterndokr dock --clean pattern_xxxAdd a tag to the existing image matching the provided pattern  (for latest tag only)dokr dock --tag pattern_xxx tag_namePush all images on a system matching a patternThis will push all images matching pattern 'pat'dokr dock --push patAWS CommandsCheck current public ip of a machine on AWSdokr aws --ip jenkinsRun Apps (subsitute todocker runcommand and DockerCompose)Configure your default values(like docker registry, port mapping, volume mapping etc. that will be same for all apps):Add an new app for deployment:Run all configured apps:Run a particular  app from ECR tags:Run a particular  app by providing a tag:Development:Clean ununsed:rm -rf build/ dist/ *egg* **.pyc __pycache__Build package:python setup.py bdist_wheeldeploy package:python -m twine upload dist/*follow this link for more detailshttps://dzone.com/articles/executable-package-pip-install
Package: print-sql-tool
SqlPrinterНужен для принтовsql-кода, которые генерирует джанго.ИспользованиеИспользование в качестведекоратора:@PrintSqlTool()defsome_func():...models.SomeModel.objects.first()...models=models.SomeModel.objects.all()models_data=get_models_data(models)...returnsmthВ этом случае мы увидим все запросы, которые проходили в функцииИспользование в качествеконтекстного менеджераdefsome_func():...models.SomeModel.objects.first()...withPrintSqlTool():models=models.SomeModel.objects.all()models_data=get_models_data(models)...returnsmthВ этом случае мы увидим все запросы, которые были выполнены внутри блока контекстного менеджера.Если в проекте используется несколько бд:Мы сможем увидеть запросы только к одной из бд, по умолчанию это бд, у которойalias=defaultЕсли нужно указать другую бд, для которой нужно принтить запросы, то есть аргументdb_alias:@PrintSqlTool(db_alias='some_db_alias')defsome_func():...models.SomeModel.objects.first()...models=models.SomeModel.objects.all()models_data=get_models_data(models)...returnsmth
Package: printStatus
printStatusA simple collection of functions to print a progress bar in the console. In addition, it facilitates to print the status
of a currently running job or the exit status of a finished job.The module is for instance used by the GIST pipeline (https://abittner.gitlab.io/thegistpipeline/) and the generated
messages look like this:InstallationYou can install this package with pip:pip install printStatusUsageA simple example of the usage of this module is provided indemo.py. The following functions are available:printStatus.module(message): Print the name of the currently active module.printStatus.running(message):  Print a new message to stdout with the tag "Running".printStatus.done(message): Print a new message to stdout with the tag "Done".printStatus.updateDone(message, progressbar=False): Overwrite the previous message in stdout with the tag "Done" and a new message. Set progressbar=True if the previous message was the progress bar.printStatus.warning(message): Print a new message to stdout with the tag "Warning".printStatus.updateWarning(message, progressbar=False): Overwrite the previous message in stdout with the tag "Warning" and a new message. Set progressbar=True if the previous message was the progress bar.printStatus.failed(message): Print a new message to stdout with the tag "Failed".printStatus.updateFailed(message): Overwrite the previous message in stdout with the tag "Failed" and a new message. Set progressbar=True if the previous message was the progress bar.CompatibilityTested with Python3. Note that the appearance of the colours in the terminal depends on the specific setup of your terminal.
Package: printstream
printstreamA Python library that enhances the built-in print function for better debugging.Table of ContentsFeaturesInstallationUsageConfigurationExamplesOverhead MeasurementContributionLicenseContactFeaturesPrepend function name to print output.Colorize function name based on hash for better visual distinction.Align print output for improved readability.Toggle enhanced print functionality on and off as needed.Highly configurable via simple API.Lightweight with minimal setup.InstallationInstallprintstreamvia pip:pipinstallprintstreamUsageImport and activate the library at the top of your script:fromprintstreamimportactivate,deactivateactivate()# Your code here...deactivate()ConfigurationConfigureprintstreamto suit your needs:fromprintstreamimport(set_format,set_level,set_output,set_align,set_repeat_func_name,set_colorize,activate,deactivate)# Configure the debuggerset_format("[{func_name}]{message}")set_align(False)set_repeat_func_name(True)set_colorize(True)set_level(1)activate()# Your code here...deactivate()Additional Configuration DetailsHere are some additional details about the configuration options:align: Ifrepeat_func_nameis set toFalseandalignis set toTrue, the output of a single print statement with newlines will be indented such that the output is fully aligned.alignandrepeat_func_nameset toFalse:[test] Hello World
How are you?repeat_func_name: If a print statement has newlines, and this option is set toTrue, it will still print the function name before each line (even within the same print statement).[test] Hello World
[test] How are you?colorize: This option colorizes the function name based on its hash. This introduces some significant overhead (~200%). If anyone has any suggestions on improvements, please submit a PR.levels: This option controls the output level.-1: No output0: Normal print1: Debug activatedExamplesExample withprintstreamactivated:fromprintstreamimportactivate,deactivateactivate()deftest():print("Hello World\nHow are you?")test()deactivate()Output:[test] Hello World
[test] How are you?Overhead MeasurementMeasure the overhead ofprintstream:importtimeit# ... setup code ...# Measure time with standard printtime_without_debug=timeit.timeit("test()",setup=setup_code,number=10)# Measure time with printstream activatedtime_with_debug=timeit.timeit("activate(); test(); deactivate()",setup=setup_code,number=10)# Calculate overhead percentageoverhead_percentage=((time_with_debug-time_without_debug)/time_without_debug)*100ContributionContributions toprintstreamare welcome! Please submit a pull request or create an issue on theGitHub repository.Licenseprintstreamis licensed under the MIT License. See theLICENSEfile for details.ContactAuthor: ArnavEmail:arnavaggarwalwork@gmail.com
Package: printstructure
print-structureA Python library that can used to print out complex data structure such as linked list, tree and DP table, ect.Overviewprint-structureis a library for printing out complex data structures such as tree and dp table. There are various complex data structures that are commond in leetcode or codeforce. When we try to debug and inspect these data structures using debugger in IDEs, contents in those structures can't be intuitively displayed. This python library can beautifully print out those structures and help users to inspect their contents.
Package: print-tools
Print ToolsIncludes useful methods for stylized/formatted printing.Installpython3 -m pip install print-toolsUsagefromprint_tools.printerimportPrinterp=Printer()p.log('Printer initialized!')Methods__init__styleDefault monokai, can use solarized as wellMonokai Colors'orange', 'magenta', 'purple', 'blue', 'seagreen', 'green', 'yellow'Solorized Colors'yellow', 'orange', 'red', 'magenta', 'violet', 'blue', 'cyan', 'green'logLogs text with bold date/time string in front of textArgstexterrorPrints redERROR:in front of text, log string optionalArgstextlog (True)successPrints greenSUCCESS:in front of text, log string optionalArgstextlog (True)arrowPrints "-->" in front of text, indentation optionalArgstextindent (0)chevronPrints ">>>" in front of text, indentation optionalArgstextindent (0)bulletPrints "•" in front of text, indentation optionalArgstextindent (0)formatCustom template formatting of stringsTemplate formatting entered as so in string: i.e.[bold:green]format_op arg can be changed to different outside operator, must be two char string, i.e. "||" would yield|bold:green|Modifiers must be entered firstbold, italic, underlined, resetForeground color must be entered next i.e.[green]Background color must be entered withon_prefix i.e.[on_blue]Formatting can be removed withresetmodifier, this can be mixed with new formatting i.e.[reset:bold:green]To remove specific formatting, enter no_ before argument, (one argument per block) i.e.[no_bold][no_italic]To remove foreground color`[no_foreground]To remove background color`[no_background]By default the string formatting is cleared after the print statement, this can be changed by setting argresetto FalseAdditionally, the log string can be printed first by setting arglogto True
Package: print-torch
print_torchIt is often overwhelming toprint(tensor)which may flash your screen and you just don't get any information useful.Instead, usept(tensor)and it will give you the size, dtype, device, min, max, std, mean, whether has nan, etc. in one line.>>>importtorch>>>fromprint_torchimportpt>>>tensor=torch.randn((2,3,4,5))>>>pt(tensor)tensor(shape=(2,3,4,5),dtype=float32,min=-2.803,max=2.49,std=1.019,mean=-0.06855,data=[-0.8246,-1.135,0.1368,1.56,...],device="cpu")>>>It also works for list of numbers and numpy tensors.If you have a nested dict/list of pytorch/numpy tensors, you can alsoptit, and it will list each element which may be again a tensor in one line.For example, you can justpt(locals())in yourforward()function in the breakpoint to know all the stats of your local variables.Don't hesitate to add this tool to your arsenal!pipinstallprint_torch
Package: print-vis
print visualization(PYPI)[https://pypi.org/project/print-vis/1.0.0/]==================A lightweight python module to visualize progress and other tasks to boost your console window==================features:clear consoleclear only the last line in consoleasynchronous loading bar[â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆ-------------]asynchronous loading wheel
Package: printwatch
PrintwatchTired of running long tasks? TryPRINTwatch!Alpha version is now live on pip!Head tohttps://pypi.org/project/printwatch/to install!UsageImport the Redirector class using:from printwatch.redirection import RedirectorCreate a new method ofRedirectorand initialize it using:redirector=Redirector(identifier="Randomfd") redirector.initialize()To redirect the output of a cell:with redirector:
    print("Redirected output")Redirected outputs will be placed inlogs/folder. You can also use the webserver athttp://127.0.0.1:5001to monitor the logs locally (will add support for hosted webservers soon).