lam-cli 0.0.7__tar.gz → 0.1.0__tar.gz

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.
lam_cli-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.2
2
+ Name: lam-cli
3
+ Version: 0.1.0
4
+ Summary: Secure data transformation tool supporting JQ and JavaScript (Bun)
5
+ Home-page: https://github.com/laminar-run/lam
6
+ Author: Laminar Run, Inc.
7
+ Author-email: connect@laminar.run
8
+ License: GPLv3
9
+ Project-URL: Documentation, https://docs.laminar.run
10
+ Project-URL: Source, https://github.com/laminar-run/lam
11
+ Project-URL: Issue Tracker, https://github.com/laminar-run/lam/issues
12
+ Keywords: laminar,api,integration,transformation,json,jq,javascript,bun
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
24
+ Classifier: Topic :: Software Development :: Build Tools
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: backoff>=2.2.1
29
+ Requires-Dist: certifi>=2024.12.14
30
+ Requires-Dist: charset-normalizer>=3.3.2
31
+ Requires-Dist: click>=8.1.7
32
+ Requires-Dist: idna>=3.7
33
+ Requires-Dist: logtail-python>=0.2.2
34
+ Requires-Dist: monotonic>=1.6
35
+ Requires-Dist: msgpack>=1.0.8
36
+ Requires-Dist: posthog>=3.4.0
37
+ Requires-Dist: psutil>=5.9.0
38
+ Requires-Dist: python-dateutil>=2.8.2
39
+ Requires-Dist: requests>=2.32.3
40
+ Requires-Dist: six>=1.16.0
41
+ Requires-Dist: urllib3>=2.2.2
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: keywords
49
+ Dynamic: license
50
+ Dynamic: project-url
51
+ Dynamic: requires-dist
52
+ Dynamic: requires-python
53
+ Dynamic: summary
54
+
55
+ # lam
56
+ Lam is a data transformation tool for Laminar that supports both `jq` and JavaScript transformations using Bun.
57
+
58
+ ## Quickstart
59
+ Install the dependencies:
60
+ ```bash
61
+ # For JQ support
62
+ brew install jq # or sudo apt-get install jq
63
+
64
+ # For JavaScript support
65
+ curl -fsSL https://bun.sh/install | bash
66
+
67
+ make setup
68
+ ```
69
+
70
+ Run the CLI tool:
71
+ ```bash
72
+ make cli ARGS="run <program> <input> [--language jq|js]"
73
+ ```
74
+
75
+ ## Features
76
+ - JQ transformations (default)
77
+ - JavaScript transformations with Bun runtime
78
+ - Built-in utilities (lodash, date-fns)
79
+ - Resource monitoring and limits
80
+ - Detailed execution statistics
81
+ - Secure execution environment
82
+
83
+ ## Examples
84
+
85
+ ### JQ Transform
86
+ ```bash
87
+ make cli ARGS="run examples/transform.jq data.json"
88
+ ```
89
+
90
+ ### JavaScript Transform
91
+ ```bash
92
+ make cli ARGS="run examples/transform.js data.json --language js"
93
+ ```
94
+
95
+ Example JavaScript transform:
96
+ ```javascript
97
+ (input) => {
98
+ // Lodash available as _
99
+ return _.map(input.data, item => ({
100
+ value: item.value * 2
101
+ }));
102
+ }
103
+ ```
104
+
105
+ ## Installation
106
+
107
+ ### Docker Installation
108
+ ```dockerfile
109
+ # Install lam-cli
110
+ RUN pip3 install git+https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/user/project.git@{version}
111
+
112
+ # Install dependencies
113
+ RUN apt-get update && apt-get install -y jq
114
+ RUN curl -fsSL https://bun.sh/install | bash
115
+ ```
116
+
117
+ ### Manual Setup
118
+ Create a virtual environment and install dependencies:
119
+ ```bash
120
+ python3 -m venv ./venv
121
+ source ./venv/bin/activate
122
+ pip install -r requirements.txt
123
+ ```
124
+
125
+ ## Usage
126
+ ```bash
127
+ # Basic usage
128
+ python3 ./lam/lam.py run <program> <input>
129
+
130
+ # With JavaScript
131
+ python3 ./lam/lam.py run script.js data.json --language js
132
+
133
+ # Full options
134
+ python3 ./lam/lam.py run <program> <input> \
135
+ --language [jq|js] \
136
+ --workspace_id <id> \
137
+ --flow_id <id> \
138
+ --execution_id <id> \
139
+ [--as-json]
140
+ ```
141
+
142
+ ## Resource Limits
143
+ - Maximum input size: 10MB
144
+ - Execution timeout: 5 seconds
145
+ - Memory limits enabled
146
+ - Disk space monitoring
147
+
148
+ ## Security
149
+ - Sandboxed JavaScript execution
150
+ - Network access disabled
151
+ - Limited global scope
152
+ - Resource monitoring
153
+ - Secure dependency management
154
+
155
+ ## Logging and Monitoring
156
+ - Execution statistics (duration, memory usage)
157
+ - Detailed error tracking
158
+ - PostHog analytics integration
159
+ - Log file generation
160
+
161
+ ## Development
162
+ ```bash
163
+ # Run all tests
164
+ make test
165
+
166
+ # Run specific test suite
167
+ make test-jq
168
+ make test-js
169
+ make test-js-edge-cases
170
+
171
+ # Run single test
172
+ make test-single TEST=test/js/example.js DATA=test/data/input.json
173
+ ```
174
+
175
+ ## Releases
176
+ Update version in `setup.py`:
177
+ ```python
178
+ setup(
179
+ name="lam-cli",
180
+ version="0.0.<x>",
181
+ ...
182
+ )
183
+ ```
184
+
185
+ Create and push tag:
186
+ ```bash
187
+ git tag v<version>-<increment>
188
+ git push origin v<version>-<increment>
189
+ ```
190
+
191
+ ## Dependencies
192
+ Update dependencies:
193
+ ```bash
194
+ pip3 install <package>
195
+ pip3 freeze > requirements.txt
196
+ ```
@@ -0,0 +1,142 @@
1
+ # lam
2
+ Lam is a data transformation tool for Laminar that supports both `jq` and JavaScript transformations using Bun.
3
+
4
+ ## Quickstart
5
+ Install the dependencies:
6
+ ```bash
7
+ # For JQ support
8
+ brew install jq # or sudo apt-get install jq
9
+
10
+ # For JavaScript support
11
+ curl -fsSL https://bun.sh/install | bash
12
+
13
+ make setup
14
+ ```
15
+
16
+ Run the CLI tool:
17
+ ```bash
18
+ make cli ARGS="run <program> <input> [--language jq|js]"
19
+ ```
20
+
21
+ ## Features
22
+ - JQ transformations (default)
23
+ - JavaScript transformations with Bun runtime
24
+ - Built-in utilities (lodash, date-fns)
25
+ - Resource monitoring and limits
26
+ - Detailed execution statistics
27
+ - Secure execution environment
28
+
29
+ ## Examples
30
+
31
+ ### JQ Transform
32
+ ```bash
33
+ make cli ARGS="run examples/transform.jq data.json"
34
+ ```
35
+
36
+ ### JavaScript Transform
37
+ ```bash
38
+ make cli ARGS="run examples/transform.js data.json --language js"
39
+ ```
40
+
41
+ Example JavaScript transform:
42
+ ```javascript
43
+ (input) => {
44
+ // Lodash available as _
45
+ return _.map(input.data, item => ({
46
+ value: item.value * 2
47
+ }));
48
+ }
49
+ ```
50
+
51
+ ## Installation
52
+
53
+ ### Docker Installation
54
+ ```dockerfile
55
+ # Install lam-cli
56
+ RUN pip3 install git+https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/user/project.git@{version}
57
+
58
+ # Install dependencies
59
+ RUN apt-get update && apt-get install -y jq
60
+ RUN curl -fsSL https://bun.sh/install | bash
61
+ ```
62
+
63
+ ### Manual Setup
64
+ Create a virtual environment and install dependencies:
65
+ ```bash
66
+ python3 -m venv ./venv
67
+ source ./venv/bin/activate
68
+ pip install -r requirements.txt
69
+ ```
70
+
71
+ ## Usage
72
+ ```bash
73
+ # Basic usage
74
+ python3 ./lam/lam.py run <program> <input>
75
+
76
+ # With JavaScript
77
+ python3 ./lam/lam.py run script.js data.json --language js
78
+
79
+ # Full options
80
+ python3 ./lam/lam.py run <program> <input> \
81
+ --language [jq|js] \
82
+ --workspace_id <id> \
83
+ --flow_id <id> \
84
+ --execution_id <id> \
85
+ [--as-json]
86
+ ```
87
+
88
+ ## Resource Limits
89
+ - Maximum input size: 10MB
90
+ - Execution timeout: 5 seconds
91
+ - Memory limits enabled
92
+ - Disk space monitoring
93
+
94
+ ## Security
95
+ - Sandboxed JavaScript execution
96
+ - Network access disabled
97
+ - Limited global scope
98
+ - Resource monitoring
99
+ - Secure dependency management
100
+
101
+ ## Logging and Monitoring
102
+ - Execution statistics (duration, memory usage)
103
+ - Detailed error tracking
104
+ - PostHog analytics integration
105
+ - Log file generation
106
+
107
+ ## Development
108
+ ```bash
109
+ # Run all tests
110
+ make test
111
+
112
+ # Run specific test suite
113
+ make test-jq
114
+ make test-js
115
+ make test-js-edge-cases
116
+
117
+ # Run single test
118
+ make test-single TEST=test/js/example.js DATA=test/data/input.json
119
+ ```
120
+
121
+ ## Releases
122
+ Update version in `setup.py`:
123
+ ```python
124
+ setup(
125
+ name="lam-cli",
126
+ version="0.0.<x>",
127
+ ...
128
+ )
129
+ ```
130
+
131
+ Create and push tag:
132
+ ```bash
133
+ git tag v<version>-<increment>
134
+ git push origin v<version>-<increment>
135
+ ```
136
+
137
+ ## Dependencies
138
+ Update dependencies:
139
+ ```bash
140
+ pip3 install <package>
141
+ pip3 freeze > requirements.txt
142
+ ```