{"id":18643354,"url":"https://github.com/ryu-cz/restx-monkey","last_synced_at":"2025-04-11T11:31:57.996Z","repository":{"id":59750200,"uuid":"529148628","full_name":"Ryu-CZ/restx-monkey","owner":"Ryu-CZ","description":"Monkey patches for unmaintained flask-restx","archived":false,"fork":false,"pushed_at":"2023-10-13T09:07:03.000Z","size":3968,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T09:04:39.782Z","etag":null,"topics":["api","flask","flask-restx","json","openapi","python","rest","restful","restplus","restx","swagger"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ryu-CZ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-26T06:52:17.000Z","updated_at":"2024-11-07T11:02:10.000Z","dependencies_parsed_at":"2022-09-21T06:06:29.962Z","dependency_job_id":null,"html_url":"https://github.com/Ryu-CZ/restx-monkey","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.4358974358974359,"last_synced_commit":"e85d652e99447857702b3b74d312d1ada35935a3"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryu-CZ%2Frestx-monkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryu-CZ%2Frestx-monkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryu-CZ%2Frestx-monkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryu-CZ%2Frestx-monkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryu-CZ","download_url":"https://codeload.github.com/Ryu-CZ/restx-monkey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248384012,"owners_count":21094657,"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":["api","flask","flask-restx","json","openapi","python","rest","restful","restplus","restx","swagger"],"created_at":"2024-11-07T06:06:33.849Z","updated_at":"2025-04-11T11:31:54.795Z","avatar_url":"https://github.com/Ryu-CZ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Restx-Monkey\n\n[![codecov](https://codecov.io/gh/Ryu-CZ/restx-monkey/graph/badge.svg?token=3WT6TSHPPQ)](https://codecov.io/gh/Ryu-CZ/restx-monkey)\n\nMonkey patches for unmaintained [flask-restx](https://github.com/python-restx/flask-restx) python package to keep\nyour installation of flask-restx compatible with the latest [flask](https://github.com/pallets/flask)\nand [werkzeug](https://github.com/pallets/werkzeug).\n\n**Good NEWS everyone!** Package [flask-restx](https://github.com/python-restx/flask-restx) is maintained now! I strongly suggest to submit issues on official project [issues page](https://github.com/python-restx/flask-restx/issues).\n\n## Installation\n\nTo install restx_monkey, use [pip](https://pip.pypa.io/en/stable/):\n\n```shell\npython -m pip install -U restx-monkey\n```\n\n## Usage\n\nBefore importing `flask-restx` apply all patches in your main module:\n\n```python\n# app main file\nimport restx_monkey as monkey\n\nmonkey.patch_restx()\n\n# after patch import other modules \nimport flask_restx\n# your other code\n```\n\nor select which patches you do not want to apply\n\n```python\n# app main file\nimport restx_monkey as monkey\n\nmonkey.patch_restx(fix_restx_api=False)\n\n# after patch import other modules \nimport flask_restx\n# your other code\n```\n\n### What is patched?\n\nHere is list of patches applied to [flask-restx](https://github.com/python-restx/flask-restx) package by this monkey:\n\n- _replace_parse_rule_ - injects `parse_rule` method into werkzeug because `flask-restx` is using this internal method\n- _fix_restx_api_ - fix deprecated `flask-restx.api.Api` init of `doc` endpoints after blueprint is bound\n- _fix_restx_parser_ - replace failing `flask_restx.reqparse.Argument` class with child whom can correctly handle `json`\n  location of argument in `flask.Request` even in HTTP `GET` callback\n- _update_swagger_ui_ - replace content of `flask_restx.static` directory with the later swagger UI then restx \u003c 1.0\n- _fix_endpoint_from_view_ - fix `flask.scaffold` missing `_endpoint_from_view_func`\n- _inject_versions_ - puts back `__version__` to `flask` and `werkzeug` for `3.0+` where the version was removed \n\n## Goal of project\n\nKeep [flask-restx](https://github.com/python-restx/flask-restx) compatible with the\nlatest [flask](https://github.com/pallets/flask) and [werkzeug](https://github.com/pallets/werkzeug) as long as it is\nreasonable simple to monkey patch it.\n\n### What this project is not\n\nThis project does not solve incompatibilities of other python packages\nusing [flask-restx](https://github.com/python-restx/flask-restx).\n\n\n## Tests\n\nYou can run tests with coverage tracing:\n\n```shell\npython -m coverage run -m unittest tests/test_* -v \n```\n\nTo generate coverage report:\n\n```shell\npython -m coverage html   \n```\n\n## Build\n\nClone repo and set up your pypi repo account credentials on build for build environment.\n\n- Move to package repo:\n\n    ```shell\n    cd ~/git/restx_monkey\n    ```\n\n- Install requirements:\n\n   ```shell\n   python -m pip install -Ur requirements.txt\n   ```\n\n- Clean old build fragments:\n\n    ```shell\n    rm -rf ./dist ./build ./src/restx_monkey.egg-info\n    ```\n\n- Build new package:\n\n    ```shell\n    python -m build\n    ``` \n\n- Upload new package:\n\n    ```shell\n    python -m twine upload dist/* \n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryu-cz%2Frestx-monkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryu-cz%2Frestx-monkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryu-cz%2Frestx-monkey/lists"}