{"id":27370723,"url":"https://github.com/mpcodewriter21/log21","last_synced_at":"2026-04-10T22:10:37.840Z","repository":{"id":62576633,"uuid":"403329493","full_name":"MPCodeWriter21/log21","owner":"MPCodeWriter21","description":"A simple logging package that helps you log colorized messages in the Windows console.","archived":false,"fork":false,"pushed_at":"2024-12-07T14:43:38.000Z","size":1193,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T09:19:03.057Z","etag":null,"topics":["codewriter21","color","colorizing","log","log21","logging","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MPCodeWriter21.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-09-05T14:27:34.000Z","updated_at":"2024-12-07T14:43:19.000Z","dependencies_parsed_at":"2023-12-08T10:27:15.996Z","dependency_job_id":"49fc7bbe-b893-48e2-85c2-9e1e46ad38e7","html_url":"https://github.com/MPCodeWriter21/log21","commit_stats":{"total_commits":70,"total_committers":4,"mean_commits":17.5,"dds":"0.37142857142857144","last_synced_commit":"5235b0fe25b4f888169ef97d7a6652a3f006ea6c"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MPCodeWriter21%2Flog21","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MPCodeWriter21%2Flog21/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MPCodeWriter21%2Flog21/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MPCodeWriter21%2Flog21/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MPCodeWriter21","download_url":"https://codeload.github.com/MPCodeWriter21/log21/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688717,"owners_count":21145794,"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":["codewriter21","color","colorizing","log","log21","logging","python","python3"],"created_at":"2025-04-13T09:19:12.333Z","updated_at":"2026-04-10T22:10:37.829Z","avatar_url":"https://github.com/MPCodeWriter21.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"log21\n=====\n\n![version](https://img.shields.io/pypi/v/log21)\n![stars](https://img.shields.io/github/stars/MPCodeWriter21/log21)\n![forks](https://img.shields.io/github/forks/MPCodeWriter21/log21)\n![repo size](https://img.shields.io/github/repo-size/MPCodeWriter21/log21)\n[![CodeFactor](https://www.codefactor.io/repository/github/mpcodewriter21/log21/badge)](https://www.codefactor.io/repository/github/mpcodewriter21/log21)\n\nA simple logging package that helps you log colorized messages in Windows console and\nother operating systems.\n\nFeatures\n--------\n\n+ Colors : The main reason for this package was to log text in the Windows console with\n  the support of ANSI colors.\n+ Argument parsing : log21's argument parser can be used like python's argparse, but it\n  also colorizes the output.\n+ Logging : A similar logger to logging. Logger but with colorized output and other\n  options such as levelname modifications. It can also decolorize the output if you want\n  to log into a file.\n+ Pretty printing : Have you ever wanted to colorize the output of the pprint module?\n  log21's pretty printer can do that.\n+ Tree printing : You can pass a dict or list to `log21.tree_print` function, and it\n  will print it in a tree-like structure. It's also colorized XD.\n+ ProgressBar : log21's progress bar can be used to show progress of a process in a\n  beautiful way.\n+ LoggingWindow : Helps you to log messages and debug your code in a window other than\n  the console.\n+ CrashReporter : log21's crash reporter can be used to report crashes in different\n  ways. You can use it to log crashes to console or files or use it to receive crash\n  reports of your program through email. And you can also define your own crash\n  reporter functions and use them instead!\n+ Argumentify : You can use the argumentify feature to decrease the number of lines you\n  need to write to parse command-line arguments. It's colored by the way!\n+ Any idea? Feel free to [open an issue](https://github.com/MPCodeWriter21/log21/issues)\n  or submit a pull request.\n\n![Issues](https://img.shields.io/github/issues/MPCodeWriter21/log21)\n![contributors](https://img.shields.io/github/contributors/MPCodeWriter21/log21)\n\nInstallation\n------------\n\nWell, this is a python package so the first thing you need is python.\n\nIf you don't have python installed, please visit [Python.org](https://python.org) and\ninstall the latest version of python.\n\nThen you can install log21 using pip module:\n\n```bash\npython -m pip install log21 -U\n```\n\nOr you can clone [the repository](https://github.com/MPCodeWriter21/log21) and run:\n\n```bash\npip install .\n```\n\nOr let the pip get it using git:\n\n```bash\npip install git+https://github.com/MPCodeWriter21/log21\n```\n\nChangelog\n---------\n\n### v3.3.0\n\nAdd `log21.helper_types` module.\n\nThis module contains a collection of useful types meant for using with argument parser\nto parse CLI arguments to more usable formats.\n\n+ `FileSize`: Can take `str` and `int` values. Will convert human inputs such as \"121 KB\",\n  \"21MiB\", or \"4.56 GB\" to bytes. Can also be used to represent bytes value in more\n  human-readable formats.\n\nFor even more control you can still define Logger, Handlers, and Formatters manually.\n\n#### Example\n\n```python\nfrom pathlib import Path\n\nimport log21\nfrom log21.helper_types import FileSize\n\n\ndef main(path: Path, min_size: FileSize, max_size: FileSize, /):\n    log21.info(\n        \"Files that are smaller than %s or bigger than %s will be ignored.\",\n        args=(min_size, max_size),\n    )\n\n    for file in path.iterdir():\n        if not file.is_file():\n            continue\n        if min_size \u003c= (size := file.stat().st_size) \u003c= max_size:\n            log21.print(\n                \"`%s` is %s.\",\n                args=(file, FileSize(size).humanize(binary=False, fmt=\"%.4f\")),\n            )\n\n\nif __name__ == \"__main__\":\n    log21.argumentify(main)\n```\n\nExample usage and output:\n\n```shell\n$ uv run test.py . \"1.23MiB\" \"0.5 GB\"\n[21:21:21] [INFO] Files that are smaller than 1.23 MiB or bigger than 476.84 MiB will be\nignored.\n`myfile21.zip` is 35.1856 MB.\n```\n\n[Full CHANGELOG](https://github.com/MPCodeWriter21/log21/blob/master/CHANGELOG.md)\n\nUsage Examples\n---------------\n\nSee [EXAMPLES.md](https://github.com/MPCodeWriter21/log21/blob/master/EXAMPLES.md)\n\nAbout\n-----\n\nAuthor: CodeWriter21 (Mehrad Pooryoussof)\n\nGitHub: [MPCodeWriter21](https://github.com/MPCodeWriter21)\n\nTelegram Channel: [@CodeWriter21](https://t.me/CodeWriter21)\n\n### License\n\n![License](https://img.shields.io/github/license/MPCodeWriter21/log21)\n\n[apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n### Donate\n\nIn order to support this project you can donate some crypto of your choice 8D\n\n[Donate Addresses](https://github.com/MPCodeWriter21/log21/blob/master/DONATE.md)\n\nOr if you can't, give [this project](https://github.com/MPCodeWriter21/log21) a star on\nGitHub :)\n\nReferences\n----------\n\n+ ANSI Color Codes (Wikipedia):\n[https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpcodewriter21%2Flog21","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpcodewriter21%2Flog21","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpcodewriter21%2Flog21/lists"}