{"id":17560148,"url":"https://github.com/vd2org/j2tools","last_synced_at":"2026-02-13T05:45:09.379Z","repository":{"id":57438093,"uuid":"165316374","full_name":"vd2org/j2tools","owner":"vd2org","description":"Tools for jinja2. YamlLoader, plural, t-function and more.","archived":false,"fork":false,"pushed_at":"2024-02-26T13:10:37.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-26T13:26:18.591Z","etag":null,"topics":["jinja2","python","yaml"],"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/vd2org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-01-11T22:01:50.000Z","updated_at":"2024-02-26T13:10:41.000Z","dependencies_parsed_at":"2025-09-11T17:31:59.145Z","dependency_job_id":"c5abd9c6-53b3-4511-8d77-633f9100ec96","html_url":"https://github.com/vd2org/j2tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vd2org/j2tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vd2org%2Fj2tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vd2org%2Fj2tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vd2org%2Fj2tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vd2org%2Fj2tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vd2org","download_url":"https://codeload.github.com/vd2org/j2tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vd2org%2Fj2tools/sbom","scorecard":{"id":917443,"data":{"date":"2025-08-11","repo":{"name":"github.com/vd2org/j2tools","commit":"ff6f6770d7db2e8d1b69c0775232d3d3adc8c26b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/25 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":"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":"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 '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":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2019-217 / GHSA-462w-v97r-4m45","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","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"],"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-24T21:33:43.177Z","repository_id":57438093,"created_at":"2025-08-24T21:33:43.177Z","updated_at":"2025-08-24T21:33:43.177Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29397174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T04:26:15.637Z","status":"ssl_error","status_checked_at":"2026-02-13T04:16:29.732Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jinja2","python","yaml"],"created_at":"2024-10-21T11:23:53.232Z","updated_at":"2026-02-13T05:45:09.360Z","avatar_url":"https://github.com/vd2org.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED REPOSITORY!\n\nThis repository has been deprecated.\n\nNew versions can be found here: \n\n- **[YamlLoader for jinja2 template framework](https://github.com/vd2org/jinja2yaml)**\n- **[Collection of utils for jinja2](https://github.com/vd2org/jinja2utils)**\n\n\n# j2tools\nUseful tools for jinja2\n\n## Install\n\n```bash\npip install j2tools\n```\n\n## Testing\n\n_coming soon_\n\n## YamlLoader\n\nYamlLoader is a template loader for jinja2 template framework.\nIt loads templates from yaml-files. Useful when you need to\nstore many small templates in one file.\n\n#### Example:\n\n```yaml\n# templates.yaml\nhome:\n  welcome: |\n    Welcome, {{username}}!\n  goodbye: |\n    Goodbye, {{username}}!\n```\n\n```python\n# main.py\nfrom jinja2 import Environment\nfrom j2tools import YamlLoader\n\njinja = Environment(loader=YamlLoader('templates.yaml'))\n\nusername = 'John Doe'\ntemplate1 = jinja.get_template('home/welcome')\nrendered1 = template1.render(username=username)\nprint(rendered1) # Welcome, John Doe!\n\ntemplate2 = jinja.get_template('home/goodbye')\nrendered2 = template2.render(username=username)\nprint(rendered2) # Goodbye, John Doe!\n``` \n\n## t_factory\n\nt_facotory is a small tool which helps prefixed templates easily.\n\nSee examples below.\n\n#### Example:\n\n```yaml\n# templates_en.yaml\nhome:\n  welcome: |\n    Welcome, {{username}}!\n  goodbye: |\n    Goodbye, {{username}}!\n```\n\n```yaml\n# templates_ru.yaml\nhome:\n  welcome: |\n    Привет, {{username}}!\n  goodbye: |\n    Пока, {{username}}!\n```\n\n```python\n# main.py\nfrom jinja2 import Environment, PrefixLoader\nfrom j2tools import YamlLoader\nfrom j2tools import t_factory\n\nloader = PrefixLoader({\n                       'en': YamlLoader('templates_en.yaml'),\n                       'ru': YamlLoader('templates_ru.yaml'),})\n  \njinja = Environment(loader=loader)\nget_t = t_factory(jinja)\n\ndef print_templates(t, username):\n    rendered1 = t('home/welcome', username=username)\n    print(rendered1) \n    \n    rendered2 = t('home/goodbye', username=username)\n    print(rendered2) \n    \nprint_templates(get_t('en'), 'John Doe')\n# Expected output:\n# Welcome, John Doe!\n# Goodbye, John Doe!\n\nprint_templates(get_t('ru'), 'Иван')\n# Expected output:\n# Привет, Иван!\n# Пока, Иван!\n``` \n\n## plural\n\n`plural` is jinja2 filter function for easy text pluralization.\n\n#### Example:\n\n```yaml\n# templates.yaml\ninfo:\n  users: |\n    System have {{users}} active {{users|plural('en','user','users')}}.\n```\n\n```python\n# main.py\nfrom jinja2 import Environment\nfrom j2tools import YamlLoader\nfrom j2tools import plural\n\njinja = Environment(loader=YamlLoader('templates.yaml'))\njinja.filters['plural'] = plural\n\ntemplate1 = jinja.get_template('info/users')\nrendered1 = template1.render(users=1)\nprint(rendered1) # System have 1 active user.\nrendered2 = template1.render(users=23)\nprint(rendered2) # System have 23 active users.\n``` \n\n## elapsed and remaining\n\nCalculates and formats elapsed time to string like this:\n`25d 4h 3m 35s`. Can be used as jinja2 filter.\n\n#### Example:\n\n```yaml\n# templates.yaml\ninfo:\n  uptime: |\n    System uptime: {{started|elapsed(show_seconds=True)}}.\n  newyear: |\n    To next year remaining {{newyear|remaining}}!\n```\n\n```python\n# main.py\nfrom jinja2 import Environment\nfrom j2tools import YamlLoader\nfrom j2tools import elapsed, remaining\nimport datetime\n\njinja = Environment(loader=YamlLoader('templates.yaml'))\njinja.filters['elapsed'] = elapsed\njinja.filters['remaining'] = remaining\n\nstarted = datetime.datetime.now()\nnewyear = datetime.datetime(2020, 1, 1, 0, 0, 0)\n\nusername = 'John Doe'\ntemplate1 = jinja.get_template('info/uptime')\nrendered1 = template1.render(started=started)\nprint(rendered1) # System uptime: 25d 4h 3m 35s.\n\ntemplate2 = jinja.get_template('info/newyear')\nrendered2 = template2.render(newyear=newyear)\nprint(rendered2) # To next year remaining 295d 10h 13m 10s!\n``` \n\n## uchar\n\nSimple jinja2 function to insert unicode characters\nby unicode names. Very useful for inserting emoji.\n\n#### Example:\n\n```yaml\n# templates.yaml\nhome:\n  welcome: |\n    Welcome, {{username}} {{UN('THUMBS UP SIGN')}}!\n```\n\n```python\n# main.py\nfrom jinja2 import Environment\nfrom j2tools import YamlLoader\nfrom j2tools import uchar\n\njinja = Environment(loader=YamlLoader('templates.yaml'))\njinja.globals['UN'] = uchar\n\ntemplate1 = jinja.get_template('info/users')\nrendered1 = template1.render(username='John Doe')\nprint(rendered1) # Welcome, John Doe 👍!\n``` \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvd2org%2Fj2tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvd2org%2Fj2tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvd2org%2Fj2tools/lists"}