{"id":26483542,"url":"https://github.com/faucetsdn/python3-decorator","last_synced_at":"2025-09-11T05:40:12.726Z","repository":{"id":142804578,"uuid":"434068147","full_name":"faucetsdn/python3-decorator","owner":"faucetsdn","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-02T03:30:32.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-20T04:55:51.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faucetsdn.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-02T03:25:06.000Z","updated_at":"2021-12-02T03:28:50.000Z","dependencies_parsed_at":"2023-04-19T06:34:18.279Z","dependency_job_id":null,"html_url":"https://github.com/faucetsdn/python3-decorator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faucetsdn/python3-decorator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faucetsdn%2Fpython3-decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faucetsdn%2Fpython3-decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faucetsdn%2Fpython3-decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faucetsdn%2Fpython3-decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faucetsdn","download_url":"https://codeload.github.com/faucetsdn/python3-decorator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faucetsdn%2Fpython3-decorator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274583876,"owners_count":25311899,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"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":[],"created_at":"2025-03-20T04:55:53.781Z","updated_at":"2025-09-11T05:40:12.718Z","avatar_url":"https://github.com/faucetsdn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Decorators for Humans\n=====================\n\nThe goal of the decorator module is to make it easy to define\nsignature-preserving function decorators and decorator factories.\nIt also includes an implementation of multiple dispatch and other niceties\n(please check the docs). It is released under a two-clauses\nBSD license, i.e. basically you can do whatever you want with it but I am not\nresponsible.\n\nInstallation\n-------------\n\nIf you are lazy, just perform\n\n ``$ pip install decorator``\n\nwhich will install just the module on your system.\n\nIf you prefer to install the full distribution from source, including\nthe documentation, clone the `GitHub repo`_ or download the tarball_, unpack it and run\n\n ``$ pip install .``\n\nin the main directory, possibly as superuser.\n\n.. _tarball: https://pypi.org/project/decorator/#files\n.. _GitHub repo: https://github.com/micheles/decorator\n\nTesting\n--------\n\nIf you have the source code installation you can run the tests with\n\n `$ python src/tests/test.py -v`\n\nor (if you have setuptools installed)\n\n `$ python setup.py test`\n\nNotice that you may run into trouble if in your system there\nis an older version of the decorator module; in such a case remove the\nold version. It is safe even to copy the module `decorator.py` over\nan existing one, since we kept backward-compatibility for a long time.\n\nRepository\n---------------\n\nThe project is hosted on GitHub. You can look at the source here:\n\n https://github.com/micheles/decorator\n\nDocumentation\n---------------\n\nThe documentation has been moved to https://github.com/micheles/decorator/blob/master/docs/documentation.md\n\nFrom there you can get a PDF version by simply using the print\nfunctionality of your browser.\n\nHere is the documentation for previous versions of the module:\n\nhttps://github.com/micheles/decorator/blob/4.3.2/docs/tests.documentation.rst\nhttps://github.com/micheles/decorator/blob/4.2.1/docs/tests.documentation.rst\nhttps://github.com/micheles/decorator/blob/4.1.2/docs/tests.documentation.rst\nhttps://github.com/micheles/decorator/blob/4.0.0/documentation.rst\nhttps://github.com/micheles/decorator/blob/3.4.2/documentation.rst\n\nFor the impatient\n-----------------\n\nHere is an example of how to define a family of decorators tracing slow\noperations:\n\n.. code-block:: python\n\n   from decorator import decorator\n\n   @decorator\n   def warn_slow(func, timelimit=60, *args, **kw):\n       t0 = time.time()\n       result = func(*args, **kw)\n       dt = time.time() - t0\n       if dt \u003e timelimit:\n           logging.warn('%s took %d seconds', func.__name__, dt)\n       else:\n           logging.info('%s took %d seconds', func.__name__, dt)\n       return result\n\n   @warn_slow  # warn if it takes more than 1 minute\n   def preprocess_input_files(inputdir, tempdir):\n       ...\n\n   @warn_slow(timelimit=600)  # warn if it takes more than 10 minutes\n   def run_calculation(tempdir, outdir):\n       ...\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaucetsdn%2Fpython3-decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaucetsdn%2Fpython3-decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaucetsdn%2Fpython3-decorator/lists"}