{"id":28764942,"url":"https://github.com/klen/muffin-jinja2","last_synced_at":"2025-09-07T06:07:08.821Z","repository":{"id":51355072,"uuid":"34866124","full_name":"klen/muffin-jinja2","owner":"klen","description":"Jinja2 templates for Muffin framework","archived":false,"fork":false,"pushed_at":"2025-03-06T03:55:35.000Z","size":204,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-08-21T04:54:41.712Z","etag":null,"topics":["asyncio","jinja2","muffin","trio"],"latest_commit_sha":null,"homepage":"","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/klen.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/codeowners","security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-04-30T16:58:32.000Z","updated_at":"2024-07-31T22:08:59.000Z","dependencies_parsed_at":"2024-06-19T17:10:14.327Z","dependency_job_id":"bb408792-3719-4eac-acf6-0ecc52bdba9e","html_url":"https://github.com/klen/muffin-jinja2","commit_stats":null,"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/klen/muffin-jinja2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-jinja2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-jinja2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-jinja2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-jinja2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/muffin-jinja2/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-jinja2/sbom","scorecard":{"id":563340,"data":{"date":"2025-08-11","repo":{"name":"github.com/klen/muffin-jinja2","commit":"8c270cf7cfce7ee718e6629ad62add9bebdef747"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: .github/security.md:1","Info: Found linked content: .github/security.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: .github/security.md:1"],"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":"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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/klen/muffin-jinja2/release.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/klen/muffin-jinja2/release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/klen/muffin-jinja2/tests.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/klen/muffin-jinja2/tests.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/klen/muffin-jinja2/tests.yml/develop?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction 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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT 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":"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 'develop'"],"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":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"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-20T14:16:42.264Z","repository_id":51355072,"created_at":"2025-08-20T14:16:42.265Z","updated_at":"2025-08-20T14:16:42.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274001591,"owners_count":25205291,"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-07T02:00:09.463Z","response_time":67,"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":["asyncio","jinja2","muffin","trio"],"created_at":"2025-06-17T10:13:01.879Z","updated_at":"2025-09-07T06:07:08.775Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Muffin-Jinja2\n#############\n\n.. _description:\n\n**Muffin-Jinja2** -- Support Jinja2 templates for Muffin_ Framework\n\n.. _badges:\n\n.. image:: https://github.com/klen/muffin-jinja2/workflows/tests/badge.svg\n    :target: https://github.com/klen/muffin-jinja2/actions\n    :alt: Tests Status\n\n.. image:: https://img.shields.io/pypi/v/muffin-jinja2\n    :target: https://pypi.org/project/muffin-jinja2/\n    :alt: PYPI Version\n\n.. _contents:\n\n.. contents::\n\n.. _requirements:\n\nRequirements\n=============\n\n- python \u003e= 3.9\n\n.. _installation:\n\nInstallation\n=============\n\n**Muffin-Jinja2** should be installed using pip: ::\n\n    pip install muffin-jinja2\n\n.. _usage:\n\nUsage\n=====\n\n.. code-block:: python\n\n    import muffin\n    import muffin_jinja2\n\n    # Create Muffin Application\n    app = muffin.Application('example')\n\n    # Initialize the plugin\n    # As alternative: jinja2 = Jinja2(app, **options)\n    jinja2 = muffin_jinja2.Plugin()\n    jinja2.setup(app, template_folders=['src/templates'])\n\n    # Use it inside your handlers\n    @app.route('/')\n    async def index(request):\n        context = {'var': 42}\n        return await jinja2.render('index.html', **context)\n\n\nOptions\n-------\n\n==================== ==================== ====================\nName                 Default value        Description\n-------------------- -------------------- --------------------\n**auto_reload**      ``False``            Auto reload changed templates\n**cache_size**       ``50``               Cache templates\n**extensions**       ``None``             Enable Jinja2 Extensions (``None | list``)\n**loader**           ``FileSystemLoader`` Template loader\n**encoding**         ``utf-8``            Default encoding for file loader\n**template_folders** ``['templates']``    List of template folders\n==================== ==================== ====================\n\n\nYou are able to provide the options when you are initiliazing the plugin:\n\n.. code-block:: python\n\n    jinja2.init(app, template_folders=['src/templates'], auto_reload=True)\n\n\nOr setup it inside ``Muffin.Application`` config using the `jinja2_` prefix for example:\n\n.. code-block:: python\n\n   JINJA2_AUTO_RELOAD = True\n\n   JINJA2_TEMPLATE_FOLDERS = ['tmpls']\n\n``Muffin.Application`` configuration options are case insensitive\n\n\nTunning\n-------\n\n.. code-block:: python\n\n    # Register custom context processor\n    # could be a function/coroutine\n    @jinja2.add_context\n    def custom_context():\n        return { 'VAR': 'VALUE' }\n\n    # Register a function into global context\n    @jinja2.add_global\n    def sum(a, b):\n        return a + b\n\n    # Register a function with a different name\n    @jinja2.add_global('div')\n    def mod(a, b):\n        return a // b\n\n    # Register a filter\n    @jinja2.add_filter\n    def test(value, a, b=None):\n        return a if value else b\n\n    # Register a filter with a different name\n    @jinja2.add_filter('bool')\n    def boolean(value):\n        return bool(value)\n\n    @app.route('/')\n    async def index(request):\n        \"\"\" Check for user is admin. \"\"\"\n        local_context = {'key': 'value'}\n        return await jinja2.render('index.html', **local_context)\n\n\n.. _bugtracker:\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or\nannoyances please report them to the issue tracker\nat https://github.com/klen/muffin-jinja2/issues\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of Muffin-Jinja2 happens at: https://github.com/klen/muffin-jinja2\n\n\nContributors\n=============\n\n* klen_ (Kirill Klenov)\n\n.. _license:\n\nLicense\n========\n\nLicensed under a `MIT license`_.\n\n.. _links:\n\n\n.. _klen: https://github.com/klen\n.. _Muffin: https://github.com/klen/muffin\n\n.. _MIT license: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fmuffin-jinja2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fmuffin-jinja2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fmuffin-jinja2/lists"}