{"id":30855762,"url":"https://github.com/podhmo/kamidana","last_synced_at":"2025-09-07T11:10:28.499Z","repository":{"id":62573692,"uuid":"91157233","full_name":"podhmo/kamidana","owner":"podhmo","description":"神棚(kamidana)  is command line jinja2 template","archived":false,"fork":false,"pushed_at":"2024-03-05T09:54:11.000Z","size":119,"stargazers_count":11,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T21:40:56.169Z","etag":null,"topics":["cli","jinja2"],"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/podhmo.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-13T07:28:21.000Z","updated_at":"2024-06-05T02:48:47.000Z","dependencies_parsed_at":"2022-11-03T20:07:39.090Z","dependency_job_id":null,"html_url":"https://github.com/podhmo/kamidana","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/podhmo/kamidana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podhmo%2Fkamidana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podhmo%2Fkamidana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podhmo%2Fkamidana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podhmo%2Fkamidana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/podhmo","download_url":"https://codeload.github.com/podhmo/kamidana/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podhmo%2Fkamidana/sbom","scorecard":{"id":739462,"data":{"date":"2025-08-11","repo":{"name":"github.com/podhmo/kamidana","commit":"ed4ac0e521dc8d3e1d57ee3bb6346d9d6e782cce"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.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":"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":"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":"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":"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/python-package.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/podhmo/kamidana/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/podhmo/kamidana/python-package.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:31","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T17:00:21.893Z","repository_id":62573692,"created_at":"2025-08-22T17:00:21.893Z","updated_at":"2025-08-22T17:00:21.893Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274026718,"owners_count":25209740,"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":["cli","jinja2"],"created_at":"2025-09-07T11:10:11.821Z","updated_at":"2025-09-07T11:10:28.491Z","avatar_url":"https://github.com/podhmo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"kamidana\n========================================\n\nkamidana is yet another jinja2's cli wrapper.\n\nfeatures\n\n- using jinja2 file as template file (basic feature)\n- various input formats support (json, yaml, toml, ...)\n- the way of lookup template is changed, relative to parent template path\n- gentle error message\n- batch execution for speed-up (via `kamidana-batch`)\n- rendering with individual filters (via `--additionals` option)\n- (useful additionals modules (e.g. `kamidana.additionals.naming` ...)\n\nusage\n----------------------------------------\n\n.. code-block:: console\n\n  usage: kamidana [-h] [--driver DRIVER] [--loader LOADER] [-d DATA]\n                  [--logging {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}] [-a ADDITIONALS] [-e EXTENSION]\n                  [-i {yaml,json,toml,csv,tsv,raw,env,md,markdown,spreadsheet}] [-o OUTPUT_FORMAT] [--dump-context]\n                  [--list-info] [--debug] [--quiet] [--dst DST]\n                  [template]\n\n  positional arguments:\n    template\n\n  options:\n    -h, --help            show this help message and exit\n    --driver DRIVER       default: kamidana.driver:Driver\n    --loader LOADER       default: kamidana.loader:TemplateLoader\n    -d DATA, --data DATA  support yaml, json, toml\n    --logging {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}\n    -a ADDITIONALS, --additionals ADDITIONALS\n    -e EXTENSION, --extension EXTENSION\n    -i {yaml,json,toml,csv,tsv,raw,env,md,markdown,spreadsheet}, --input-format {yaml,json,toml,csv,tsv,raw,env,md,markdown,spreadsheet}\n    -o OUTPUT_FORMAT, --output-format OUTPUT_FORMAT\n    --dump-context        dumping loading data (used by jinja2 template)\n    --list-info           listting information (for available extensions and additional modules)\n    --debug\n    --quiet\n    --dst DST\n\n\nexamples\n----------------------------------------\n\nexample (basic)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: console\n\n\n  $ kamidana examples/readme/src/00/nginx.jinja2 --data examples/readme/src/00/data.json\n  server {\n    listen 80;\n    server_name localhost;\n\n    root /var/www/project;\n    index index.htm;\n\n    access_log /var/log/nginx/http.access.log combined;\n    error_log  /var/log/nginx/http.error.log;\n  }\n\n\n\n\nexamples/readme/src/00/nginx.jinja2\n\n.. code-block::\n\n  server {\n    listen 80;\n    server_name {{ nginx.hostname }};\n\n    root {{ nginx.webroot }};\n    index index.htm;\n\n    access_log {{ nginx.logdir }}/http.access.log combined;\n    error_log  {{ nginx.logdir }}/http.error.log;\n  }\n\n\n\n\nexamples/readme/src/00/data.json\n\n.. code-block:: json\n\n  {\n    \"nginx\": {\n      \"hostname\": \"localhost\",\n      \"webroot\": \"/var/www/project\",\n      \"logdir\": \"/var/log/nginx\"\n    }\n  }\n\n\n\nMore over, passing data with stdin. (please doen't forget to add `--input-format` option)\n\n.. code-block:: console\n\n\n  $ echo '{\"nginx\": {\"logdir\": \"/tmp/logs/nginx\"}}' | kamidana --input-format json examples/readme/src/00/nginx.jinja2 --data examples/readme/src/00/data.json\n  server {\n    listen 80;\n    server_name localhost;\n\n    root /var/www/project;\n    index index.htm;\n\n    access_log /tmp/logs/nginx/http.access.log combined;\n    error_log  /tmp/logs/nginx/http.error.log;\n  }\n\n\n\ngentle error message\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nif using include, but the included template is not found.\n\n.. code-block:: console\n\n\n  $ tree examples/readme/src/11\n  examples/readme/src/11\n  ├── header.html.j2\n  └── main.html.j2\n\n  1 directory, 2 files\n\n\n\n.. code-block:: console\n\n\n  $ kamidana examples/readme/src/11/main.html.j2\n  ------------------------------------------------------------\n  exception: kamidana._path.XTemplatePathNotFound\n  message: [Errno 2] No such file or directory: 'footer-404.html.j2'\n  where: examples/readme/src/11/main.html.j2\n  ------------------------------------------------------------\n  examples/readme/src/11/main.html.j2:\n        2: \u003cmain\u003e\n        3:   this is main contents\n        4: \u003c/main\u003e\n    -\u003e  5: {% include \"footer-404.html.j2\" %}\n\n  Traceback:\n    File \"SITE-PACKAGES/jinja2/loaders.py\", line 462, in get_source\n      rv = self.load_func(template)\n    File \"HERE/me/kamidana/kamidana/loader.py\", line 27, in load\n      raise XTemplatePathNotFound(filename, exc=e).with_traceback(e.__traceback__)\n    File \"HERE/me/kamidana/kamidana/loader.py\", line 23, in load\n      with open(filename) as rf:\n\n\n\nexample2 (--additionals)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nbuiltin addtional modules\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: console\n\n\n  $ kamidana --additionals=kamidana.additionals.naming examples/readme/src/01/use-naming.jinja2\n  singular, plurals\n\n  - days|singularize -\u003e day\n  - day|pluralize -\u003e days\n\n  - people|singularize -\u003e person\n  - person|pluralize -\u003e people\n\n  to {snake_case, kebab-case, camelCase}\n\n  - fooBarBoo|snakecase -\u003e foo_bar_boo\n  - fooBarBoo|kebabcase -\u003e foo-bar-boo\n  - foo_bar_boo|camelcase -\u003e fooBarBoo\n\n\n  more information: see kamidana.additionals.naming module\n\n\n\n\n\nexamples/readme/src/01/use-naming.jinja2\n\n.. code-block::\n\n  singular, plurals\n\n  - days|singularize -\u003e {{\"days\"|singularize}}\n  - day|pluralize -\u003e {{\"day\"|pluralize}}\n\n  - people|singularize -\u003e {{\"people\"|singularize}}\n  - person|pluralize -\u003e {{\"person\"|pluralize}}\n\n  to {snake_case, kebab-case, camelCase}\n\n  - fooBarBoo|snakecase -\u003e {{\"fooBarBoo\"|snakecase}}\n  - fooBarBoo|kebabcase -\u003e {{\"fooBarBoo\"|kebabcase}}\n  - foo_bar_boo|camelcase -\u003e {{\"foo_bar_boo\"|camelcase}}\n\n\n  more information: see kamidana.additionals.naming module\n\n\n\nor `kamidana -a naming` is also OK (shortcut).\n\nindividual additional modules\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: console\n\n\n  $ kamidana --additionals=examples/readme/src/01/additionals.py --data=examples/readme/src/01/data.yaml examples/readme/src/01/hello.jinja2\n  \n    bye, world!!\n\n\n\n\nexamples/readme/src/01/hello.jinja2\n\n.. code-block::\n\n  {% if 19 is night %}\n    {{night}}, {{name|surprised}}\n  {% else %}\n    {{daytime}}, {{name|surprised}}\n  {% endif %}\n\n\n\n\nexamples/readme/src/01/additionals.py\n\n.. code-block:: python\n\n  from kamidana import (\n      as_filter,\n      as_globals_generator,\n      as_test,\n  )\n\n\n  @as_filter\n  def surprised(v):\n      return \"{}!!\".format(v)\n\n\n  @as_globals_generator\n  def generate_globals():\n      return {\"daytime\": \"hello\", \"night\": \"bye\"}\n\n\n  @as_test\n  def night(hour):\n      return 19 \u003c= hour or hour \u003c 3\n\n\n\n\nexamples/readme/src/01/data.yaml\n\n.. code-block:: yaml\n\n  name: world\n\n\n\n\nexample3 (using jinja2 extensions)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: console\n\n\n  $ kamidana -e do -e loopcontrols examples/readme/src/02/use-extension.jinja2\n  \n  hello\n    world\n  hello\n\n  ## counting\n  - 1\n  - 2\n  - 4\n\n  ## do\n  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n\n\n\nexamples/readme/src/02/use-extension.jinja2\n\n.. code-block::\n\n  {# with with. with_ extension is used. #}\n  {%- with msg = \"hello\"%}\n  {{msg}}\n  {%- with msg = \"world\"%}\n    {{msg}}\n  {%- endwith %}\n  {{msg}}\n  {%- endwith %}\n\n  ## counting\n  {#- with break and continue. loopcontrolls extension is used. #}\n\n  {%- for i in range(10) %}\n  {%- if i % 3 == 0 %}{% continue %} {% endif %}\n  {%- if i == 5 %}{% break %} {% endif %}\n  - {{i}}\n  {%- endfor %}\n\n  ## do\n\n  {%- set xs = [] %}\n  {%- for i in range(10) %}\n  {%- do xs.append(i) %}\n  {%- endfor %}\n  {{xs}}\n\n\n\n\nexample4 (batch execution)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTODO. `see this \u003c./examples/batch\u003e`_\n\n\ndebugging\n----------------------------------------\n\n- `--dump-context`\n- `--debug`\n\ndump context\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: console\n\n\n  $ kamidana --dump-context --data=examples/readme/src/10/data.yaml\n  {\n    \"name\": \"foo\",\n    \"age\": 20,\n    \"friends\": [\n      \"bar\",\n      \"boo\"\n    ],\n    \"template_filename\": null\n  }\n\n\nand be able to merge two files.\n\n.. code-block:: console\n\n\n  $ kamidana --dump-context --data=examples/readme/src/10/data.yaml --data=examples/readme/src/10/data2.yaml\n  {\n    \"name\": \"foo\",\n    \"age\": 21,\n    \"friends\": [\n      \"bar\",\n      \"baz\"\n    ],\n    \"template_filename\": null\n  }\n\n\nthen\n\n\nexamples/readme/src/10/data.yaml\n\n.. code-block:: yaml\n\n  name: foo\n  age: 20\n  friends:\n    - bar\n    - boo\n\n\n\n\nexamples/readme/src/10/data2.yaml\n\n.. code-block:: yaml\n\n  age: 21\n  friends:\n    - bar\n    - baz\n\n\n\navailable info (extensions and additional modules)\n--------------------------------------------------------------------------------\n\n.. code-block::\n\n  $ kamidana --list-info\n  extensions are used by `-e`, additional modules are used by `-a`.\n  {\n    \"extensions\": {\n      \"jinja2.ext.i18n\": \"This extension adds gettext support to Jinja.\",\n      \"jinja2.ext.do\": \"Adds a `do` tag to Jinja that works like the print statement just\",\n      \"jinja2.ext.loopcontrols\": \"Adds break and continue to the template engine.\",\n      \"jinja2.ext.debug\": \"A ``{% debug %}`` tag that dumps the available variables,\",\n      \"kamidana.extensions.NamingModuleExtension\": \"extension create from kamidana.additionals.naming\",\n      \"kamidana.extensions.ReaderModuleExtension\": \"extension create from kamidana.additionals.reader\",\n      \"kamidana.extensions.CookiecutterAdditionalModulesExtension\": \"activate additional modules, see context['cookiecutter']['_additional_modules'], created from your cookiecutter.json\"\n    },\n    \"additional_modules\": {\n      \"kamidana.additionals.env\": \"accessing environemt variable, via env()\",\n      \"kamidana.additionals.naming\": \"Naming helpers (e.g. snakecase, kebabcase, ... pluralize, singularize)\",\n      \"kamidana.additionals.reader\": \"Reading from other resources (e.g. read_from_file, read_from_command)\"\n    }\n  }\n\n\n\nwith other packages\n--------------------------------------------------------------------------------\n\n- use kamidana's additional modules with `cookiecutter \u003chttps://pypi.org/project/cookiecutter/\u003e`_ . (see `examples/extensions/src/02with-cookiecutter \u003chttps://github.com/podhmo/kamidana/blob/master/examples/extensions/src/02with-cookiecutter\u003e`_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodhmo%2Fkamidana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpodhmo%2Fkamidana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodhmo%2Fkamidana/lists"}