{"id":39617012,"url":"https://github.com/hypernormalisation/timbermafia","last_synced_at":"2026-01-18T08:20:08.551Z","repository":{"id":57475522,"uuid":"239275698","full_name":"hypernormalisation/timbermafia","owner":"hypernormalisation","description":"Python package that makes implementing good-looking and flexible logging easy.","archived":false,"fork":false,"pushed_at":"2024-11-22T12:17:06.000Z","size":628,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-01T23:15:38.212Z","etag":null,"topics":["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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypernormalisation.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}},"created_at":"2020-02-09T09:11:31.000Z","updated_at":"2024-11-22T12:17:20.000Z","dependencies_parsed_at":"2022-09-07T17:11:39.432Z","dependency_job_id":null,"html_url":"https://github.com/hypernormalisation/timbermafia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hypernormalisation/timbermafia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernormalisation%2Ftimbermafia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernormalisation%2Ftimbermafia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernormalisation%2Ftimbermafia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernormalisation%2Ftimbermafia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypernormalisation","download_url":"https://codeload.github.com/hypernormalisation/timbermafia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernormalisation%2Ftimbermafia/sbom","scorecard":{"id":475466,"data":{"date":"2025-08-11","repo":{"name":"github.com/hypernormalisation/timbermafia","commit":"186b9adcd705d43cfcee59ea7bde9ee10de4090b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T15:10:16.926Z","repository_id":57475522,"created_at":"2025-08-19T15:10:16.926Z","updated_at":"2025-08-19T15:10:16.926Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["logging","python","python3"],"created_at":"2026-01-18T08:20:07.809Z","updated_at":"2026-01-18T08:20:08.492Z","avatar_url":"https://github.com/hypernormalisation.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timbermafia\n\n![](static/demo0.png)\n\n`timbermafia` is a drop-in replacement for application logging in\npython, supporting 256-bit colour output over aligned columns and expanded\nformatting options.\n\nUsers can choose from a selection of predefined styles and colour\npalettes, or can easily make their own.\n\n## Installation\n\n`timbermafia` is available on the Python Package Index (PyPI).\n```bash\npip install timbermafia\n```\nIt requires python version 3.6 or later.\n\n## Basic usage\n\nYou can get started using timbermafia with a simple:\n```python\nimport timbermafia as tm\ntm.basic_config()\n```\nplaced in your script or application. This configuration function is\nvery flexible, and can be used to specify styles, colour palettes,\nlogging and date formats, output streams or files, and more.\n\n`timbermafia.basic_config` is by default similar to\n`logging.basicConfig`, in that it modifies the logging module's root\nlogger. This may not be what you want: for instance, every library with\nlogging calls in your application will produce output!\n\nTo prevent this, instead produce a named `logging.Logger` object by\npassing the `name` keyword to the function, and retrieve it later with\n`logging.getLogger`.\n\n## Try it out!\n\nOnce installed with `pip`, a script called `demo_timbermafia` is placed\nin the user's bin. The user can specify a style, colour palette, and\nlogging format to be used:\n\n![](static/demo1.png)\n\nThe available styles and colour palettes can be shown with\n\n```python\nimport timbermafia as tm\ntm.print_styles()\ntm.print_palettes()\n```\n\n## Advanced usage\nThe `timbermafia.basic_config` function is fairly flexible, and should\ncover most use cases for configuring logging to streams and files.\n\nIf you have a specific logging requirement for other logging handlers,\nor require a more fine control of handler levels, you can acquire an\ninstance of the custom formatter with something like:\n\n```python\nimport timbermafia as tm\nf = tm.get_timbermafia_formatter(style='compact', palette='ocean')\n```\n\nand use the formatter in your own logging handlers.\n\n## Titles in logging\n\nTimbermafia supports monkey patching of the `logging.Logger` class to\nenable any Logger object to print a title with a divider to the output.\n\nTo enable this run\n\n```python\nimport timbermafia as tm\ntm.monkey_patch_logger()\n```\n\nand then from any logger do e.g.:\n\n```python\nimport logging\nlog = logging.getLogger()\nlog.header('My title')\nlog.info('You can separate your output into sections.')\nlog.debug('Titles respect colour schemes.')\n```\n\nto produce the following in your logging output.\n\n![](static/demo4.png)\n\n## Formats\n\n`timbermafia` expands what is possible in a logging format, adding\nsupport for a variety of features.\n\n### Vertically-aligned columns.\n\nThe user can specify columns to be used in the output, which for long\nmessages, names, function names etc. can be used to print legible\nmulti-line output.\n\nThe column widths adapt based on what fields are present in them, so\ncolumns containing a high amount of output get more room.\n\nAn example format using 4 columns, containing respectively the:\n- date/time\n- level name\n- process name and log name\n- log message\n\ncan be specified with a column escape, by default \"_\". Whatever follows\nthe column escape until the next whitespace is registered as output that\nwill visually separate the column.\n\nSo our format can be e.g.\n\n```\n{asctime} _| {levelname} _| {processName} {name}  __:: {message}\n```\n\nwhich produces the following output with the \"synth\" colour palette:\n\n![](static/demo2.png)\n\nNote that we double-escape the final separator so that it prints over\nall lines of multi-line output, and that multiple characters, or indeed\nno characters, can be used as a column separator.\n\n### Enhanced fmt_spec\n\nIndividual log records can be formatted according to a format\nspecification, or fmt_spec.\n\nFor example, the following output will force the message content to be\nbold and bright green, overriding any formatting based upon the log\nlevel, and underline the time to punctuate the start of a new log\nrecord:\n\n```\n{asctime:u} _ {name} _ {message:b,\u003e82}\n```\n\nLet's try that out with the \"ocean\" palette:\n\n![](static/demo3.png)\n\nThe following are recognised in the format spec via a comma-separated\nlist:\n- b: bold\n- e: emphasis/italic\n- u: underline\n- any int: the corresponding ANSI code, e.g. 5,9 will set slow blink and\n  crossed-out text\n- \\\u003eint: set the foreground colour to the 8-bit colour code.\n- \\\u003cint: set the background colour to the 8-bit colour code.\n\nNote that what ANSI codes will be possible is dependent on what terminal\nor terminal emulator is being used.\n\nA full list of the ANSI colour codes matched to some sample output can\nbe printed to the terminal with the included script\n`display_ansi_colours`.\n\n## Custom styles and palettes\n\nEach style and palette can be generated into a Style or Palette object,\nwith a flexible customisation supported.\n\nA full guide to customising styles and palettes can be found in [this\nnotebook](notebooks/styles_and_palettes.ipynb).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypernormalisation%2Ftimbermafia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypernormalisation%2Ftimbermafia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypernormalisation%2Ftimbermafia/lists"}