{"id":20863382,"url":"https://github.com/stupidcucumber/robustprinter","last_synced_at":"2025-03-12T14:43:33.474Z","repository":{"id":226088803,"uuid":"767711146","full_name":"stupidcucumber/RobustPrinter","owner":"stupidcucumber","description":"Printing package for easy handling data printing 🧑‍💻","archived":false,"fork":false,"pushed_at":"2024-03-06T07:59:55.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T12:53:43.042Z","etag":null,"topics":["deep-learning","logging","printing","python3","training"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stupidcucumber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-05T19:04:11.000Z","updated_at":"2024-11-13T11:21:36.000Z","dependencies_parsed_at":"2024-11-18T05:30:27.306Z","dependency_job_id":"e71a6560-0ae2-444c-9b2e-5ead8d44e4fe","html_url":"https://github.com/stupidcucumber/RobustPrinter","commit_stats":null,"previous_names":["stupidcucumber/robust-printer","stupidcucumber/robustprinter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stupidcucumber%2FRobustPrinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stupidcucumber%2FRobustPrinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stupidcucumber%2FRobustPrinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stupidcucumber%2FRobustPrinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stupidcucumber","download_url":"https://codeload.github.com/stupidcucumber/RobustPrinter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243236540,"owners_count":20258855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","logging","printing","python3","training"],"created_at":"2024-11-18T05:28:46.939Z","updated_at":"2025-03-12T14:43:33.448Z","avatar_url":"https://github.com/stupidcucumber.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Prerequisites\nTo run this package `python3.10` is reccomended. On early stages of developing this project this might not be important, but all further dependencies can require 3.10 version only.\n\n## How to install?\nInstalling this is simple, just write to the terminal:\n```\npip install robustprinter\n```\n\n# About\n\n## History\nThis package was born in desparate search for the tool to conveniently print training information to the console. Altough Tensorflow has its own pre-built printer, which is quite nice, pytorch doesn't have such luxuary. Most of my applications depend on torch and I was tired of tedious print statements around my code that was hard to make beautiful.\n\nMain idea is to incapsulate functionality that I may use across different other applications in one package.\n\n## Usage\nMain classes are `Printer` and `Formatter`. Printer regulates what, when and where something must be printed and Formatter regulates how it must be printed. For now package has only `DefaultFormatter` class – child of `Formatter`, and all it does is prints beautifully training info.\n\nTo see package in work try this code:\n```py\nimport time\nimport numpy as np\nfrom robustprinter import Printer, formatter\nfrom robustprinter.formatter import DefaultFormatter\n\nclass TestFormatter(formatter.Formatter):\n    def __init__(self) -\u003e None:\n        super(TestFormatter, self).__init__()\n    \n    def format(self, data) -\u003e str:\n        return data\n    \nmetrics_list = [\n    'precision', 'recall', 'mAP50', 'mAP50-95', 'accuracy',\n    'FID', 'loss'\n]\n\ndef generate_random_metrics(metrics: list) -\u003e dict:\n    result = dict()\n    for metric in metrics:\n        result[metric] = np.random.rand()\n    return result\n\nif __name__ == '__main__':\n    print('Start test.')\n    max_steps = 10\n\n    rformatter = DefaultFormatter(max_columns=2)\n    rprinter = Printer(formatter=rformatter)\n    rprinter.start()\n\n    data = dict()\n    for epoch in range(3):\n        data['epoch'] = epoch\n        for step in range(max_steps):\n            data['step'] = step + 1\n            data['max_steps'] = 10\n            data['partition'] = 'train'\n            data['metrics'] = generate_random_metrics(metrics=metrics_list)\n\n            rprinter.print(data=data)\n            time.sleep(1)\n        rprinter.break_loop()\n```\n\n# Examples\n\n## DefaultFormatter\n![DefaultFormatter](./misc/Example:%20DefaultFormatter.png)\n\n# Contribution\nThis repository is about designing new formatters and printers. If you have an idea and want to share it – you are welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstupidcucumber%2Frobustprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstupidcucumber%2Frobustprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstupidcucumber%2Frobustprinter/lists"}