asimov-jinja-module 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/AUTHORS +1 -0
- data/CHANGES.md +19 -0
- data/README.md +73 -0
- data/UNLICENSE +24 -0
- data/VERSION +1 -0
- data/bin/asimov-jinja-runner +8 -0
- data/lib/asimov-jinja-module/runner.rb +38 -0
- data/lib/asimov-jinja-module.rb +7 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c18bee9aebc4c33a99881741c4ccd8955046bccfe1fa70406021020e96ffe95a
|
4
|
+
data.tar.gz: 612d289a27e047237c1d4a73663edc1829424ba5f26d74f16bc54e737c6befcd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5cf2f5f85f2e2181a18d4d025f47c0f762d1488c8d0e27b4330843ecec827610213bfda515586edc9f76bcd4fc45fe219656333a54528471ac65b9e1db74e4f5
|
7
|
+
data.tar.gz: 8e8a9fcc0899a44d9a79fc2db4e374881163cd69691bf111264f22e4680574a017a2e892b1b11f011d7b87fe91241714382342e33606d424c0ce40aa7f52c654
|
data/AUTHORS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* Arto Bendiken <arto@asimov.so>
|
data/CHANGES.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## 0.1.2 - 2025-06-07
|
9
|
+
### Changed
|
10
|
+
- Package also for distribution via PyPI
|
11
|
+
|
12
|
+
## 0.1.1 - 2025-05-31
|
13
|
+
### Changed
|
14
|
+
- [CD] Tweet new releases automatically
|
15
|
+
|
16
|
+
## 0.1.0 - 2025-05-29
|
17
|
+
### Added
|
18
|
+
- Render JSON inputs using the MiniJinja templating engine
|
19
|
+
- Load environment variables from `.env` (aka dotenv) files
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# ASIMOV Jinja Module
|
2
|
+
|
3
|
+
[](https://unlicense.org)
|
4
|
+
[](https://crates.io/crates/asimov-jinja-module)
|
5
|
+
[](https://pypi.org/project/asimov-jinja-module)
|
6
|
+
[](https://rubygems.org/gems/asimov-jinja-module)
|
7
|
+
|
8
|
+
[ASIMOV] module for prompt templating using the [Jinja] templating language.
|
9
|
+
|
10
|
+
## ✨ Features
|
11
|
+
|
12
|
+
- Renders JSON inputs using the [MiniJinja] templating engine.
|
13
|
+
- Loads environment variables from `.env` (aka dotenv) files.
|
14
|
+
- Distributed as a standalone static binary with zero runtime dependencies.
|
15
|
+
|
16
|
+
## 🛠️ Prerequisites
|
17
|
+
|
18
|
+
- [Rust] 1.85+ (2024 edition) if building from source code
|
19
|
+
|
20
|
+
## ⬇️ Installation
|
21
|
+
|
22
|
+
### Installation from PyPI
|
23
|
+
|
24
|
+
```bash
|
25
|
+
pip install -U asimov-jinja-module
|
26
|
+
```
|
27
|
+
|
28
|
+
### Installation from RubyGems
|
29
|
+
|
30
|
+
```bash
|
31
|
+
gem install asimov-jinja-module
|
32
|
+
```
|
33
|
+
|
34
|
+
### Installation from Source Code
|
35
|
+
|
36
|
+
```bash
|
37
|
+
cargo install asimov-jinja-module
|
38
|
+
```
|
39
|
+
|
40
|
+
## 👉 Examples
|
41
|
+
|
42
|
+
### Rendering from JSON to Markdown
|
43
|
+
|
44
|
+
```bash
|
45
|
+
asimov-jinja-runner template.j2 < input.json > output.md
|
46
|
+
```
|
47
|
+
|
48
|
+
## 📚 Reference
|
49
|
+
|
50
|
+
### Installed Binaries
|
51
|
+
|
52
|
+
- `asimov-jinja-runner`: renders JSON from standard input to standard output
|
53
|
+
|
54
|
+
## 👨💻 Development
|
55
|
+
|
56
|
+
```bash
|
57
|
+
git clone https://github.com/asimov-modules/asimov-jinja-module.git
|
58
|
+
```
|
59
|
+
|
60
|
+
---
|
61
|
+
|
62
|
+
[](https://x.com/intent/post?url=https://github.com/asimov-modules/asimov-jinja-module&text=asimov-jinja-module)
|
63
|
+
[](https://reddit.com/submit?url=https://github.com/asimov-modules/asimov-jinja-module&title=asimov-jinja-module)
|
64
|
+
[](https://news.ycombinator.com/submitlink?u=https://github.com/asimov-modules/asimov-jinja-module&t=asimov-jinja-module)
|
65
|
+
[](https://www.facebook.com/sharer/sharer.php?u=https://github.com/asimov-modules/asimov-jinja-module)
|
66
|
+
[](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/asimov-modules/asimov-jinja-module)
|
67
|
+
|
68
|
+
[ASIMOV]: https://github.com/asimov-platform
|
69
|
+
[Jinja]: https://en.wikipedia.org/wiki/Jinja_(template_engine)
|
70
|
+
[MiniJinja]: https://crates.io/crates/minijinja
|
71
|
+
[Python]: https://python.org
|
72
|
+
[Ruby]: https://ruby-lang.org
|
73
|
+
[Rust]: https://rust-lang.org
|
data/UNLICENSE
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
2
|
+
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
+
distribute this software, either in source code form or as a compiled
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
+
means.
|
7
|
+
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
+
of this software dedicate any and all copyright interest in the
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
11
|
+
of the public at large and to the detriment of our heirs and
|
12
|
+
successors. We intend this dedication to be an overt act of
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
14
|
+
software under copyright law.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
24
|
+
For more information, please refer to <https://unlicense.org/>
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.2
|
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative "../lib/asimov-jinja-module"
|
3
|
+
argv0 = ::ASIMOV_Jinja_Module::Runner.path or abort("asimov-jinja-runner not found")
|
4
|
+
if ::Gem.win_platform?
|
5
|
+
::Kernel.exit(::Kernel.system(argv0, *ARGV) ? 0 : $?.exitstatus)
|
6
|
+
else
|
7
|
+
::Kernel.exec(argv0, *ARGV)
|
8
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This is free and unencumbered software released into the public domain.
|
2
|
+
|
3
|
+
module ASIMOV_Jinja_Module; end
|
4
|
+
|
5
|
+
class ASIMOV_Jinja_Module::Runner
|
6
|
+
def self.path
|
7
|
+
self.which("asimov-jinja-runner")
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.execute(...)
|
11
|
+
self.new(...).execute
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(*args, env: {})
|
15
|
+
@argv0 = self.class.path.freeze
|
16
|
+
@args = args.map(&:to_s).freeze
|
17
|
+
@env = env.to_h.freeze
|
18
|
+
end
|
19
|
+
|
20
|
+
def execute(*args)
|
21
|
+
::Kernel.system(@env, @argv0, *(@args + args.map(&:to_s))) ? 0 : $?.exitstatus
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
def self.which(command)
|
27
|
+
gem_bindir = ::Gem.bindir
|
28
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
29
|
+
ENV['PATH'].split(::File::PATH_SEPARATOR).each do |dir|
|
30
|
+
next if dir == gem_bindir # avoid infinite recursion
|
31
|
+
exts.each do |ext|
|
32
|
+
exe = ::File.join(dir, "#{command}#{ext}")
|
33
|
+
return exe if ::File.executable?(exe) && !::File.directory?(exe)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
nil # not found
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: asimov-jinja-module
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ASIMOV Protocol
|
8
|
+
bindir: bin
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-06-07 00:00:00.000000000 Z
|
11
|
+
dependencies: []
|
12
|
+
description: ASIMOV module for prompt templating using the Jinja templating language.
|
13
|
+
email: support@asimov.so
|
14
|
+
executables:
|
15
|
+
- asimov-jinja-runner
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- AUTHORS
|
20
|
+
- CHANGES.md
|
21
|
+
- README.md
|
22
|
+
- UNLICENSE
|
23
|
+
- VERSION
|
24
|
+
- bin/asimov-jinja-runner
|
25
|
+
- lib/asimov-jinja-module.rb
|
26
|
+
- lib/asimov-jinja-module/runner.rb
|
27
|
+
homepage: https://github.com/asimov-modules
|
28
|
+
licenses:
|
29
|
+
- Unlicense
|
30
|
+
metadata:
|
31
|
+
homepage_uri: https://github.com/asimov-modules
|
32
|
+
source_code_uri: https://github.com/asimov-modules/asimov-jinja-module
|
33
|
+
changelog_uri: https://github.com/asimov-modules/asimov-jinja-module/blob/master/CHANGES.md
|
34
|
+
bug_tracker_uri: https://github.com/asimov-modules/asimov-jinja-module/issues
|
35
|
+
documentation_uri: https://github.com/asimov-modules/asimov-jinja-module/blob/master/README.md
|
36
|
+
rdoc_options: []
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubygems_version: 3.6.9
|
51
|
+
specification_version: 4
|
52
|
+
summary: ASIMOV module for prompt templating using the Jinja templating language.
|
53
|
+
test_files: []
|