{"id":20845769,"url":"https://github.com/adriamontoto/developing-tools","last_synced_at":"2025-05-09T02:44:30.298Z","repository":{"id":245718915,"uuid":"818576015","full_name":"adriamontoto/developing-tools","owner":"adriamontoto","description":"The Developing Tools project is a Python 🐍 package designed to enhance the development process by providing a collection of tools/utilities ⚒️ aimed at improving debugging, performance measurement, error handling, ...","archived":false,"fork":false,"pushed_at":"2025-05-02T10:13:48.000Z","size":107,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T12:16:37.437Z","etag":null,"topics":["decorator","development","python","python3","python311","python312","python313","tools","utilities"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/developing-tools/","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/adriamontoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-22T08:12:55.000Z","updated_at":"2025-03-20T15:52:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9c3c7ca-acb9-44b3-9756-7fc429615848","html_url":"https://github.com/adriamontoto/developing-tools","commit_stats":null,"previous_names":["adriamontoto/developing-tools"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriamontoto%2Fdeveloping-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriamontoto%2Fdeveloping-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriamontoto%2Fdeveloping-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriamontoto%2Fdeveloping-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adriamontoto","download_url":"https://codeload.github.com/adriamontoto/developing-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253180885,"owners_count":21866988,"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":["decorator","development","python","python3","python311","python312","python313","tools","utilities"],"created_at":"2024-11-18T02:13:53.787Z","updated_at":"2025-05-09T02:44:30.287Z","avatar_url":"https://github.com/adriamontoto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n# 🐣💻 Developing Tools\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/adriamontoto/developing-tools/actions/workflows/test.yaml?event=push\u0026branch=master\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/adriamontoto/developing-tools/actions/workflows/test.yaml/badge.svg?event=push\u0026branch=master\" alt=\"Test Pipeline\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/adriamontoto/developing-tools/actions/workflows/lint.yaml?event=push\u0026branch=master\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/adriamontoto/developing-tools/actions/workflows/lint.yaml/badge.svg?event=push\u0026branch=master\" alt=\"Lint Pipeline\"\u003e\n    \u003c/a\u003e\n        \u003ca href=\"https://coverage-badge.samuelcolvin.workers.dev/redirect/adriamontoto/developing-tools\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://coverage-badge.samuelcolvin.workers.dev/adriamontoto/developing-tools.svg\" alt=\"Coverage Pipeline\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/developing-tools\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/developing-tools?color=%2334D058\u0026label=pypi%20package\" alt=\"Package Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/developing-tools/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/pyversions/developing-tools.svg?color=%2334D058\" alt=\"Supported Python Versions\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nThe **Developing Tools** project is a Python 🐍 package designed to enhance the development process by providing a collection of tools/utilities aimed at improving debugging, performance measurement, error handling, ...\n\nThese tools ⚒️ are intended to assist developers in identifying performance bottlenecks, handling transient errors, and gaining insights into function behavior during runtime. The package is easy to install and use, making it a good addition to any Python developer's toolkit 🚀.\n\u003cbr\u003e\u003cbr\u003e\n\n## Table of Contents\n\n- [📥 Installation](#installation)\n- [💻 Utilization](#utilization)\n- [🤝 Contributing](#contributing)\n- [🔑 License](#license)\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\u003cbr\u003e\u003cbr\u003e\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n\n## 📥 Installation\n\nYou can install **Developing Tools** using `pip`:\n\n```bash\npip install developing-tools\n```\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\u003cbr\u003e\u003cbr\u003e\n\n\u003ca name=\"utilization\"\u003e\u003c/a\u003e\n\n## 💻 Utilization\n\n### Execution Time\n\nThe [`execution_time`](https://github.com/adriamontoto/developing-tools/blob/master/developing_tools/functions/execution_time.py) decorator allows you to measure the execution time of a function. The decorator has one parameter:\n\n- `output_decimals`: Number of decimal places to display in the output. Default is 10.\n\n```python\nfrom time import sleep\nfrom developing_tools.functions import execution_time\n\n@execution_time(output_decimals=2)\ndef too_slow_function() -\u003e None:\n    sleep(2)\n\ntoo_slow_function()\n\n# \u003e\u003e\u003e Function \"too_slow_function\" took 2.00 seconds to execute.\n```\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\n\n### Retry It\n\nThe [`retryit`](https://github.com/adriamontoto/developing-tools/blob/master/developing_tools/functions/retryit.py) decorator allows you to retry a function multiple times in case of failure. The decorator has two parameters:\n\n- `attempts`: The number of attempts to execute the function, if _None_ the function will be executed indefinitely. Default is _None_.\n- `delay`: The delay between attempts in seconds, if a tuple is provided the delay will be randomized between the two values. Default is 5 seconds.\n- `raise_exception`: If _True_ the decorator will raise the last caught exception if the function fails all attempts. Default is _True_.\n- `valid_exceptions`: A tuple of exceptions that the decorator should catch and retry the function, if _None_ the decorator will catch all exceptions. Default is _None_.\n\n```python\nfrom developing_tools.functions import retryit\n\n@retryit(attempts=3, delay=0.5, raise_exception=True, valid_exceptions=(ValueError,))\ndef failing_function() -\u003e None:\n    raise ValueError('This function always fails!')\n\nfailing_function()\n\n# \u003e\u003e\u003e Function failed with error: \"This function always fails!\". Retrying in 0.50 seconds ...\n# \u003e\u003e\u003e Attempt [2/3] to execute function \"failing_function\".\n# \u003e\u003e\u003e Function failed with error: \"This function always fails!\". Retrying in 0.50 seconds ...\n# \u003e\u003e\u003e Attempt [3/3] to execute function \"failing_function\".\n# \u003e\u003e\u003e Function failed with error: \"This function always fails!\". No more attempts.\n# Traceback (most recent call last):\n#   File \"\u003cfile_path\u003e/main.py\", line 7, in \u003cmodule\u003e\n#     failing_function()\n#   File \"\u003cfile_path\u003e/developing_tools/functions/retryit.py\", line 132, in wrapper\n#     raise exception\n#   File \"\u003cfile_path\u003e/developing_tools/functions/retryit.py\", line 124, in wrapper\n#     return function(*args, **kwargs)\n#            ^^^^^^^^^^^^^^^^^^^^^^^^^\n#   File \"\u003cfile_path\u003e/main.py\", line 5, in failing_function\n#     raise ValueError('This function always fails!')\n# ValueError: This function always fails!\n```\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\n\n### Print Parameters\n\nThe [`print_parameters`](https://github.com/adriamontoto/developing-tools/blob/master/developing_tools/functions/print_parameters.py) decorator allows you to print the parameters of a function. The decorator has two parameters:\n\n- `show_types`: If _True_ the decorator will print the types of the parameters. Default is _False_.\n- `include_return`: If _True_ the decorator will print the return value of the function. Default is _True_.\n\n```python\nfrom developing_tools.functions import print_parameters\n\n@print_parameters(show_types=True, include_return=True)\ndef normal_function(a: int, b: str, c: int, d) -\u003e str:\n    return a\n\nnormal_function(1, 'Hello', c=3, d=4)\n\n# \u003e\u003e\u003e Positional arguments:\n# \u003e\u003e\u003e         Argument 1: value \"1\", type int\n# \u003e\u003e\u003e         Argument 2: value \"Hello\", type str\n# \u003e\u003e\u003e\n# \u003e\u003e\u003e Keyword arguments:\n# \u003e\u003e\u003e         Argument c: value \"3\", supposed type int, real type int\n# \u003e\u003e\u003e         Argument d: value \"4\", supposed type Any, real type int\n# \u003e\u003e\u003e\n# \u003e\u003e\u003e Return value:\n# \u003e\u003e\u003e         \"1\", supposed type str, real type int\n```\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\n\n### Timeout\n\nThe [`timeout`](https://github.com/adriamontoto/developing-tools/blob/master/developing_tools/functions/timeout.py) decorator allows you to set a maximum execution time for a function. The decorator has one parameter:\n\n- `seconds`: The maximum number of seconds the function is allowed to execute before raising a _TimeoutError_. Default is 10 seconds.\n\n```python\nfrom time import sleep\nfrom developing_tools.functions import timeout\n\n@timeout(seconds=2)\ndef too_slow_function() -\u003e None:\n    sleep(5)\n\ntoo_slow_function()\n\n# \u003e\u003e\u003e TimeoutError: Function too_slow_function exceeded the 2 seconds timeout.\n```\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n\n## 🤝 Contributing\n\nWe welcome contributions to **Developing Tools**! To ensure a smooth collaboration process, please follow the guidelines below.\n\n### How to Contribute\n\n**1. Fork the Repository:** Click the \"Fork\" button at the top right of the repository page.\n\n**2. Clone Your Fork:**\n\n```bash\ngit clone git+ssh://git@github.com/\u003cyour-username\u003e/developing-tools.git\n```\n\n**3. Create a Branch:**\n\n```bash\ngit checkout -b feature/your-feature-name\n```\n\n**4. Make Your Changes:** Implement your new feature or fix a bug.\n\n**5. Run Tests:** Ensure all the following tests pass before submitting your changes.\n\n- Run tests:\n\n```bash\nmake test\n```\n\n- Run tests with coverage:\n\n```bash\nmake coverage\n```\n\n- Run linter:\n\n```bash\nmake lint\n```\n\n- Run formatter:\n\n```bash\nmake format\n```\n\n**6. Commit Your Changes:**\n\n```bash\ngit commit -m \"✨ feature: your feature description\"\n```\n\n**7. Push to Your Fork:**\n\n```bash\ngit push origin feature/your-feature-name\n```\n\n**8. Create a Pull Request:** Navigate to the original repository and create a pull request from your fork.\n\n**9. Wait for Review:** Your pull request will be reviewed by the maintainers. Make any necessary changes based on their feedback.\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\u003cbr\u003e\u003cbr\u003e\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n\n## 🔑 License\n\nThis project is licensed under the terms of the [`MIT license`](https://github.com/adriamontoto/developing-tools/blob/master/LICENSE.md).\n\n\u003cp align=\"right\"\u003e\n    \u003ca href=\"#readme-top\"\u003e🔼 Back to top\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriamontoto%2Fdeveloping-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriamontoto%2Fdeveloping-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriamontoto%2Fdeveloping-tools/lists"}