{"id":22889502,"url":"https://github.com/mononobi/pyrin","last_synced_at":"2025-09-03T22:41:13.308Z","repository":{"id":62583125,"uuid":"185481041","full_name":"mononobi/pyrin","owner":"mononobi","description":"A rich, fast, performant and easy to use application framework to build apps using Flask on top of it.","archived":false,"fork":false,"pushed_at":"2023-08-20T22:23:53.000Z","size":3422,"stargazers_count":13,"open_issues_count":58,"forks_count":7,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-16T20:46:59.985Z","etag":null,"topics":["admin-panel","alembic","application-framework","authentication","authorization","caching","celery","core","flask","ioc","json","multi-database","pyrin","python","redis","rest-api","sentry","serializer","sqlalchemy","swagger-ui"],"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/mononobi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-05-07T21:31:15.000Z","updated_at":"2024-06-13T09:42:45.000Z","dependencies_parsed_at":"2025-05-07T14:07:18.060Z","dependency_job_id":"4b13697d-38fc-41c1-9794-9c165676544b","html_url":"https://github.com/mononobi/pyrin","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/mononobi/pyrin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mononobi%2Fpyrin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mononobi%2Fpyrin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mononobi%2Fpyrin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mononobi%2Fpyrin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mononobi","download_url":"https://codeload.github.com/mononobi/pyrin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mononobi%2Fpyrin/sbom","scorecard":{"id":658852,"data":{"date":"2025-08-11","repo":{"name":"github.com/mononobi/pyrin","commit":"9d4776498225de4f3d16a4600b5b19212abe8562"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: 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":"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":"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":"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"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:111","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:112","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:120","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:121","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:126","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:127","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:132","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:133","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:138","Warn: pipCommand not pinned by hash: scripts/setup/install-dependencies.sh:139","Info:   0 out of  10 pipCommand dependencies pinned"],"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":"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":0,"reason":"37 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-858 / GHSA-q4xr-rc97-m4xx","Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2023-254 / GHSA-jfhm-5ghh-2f97","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2022-202 / GHSA-ffqj-6fqr-9h24","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: GHSA-29pr-6jr8-q5jm","Warn: Project is vulnerable to: GHSA-g92j-qhmh-64v2","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: GHSA-2m57-hf25-phgg","Warn: Project is vulnerable to: PYSEC-2023-87 / GHSA-rrm6-wvj7-cwh2","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: GHSA-2g68-c3qc-8985","Warn: Project is vulnerable to: GHSA-f9vj-2wh5-fj8j","Warn: Project is vulnerable to: PYSEC-2023-221 / GHSA-hrfv-mqp8-q5rw","Warn: Project is vulnerable to: GHSA-q34m-jh98-gwm2","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T15:29:08.830Z","repository_id":62583125,"created_at":"2025-08-21T15:29:08.830Z","updated_at":"2025-08-21T15:29:08.830Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273523637,"owners_count":25120864,"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-03T02:00:09.631Z","response_time":76,"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":["admin-panel","alembic","application-framework","authentication","authorization","caching","celery","core","flask","ioc","json","multi-database","pyrin","python","redis","rest-api","sentry","serializer","sqlalchemy","swagger-ui"],"created_at":"2024-12-13T21:43:51.971Z","updated_at":"2025-09-03T22:41:13.261Z","avatar_url":"https://github.com/mononobi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pyrin\n\nA rich, fast, performant and easy to use application framework \nto build apps using Flask on top of it.\n\nPyrin is an application framework built on top of Flask micro-framework to make \nlife easier for developers who want to develop an enterprise application \nusing Flask, without having to make their own core layer and getting better code\ndesign and structure that is more maintainable.\n\nPyrin could be used as the parent package of an application, so other application \npackages will use its functionality and features to maintain their goals without \nworrying about basic implementations.\nIt is also possible for application packages to extend existing Pyrin packages.\n\nPyrin point of view is to build an application which is more decoupled, so making it \npossible to have customized implementations of different packages and also making it \neasier to write unit-test packages.\n\nAnother major fact of Pyrin is to avoid centralized locations for application features, so a team\nof multiple developers be able to work on the same repository without facing conflicts here\nand there. Also reducing the chances of annoying bugs due to forgetting to register\nsomething in somewhere.\n\n## Installing\n\n**Install using pip**:\n\n**`pip install pyrin`**\n\n## Running Tests\n\nTo be able to run tests:\n\n1. Pyrin tests are developed using pytest, you should first \n   install pyrin tests dependencies using pip:\n   \n**`pip install pyrin[tests]`**\n\n2. Now you could execute **`python3 start_unit.py`** to start all unit tests.\n\n## Demo Application\n\nA demo application developed using Pyrin framework is available at: \n[Pyrin-Demo](https://github.com/mononobi/pyrin_demo)\n\n## Contribute In Pyrin Development\n\nWe highly appreciate any kind of contributions to Pyrin development.\nFork Pyrin and implement a new feature and make a pull request, we'll let\nyou know when your work becomes a part of Pyrin.\nSo, open the project in your IDE and create your pipenv environment.\nThen you could start developing Pyrin.\n\n## Extremely Simple Usage Example\n\nThe sample code below, is just a rapid showcase on how to develop using Pyrin. \nfor a real world application, it is best fit to use the concept of dependency injection \nand IoC which Pyrin is built upon.\n\nTo be able to create an application based on Pyrin, the only thing that is required to do\nis to subclass from pyrin **`Application`** class in your application package. this is \nneeded for Pyrin to be able to find out your application path for generating different \npaths and also loading your application packages. there is no difference where to put \nyour subclassed **`Application`**, in this example we put it inside the project's main \npackage, inside **`__init__.py`**.\n\n\n**Sample Project Structure:**\n\n- root_dir\n  - demo\n    - `__init__.py`\n    - `api.py`\n    - `models.py`\n  - `start.py`\n\n**`__init__.py:`**\n\n```python\nfrom pyrin.application.base import Application\n\n\nclass DemoApplication(Application):\n    pass\n```\n\n**`models.py:`**\n\n```python\nfrom pyrin.database.model.declarative import CoreEntity\nfrom pyrin.database.orm.sql.schema.columns import GUIDPKColumn, StringColumn, SmallIntegerColumn\n\n\nclass GuestEntity(CoreEntity):\n\n    _table = 'guest'\n\n    id = GUIDPKColumn(name='id')\n    name = StringColumn(name='name', max_length=100, validated=True)\n    age = SmallIntegerColumn(name='age', min_value=1, validated=True)\n```\n\n**`api.py:`**\n\n```python\nfrom pyrin.api.router.decorators import api\nfrom pyrin.core.structs import DTO\nfrom pyrin.database.services import get_current_store\n\nfrom demo.models import GuestEntity\n\n\n@api('/introduce/\u003cname\u003e', authenticated=False)\ndef introduce(name, **options):\n    \"\"\"\n    introduce yourself to us.\n    ---\n    parameters:\n      - name: name\n        type: string\n        description: your name\n    responses:\n      200:\n        schema:\n          type: string\n          description: a welcome note\n    \"\"\"\n    store = get_current_store()\n    guest = GuestEntity(name=name)\n    store.add(guest)\n    return 'Hello dear {name}, you have been added into our database.'.format(name=name)\n\n\n@api('/guests', authenticated=False)\ndef guests(**options):\n    \"\"\"\n    gets the list of all guests.\n    ---\n    responses:\n      200:\n        schema:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: string\n                format: uuid\n                description: id of guest\n              name:\n                type: string\n                description: name of guest\n              age:\n                type: integer\n                description: age of guest.\n    \"\"\"\n    store = get_current_store()\n    return store.query(GuestEntity).all()\n\n\n@api('/', authenticated=False)\ndef hello(**options):\n    \"\"\"\n    shows the welcome message.\n    ---\n    responses:\n      200:\n        schema:\n          properties:\n            message:\n              type: string\n              description: welcome message\n            current_guests:\n              type: integer\n              description: count of current guests\n    \"\"\"\n    store = get_current_store()\n    count = store.query(GuestEntity.id).count()\n    result = DTO(message='Welcome to our demo application, please introduce yourself.',\n                 current_guests=count)\n    return result\n```\n\n**`start.py:`**\n\n```python\nfrom demo import DemoApplication\n\n\nif __name__ == '__main__':\n    app = DemoApplication()\n    app.run(use_reloader=False)\n```\n\nNow you could start application by executing this command in your terminal:\n\n**`python3 start.py`**\n\nApplication will be available at **`127.0.0.1:5000`** by default.\n\nPyrin on default configurations, will use an **`in-memory sqlite`** database.\n\n## Creating a New Pyrin Project\n\nPyrin has a command line tool that can be used to create a new project.\nto use the command line interface of Pyrin, install Pyrin and then open a terminal and write:\n\n```shell\npyrin project\n```\n\nafter hitting enter, a couple of questions will be asked to create your project, answer\nquestions accordingly, and your project will be created without a hassle.\n\n## Using Project's Extended Command Line Tool\n\nAfter creating a new project using **`pyrin project`** command, a **`cli.py`** file will \nbe generated in the root of your new project directory. there are a couple of command \ngroups that can be used to perform different actions. \nexecute each command with **`--help`** option to see all available commands of each group.\n\n- **Builtin Commands:**\n\n  - **`python cli.py alembic`**\n  - **`python cli.py babel`**\n  - **`python cli.py template`**\n  - **`python cli.py security`**\n    \n\n- **Integration Commands:**\n  - **`python cli.py celery`**\n\n## Integrations\n\nPyrin has builtin integrations for different services. to use each one of integrations inside\nyour application, you must install dependencies of that integration.\n\n**Celery:**\n\n**`pip install pyrin[celery]`**\n\nTo enable celery after installing its dependencies, open **`settings/packaging.ini`** file\nand remove **`pyrin.task_queues.celery`** from the **`ignored_packages`** list.\n\n**Sentry:**\n\n**`pip install pyrin[sentry]`**\n\nTo enable sentry after installing its dependencies, open **`settings/packaging.ini`** file\nand remove **`pyrin.logging.sentry`** from the **`ignored_packages`** list.\n\n**Redis:**\n\n**`pip install pyrin[redis]`**\n\nTo enable redis after installing its dependencies, open **`settings/packaging.ini`** file\nand remove **`pyrin.caching.remote.handlers.redis`** from the **`ignored_modules`** list.\n\n**Memcached:**\n\n**`pip install pyrin[memcached]`**\n\nTo enable memcached after installing its dependencies, open **`settings/packaging.ini`** file\nand remove **`pyrin.caching.remote.handlers.memcached`** from the **`ignored_modules`** list.\n\n## Built-in Swagger UI Support\n\nPyrin has built-in support for Swagger UI thanks to \n[Flasgger](https://github.com/flasgger/flasgger).\nall of your api services are available on swagger without anything needed to be done.\nbut you can enhance Swagger UI of your application by setting a good **`yaml`**\ndocstring for your api method views.\nYou can head over to **`127.0.0.1:5000/swagger`** to test the Swagger UI.\n\n## Inspiration\n\nThis project is inspired by the awesome **`Deltapy`** framework by:\n- [@abisxir](https://github.com/abisxir)\n- [@mvavesal](https://github.com/mvavesal)\n\nUnfortunately I couldn't find any links to it online.\n\n## Hint\n\n`Pyrin` is a greek word and means core.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmononobi%2Fpyrin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmononobi%2Fpyrin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmononobi%2Fpyrin/lists"}