{"id":27650799,"url":"https://github.com/grgomariani/python-decorators","last_synced_at":"2025-04-24T03:47:51.710Z","repository":{"id":287229615,"uuid":"133807713","full_name":"GrgoMariani/Python-Decorators","owner":"GrgoMariani","description":"A list of useful python decorators","archived":false,"fork":false,"pushed_at":"2020-05-18T21:15:59.000Z","size":35,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-24T03:47:46.864Z","etag":null,"topics":["bdd","console","debug","decorator","dfa","python-decorators"],"latest_commit_sha":null,"homepage":null,"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/GrgoMariani.png","metadata":{"files":{"readme":"README.md","changelog":"change/__init__.py","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,"zenodo":null}},"created_at":"2018-05-17T12:06:12.000Z","updated_at":"2024-09-04T07:46:00.000Z","dependencies_parsed_at":"2025-04-10T17:09:39.197Z","dependency_job_id":"be2ad6a0-60f2-4703-9e6c-6b17f5339952","html_url":"https://github.com/GrgoMariani/Python-Decorators","commit_stats":null,"previous_names":["grgomariani/python-decorators"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrgoMariani%2FPython-Decorators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrgoMariani%2FPython-Decorators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrgoMariani%2FPython-Decorators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrgoMariani%2FPython-Decorators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrgoMariani","download_url":"https://codeload.github.com/GrgoMariani/Python-Decorators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250560007,"owners_count":21450168,"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":["bdd","console","debug","decorator","dfa","python-decorators"],"created_at":"2025-04-24T03:47:51.223Z","updated_at":"2025-04-24T03:47:51.690Z","avatar_url":"https://github.com/GrgoMariani.png","language":"Python","readme":"# Python Decorators\n\n#### Description\n\nA list of helpful self-made Python decorators.\nMight be of use to someone while thinking about some design patterns you could use in your next project.\n\nAll code and examples are made to run on Python 3.3+\n\n```python\n@use_this_decorator\ndef on_this_function():\n\tpass\n```\n\n## Analyze\nA group of helpful decorators for debugging and optimizing your code. Decorate your functions to keep track of how many times you call them and how long their execution takes.\n\n[___Check Example Code___](example_analyze.py)\n\n## BDD tests\nA short take on Behaviour Driven Development testing.\n\n[___Check Example Code___](example_bdd_tests.py)\n\n## Change\nDecorators that change the function or it's input arguments. Or both.\n\n[___Check Example Code___](example_change.py)\n\n## Command Line\nA fun way to emulate the command line in under 50 lines of code. Try it!\n\n[___Check Example Code___](example_command_line.py)\n\n## Conditional\nThe decorator that executes the given function only if the condition is met.\n\n[___Check Example Code___](example_conditional.py)\n\n## DFA\nDeterministic Finite Automaton Emulator. A really simplified one, at least.\n\n[___Check Example Code___](example_dfa.py)\n\n## do in main thread\nExecutes the given function in the main thread.\n\n[___Check Example Code___](example_do_in_main_thread.py)\n\n## Max Refresh\nI should really get a better name for this. Best to check the example.\n\n[___Check Example Code___](example_max_refresh.py)\n\n## Print Me\nPrints the function, it's arguments and result. Really helpful for debugging.\n\n[___Check Example Code___](example_print_me.py)\n\n## Stack Results\nEmulates a giant stack on which to put results that can be taken care of later.\n\n[___Check Example Code___](example_stack_results.py)\n\n## Ternary\nA slightly different take on ternary operator.\n\n[___Check Example Code___](example_ternary.py)\n\n## TODO\nWriting a lot of functions that are only defined? Use this.\n\n[___Check Example Code___](example_todo.py)\n\n## VA_ARGS\nC-style va_args operator.\n\n[___Check Example Code___](example_va_args.py)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrgomariani%2Fpython-decorators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrgomariani%2Fpython-decorators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrgomariani%2Fpython-decorators/lists"}