iflow-mcp_alaturqua-mcp-trino-python 0.7.1__py3-none-any.whl
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.
- iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/METADATA +446 -0
- iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/RECORD +9 -0
- iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/WHEEL +4 -0
- iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/entry_points.txt +2 -0
- iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/licenses/LICENSE +201 -0
- src/__init__.py +0 -0
- src/config.py +39 -0
- src/server.py +617 -0
- src/trino_client.py +596 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp_alaturqua-mcp-trino-python
|
|
3
|
+
Version: 0.7.1
|
|
4
|
+
Summary: A Model Context Protocol (MCP) connector for Trino, enabling seamless integration between MCP-compliant services and Trino query engine
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: connector,data-catalog,iceberg,mcp,trino
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Requires-Dist: loguru>=0.7.3
|
|
17
|
+
Requires-Dist: mcp[cli]>=1.22.0
|
|
18
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
19
|
+
Requires-Dist: trino>=0.336.0
|
|
20
|
+
Provides-Extra: http
|
|
21
|
+
Requires-Dist: starlette>=0.41.0; extra == 'http'
|
|
22
|
+
Requires-Dist: uvicorn>=0.32.0; extra == 'http'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
[](https://mseep.ai/app/alaturqua-mcp-trino-python)
|
|
26
|
+
|
|
27
|
+
# MCP Trino Server
|
|
28
|
+
|
|
29
|
+
[](https://smithery.ai/server/@alaturqua/mcp-trino-python)
|
|
30
|
+
[](https://www.python.org/downloads/)
|
|
31
|
+
[](https://code.visualstudio.com/)
|
|
32
|
+
[](https://github.com/alaturqua/mcp-trino-python/pkgs/container/mcp-trino-python)
|
|
33
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
34
|
+
|
|
35
|
+
The MCP Trino Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
|
|
36
|
+
server that provides seamless integration with Trino and Iceberg, enabling advanced
|
|
37
|
+
data exploration, querying, and table maintenance capabilities through a standard interface.
|
|
38
|
+
|
|
39
|
+
## Use Cases
|
|
40
|
+
|
|
41
|
+
- Interactive data exploration and analysis in Trino
|
|
42
|
+
- Automated Iceberg table maintenance and optimization
|
|
43
|
+
- Building AI-powered tools that interact with Trino databases
|
|
44
|
+
- Executing and managing SQL queries with proper result formatting
|
|
45
|
+
|
|
46
|
+
## Prerequisites
|
|
47
|
+
|
|
48
|
+
1. A running Trino server (or Docker Compose for local development)
|
|
49
|
+
2. Python 3.12 or higher
|
|
50
|
+
3. Docker (optional, for containerized deployment)
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
### 1. Clone the Repository
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/alaturqua/mcp-trino-python.git
|
|
58
|
+
cd mcp-trino-python
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Create Environment File
|
|
62
|
+
|
|
63
|
+
Create a `.env` file in the root directory:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
TRINO_HOST=localhost
|
|
67
|
+
TRINO_PORT=8080
|
|
68
|
+
TRINO_USER=trino
|
|
69
|
+
TRINO_CATALOG=tpch
|
|
70
|
+
TRINO_SCHEMA=tiny
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Run Trino Locally (Optional)
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
docker-compose up -d trino
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This starts a Trino server on `localhost:8080` with sample TPC-H and TPC-DS data.
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
### Installing via Smithery
|
|
84
|
+
|
|
85
|
+
To install MCP Trino Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@alaturqua/mcp-trino-python):
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx -y @smithery/cli install @alaturqua/mcp-trino-python --client claude
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Using uv (Recommended)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
uv sync
|
|
95
|
+
uv run src/server.py
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Using pip
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pip install -e .
|
|
102
|
+
python src/server.py
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Transport Modes
|
|
106
|
+
|
|
107
|
+
The server supports three transport modes:
|
|
108
|
+
|
|
109
|
+
| Transport | Description | Use Case |
|
|
110
|
+
| ----------------- | ---------------------- | ------------------------------------------ |
|
|
111
|
+
| `stdio` | Standard I/O (default) | VS Code, Claude Desktop, local MCP clients |
|
|
112
|
+
| `streamable-http` | HTTP with streaming | Remote access, web clients, Docker |
|
|
113
|
+
| `sse` | Server-Sent Events | Legacy HTTP transport |
|
|
114
|
+
|
|
115
|
+
### Running with Different Transports
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# stdio (default) - for VS Code and Claude Desktop
|
|
119
|
+
python src/server.py
|
|
120
|
+
|
|
121
|
+
# Streamable HTTP - for remote/web access
|
|
122
|
+
python src/server.py --transport streamable-http --host 0.0.0.0 --port 8000
|
|
123
|
+
|
|
124
|
+
# SSE - legacy HTTP transport
|
|
125
|
+
python src/server.py --transport sse --host 0.0.0.0 --port 8000
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Usage with VS Code
|
|
129
|
+
|
|
130
|
+
Add to your VS Code settings (`Ctrl+Shift+P` → `Preferences: Open User Settings (JSON)`):
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcp": {
|
|
135
|
+
"servers": {
|
|
136
|
+
"mcp-trino-python": {
|
|
137
|
+
"command": "uv",
|
|
138
|
+
"args": [
|
|
139
|
+
"run",
|
|
140
|
+
"--with",
|
|
141
|
+
"mcp[cli]",
|
|
142
|
+
"--with",
|
|
143
|
+
"trino",
|
|
144
|
+
"--with",
|
|
145
|
+
"loguru",
|
|
146
|
+
"mcp",
|
|
147
|
+
"run",
|
|
148
|
+
"/path/to/mcp-trino-python/src/server.py"
|
|
149
|
+
],
|
|
150
|
+
"envFile": "/path/to/mcp-trino-python/.env"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Or add to `.vscode/mcp.json` in your workspace (without the `mcp` wrapper key).
|
|
158
|
+
|
|
159
|
+
## Usage with Claude Desktop
|
|
160
|
+
|
|
161
|
+
Add to your Claude Desktop configuration:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"trino": {
|
|
167
|
+
"command": "python",
|
|
168
|
+
"args": ["./src/server.py"],
|
|
169
|
+
"env": {
|
|
170
|
+
"TRINO_HOST": "your-trino-host",
|
|
171
|
+
"TRINO_PORT": "8080",
|
|
172
|
+
"TRINO_USER": "trino"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Docker Usage
|
|
180
|
+
|
|
181
|
+
### Build the Image
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
docker build -t mcp-trino-python .
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Run with stdio (for VS Code)
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
docker run -i --rm \
|
|
191
|
+
-e TRINO_HOST=host.docker.internal \
|
|
192
|
+
-e TRINO_PORT=8080 \
|
|
193
|
+
-e TRINO_USER=trino \
|
|
194
|
+
mcp-trino-python
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Run with Streamable HTTP
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
docker run -p 8000:8000 \
|
|
201
|
+
-e TRINO_HOST=host.docker.internal \
|
|
202
|
+
-e TRINO_PORT=8080 \
|
|
203
|
+
mcp-trino-python \
|
|
204
|
+
--transport streamable-http --host 0.0.0.0 --port 8000
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Docker Compose
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Start Trino + MCP server with Streamable HTTP
|
|
211
|
+
docker-compose up -d
|
|
212
|
+
|
|
213
|
+
# Start with SSE transport
|
|
214
|
+
docker-compose --profile sse up -d
|
|
215
|
+
|
|
216
|
+
# Run stdio for testing
|
|
217
|
+
docker-compose --profile stdio run --rm mcp-trino-stdio
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### VS Code with Docker
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"mcp": {
|
|
225
|
+
"servers": {
|
|
226
|
+
"mcp-trino-python": {
|
|
227
|
+
"command": "docker",
|
|
228
|
+
"args": [
|
|
229
|
+
"run",
|
|
230
|
+
"-i",
|
|
231
|
+
"--rm",
|
|
232
|
+
"--network",
|
|
233
|
+
"mcp-trino-python_trino-network",
|
|
234
|
+
"-e",
|
|
235
|
+
"TRINO_HOST=trino",
|
|
236
|
+
"-e",
|
|
237
|
+
"TRINO_PORT=8080",
|
|
238
|
+
"-e",
|
|
239
|
+
"TRINO_USER=trino",
|
|
240
|
+
"mcp-trino-python"
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Configuration
|
|
249
|
+
|
|
250
|
+
### Environment Variables
|
|
251
|
+
|
|
252
|
+
| Variable | Description | Default |
|
|
253
|
+
| ----------------- | ------------------------ | --------- |
|
|
254
|
+
| TRINO_HOST | Trino server hostname | localhost |
|
|
255
|
+
| TRINO_PORT | Trino server port | 8080 |
|
|
256
|
+
| TRINO_USER | Trino username | trino |
|
|
257
|
+
| TRINO_CATALOG | Default catalog | None |
|
|
258
|
+
| TRINO_SCHEMA | Default schema | None |
|
|
259
|
+
| TRINO_HTTP_SCHEME | HTTP scheme (http/https) | http |
|
|
260
|
+
| TRINO_PASSWORD | Trino password | None |
|
|
261
|
+
|
|
262
|
+
## Tools
|
|
263
|
+
|
|
264
|
+
### Query and Exploration Tools
|
|
265
|
+
|
|
266
|
+
- **show_catalogs**
|
|
267
|
+
|
|
268
|
+
- List all available catalogs
|
|
269
|
+
- No parameters required
|
|
270
|
+
|
|
271
|
+
- **show_schemas**
|
|
272
|
+
|
|
273
|
+
- List all schemas in a catalog
|
|
274
|
+
- Parameters:
|
|
275
|
+
- `catalog`: Catalog name (string, required)
|
|
276
|
+
|
|
277
|
+
- **show_tables**
|
|
278
|
+
|
|
279
|
+
- List all tables in a schema
|
|
280
|
+
- Parameters:
|
|
281
|
+
- `catalog`: Catalog name (string, required)
|
|
282
|
+
- `schema`: Schema name (string, required)
|
|
283
|
+
|
|
284
|
+
- **describe_table**
|
|
285
|
+
|
|
286
|
+
- Show detailed table structure and column information
|
|
287
|
+
- Parameters:
|
|
288
|
+
- `table`: Table name (string, required)
|
|
289
|
+
- `catalog`: Catalog name (string, optional)
|
|
290
|
+
- `schema`: Schema name (string, optional)
|
|
291
|
+
|
|
292
|
+
- **execute_query**
|
|
293
|
+
|
|
294
|
+
- Execute a SQL query and return formatted results
|
|
295
|
+
- Parameters:
|
|
296
|
+
- `query`: SQL query to execute (string, required)
|
|
297
|
+
|
|
298
|
+
- **show_catalog_tree**
|
|
299
|
+
|
|
300
|
+
- Show a hierarchical tree view of catalogs, schemas, and tables
|
|
301
|
+
- Returns a formatted tree structure with visual indicators
|
|
302
|
+
- No parameters required
|
|
303
|
+
|
|
304
|
+
- **show_create_table**
|
|
305
|
+
|
|
306
|
+
- Show the CREATE TABLE statement for a table
|
|
307
|
+
- Parameters:
|
|
308
|
+
- `table`: Table name (string, required)
|
|
309
|
+
- `catalog`: Catalog name (string, optional)
|
|
310
|
+
- `schema`: Schema name (string, optional)
|
|
311
|
+
|
|
312
|
+
- **show_create_view**
|
|
313
|
+
|
|
314
|
+
- Show the CREATE VIEW statement for a view
|
|
315
|
+
- Parameters:
|
|
316
|
+
- `view`: View name (string, required)
|
|
317
|
+
- `catalog`: Catalog name (string, optional)
|
|
318
|
+
- `schema`: Schema name (string, optional)
|
|
319
|
+
|
|
320
|
+
- **show_stats**
|
|
321
|
+
- Show statistics for a table
|
|
322
|
+
- Parameters:
|
|
323
|
+
- `table`: Table name (string, required)
|
|
324
|
+
- `catalog`: Catalog name (string, optional)
|
|
325
|
+
- `schema`: Schema name (string, optional)
|
|
326
|
+
|
|
327
|
+
### Iceberg Table Maintenance
|
|
328
|
+
|
|
329
|
+
- **optimize**
|
|
330
|
+
|
|
331
|
+
- Optimize an Iceberg table by compacting small files
|
|
332
|
+
- Parameters:
|
|
333
|
+
- `table`: Table name (string, required)
|
|
334
|
+
- `catalog`: Catalog name (string, optional)
|
|
335
|
+
- `schema`: Schema name (string, optional)
|
|
336
|
+
|
|
337
|
+
- **optimize_manifests**
|
|
338
|
+
|
|
339
|
+
- Optimize manifest files for an Iceberg table
|
|
340
|
+
- Parameters:
|
|
341
|
+
- `table`: Table name (string, required)
|
|
342
|
+
- `catalog`: Catalog name (string, optional)
|
|
343
|
+
- `schema`: Schema name (string, optional)
|
|
344
|
+
|
|
345
|
+
- **expire_snapshots**
|
|
346
|
+
- Remove old snapshots from an Iceberg table
|
|
347
|
+
- Parameters:
|
|
348
|
+
- `table`: Table name (string, required)
|
|
349
|
+
- `retention_threshold`: Age threshold (e.g., "7d") (string, optional)
|
|
350
|
+
- `catalog`: Catalog name (string, optional)
|
|
351
|
+
- `schema`: Schema name (string, optional)
|
|
352
|
+
|
|
353
|
+
### Iceberg Metadata Inspection
|
|
354
|
+
|
|
355
|
+
- **show_table_properties**
|
|
356
|
+
|
|
357
|
+
- Show Iceberg table properties
|
|
358
|
+
- Parameters:
|
|
359
|
+
- `table`: Table name (string, required)
|
|
360
|
+
- `catalog`: Catalog name (string, optional)
|
|
361
|
+
- `schema`: Schema name (string, optional)
|
|
362
|
+
|
|
363
|
+
- **show_table_history**
|
|
364
|
+
|
|
365
|
+
- Show Iceberg table history/changelog
|
|
366
|
+
- Contains snapshot timing, lineage, and ancestry information
|
|
367
|
+
- Parameters:
|
|
368
|
+
- `table`: Table name (string, required)
|
|
369
|
+
- `catalog`: Catalog name (string, optional)
|
|
370
|
+
- `schema`: Schema name (string, optional)
|
|
371
|
+
|
|
372
|
+
- **show_metadata_log_entries**
|
|
373
|
+
|
|
374
|
+
- Show Iceberg table metadata log entries
|
|
375
|
+
- Contains metadata file locations and sequence information
|
|
376
|
+
- Parameters:
|
|
377
|
+
- `table`: Table name (string, required)
|
|
378
|
+
- `catalog`: Catalog name (string, optional)
|
|
379
|
+
- `schema`: Schema name (string, optional)
|
|
380
|
+
|
|
381
|
+
- **show_snapshots**
|
|
382
|
+
|
|
383
|
+
- Show Iceberg table snapshots
|
|
384
|
+
- Contains snapshot details including operations and manifest files
|
|
385
|
+
- Parameters:
|
|
386
|
+
- `table`: Table name (string, required)
|
|
387
|
+
- `catalog`: Catalog name (string, optional)
|
|
388
|
+
- `schema`: Schema name (string, optional)
|
|
389
|
+
|
|
390
|
+
- **show_manifests**
|
|
391
|
+
|
|
392
|
+
- Show Iceberg table manifests for current or all snapshots
|
|
393
|
+
- Contains manifest file details and data file statistics
|
|
394
|
+
- Parameters:
|
|
395
|
+
- `table`: Table name (string, required)
|
|
396
|
+
- `catalog`: Catalog name (string, optional)
|
|
397
|
+
- `schema`: Schema name (string, optional)
|
|
398
|
+
- `all_snapshots`: Include all snapshots (boolean, optional)
|
|
399
|
+
|
|
400
|
+
- **show_partitions**
|
|
401
|
+
|
|
402
|
+
- Show Iceberg table partitions
|
|
403
|
+
- Contains partition statistics and file counts
|
|
404
|
+
- Parameters:
|
|
405
|
+
- `table`: Table name (string, required)
|
|
406
|
+
- `catalog`: Catalog name (string, optional)
|
|
407
|
+
- `schema`: Schema name (string, optional)
|
|
408
|
+
|
|
409
|
+
- **show_files**
|
|
410
|
+
|
|
411
|
+
- Show Iceberg table data files in current snapshot
|
|
412
|
+
- Contains detailed file metadata and column statistics
|
|
413
|
+
- Parameters:
|
|
414
|
+
- `table`: Table name (string, required)
|
|
415
|
+
- `catalog`: Catalog name (string, optional)
|
|
416
|
+
- `schema`: Schema name (string, optional)
|
|
417
|
+
|
|
418
|
+
- **show_entries**
|
|
419
|
+
|
|
420
|
+
- Show Iceberg table manifest entries for current or all snapshots
|
|
421
|
+
- Contains entry status and detailed file metrics
|
|
422
|
+
- Parameters:
|
|
423
|
+
- `table`: Table name (string, required)
|
|
424
|
+
- `catalog`: Catalog name (string, optional)
|
|
425
|
+
- `schema`: Schema name (string, optional)
|
|
426
|
+
- `all_snapshots`: Include all snapshots (boolean, optional)
|
|
427
|
+
|
|
428
|
+
- **show_refs**
|
|
429
|
+
|
|
430
|
+
- Show Iceberg table references (branches and tags)
|
|
431
|
+
- Contains reference configuration and snapshot mapping
|
|
432
|
+
- Parameters:
|
|
433
|
+
- `table`: Table name (string, required)
|
|
434
|
+
- `catalog`: Catalog name (string, optional)
|
|
435
|
+
- `schema`: Schema name (string, optional)
|
|
436
|
+
|
|
437
|
+
### Query History
|
|
438
|
+
|
|
439
|
+
- **show_query_history**
|
|
440
|
+
- Get the history of executed queries
|
|
441
|
+
- Parameters:
|
|
442
|
+
- `limit`: Maximum number of queries to return (number, optional)
|
|
443
|
+
|
|
444
|
+
## License
|
|
445
|
+
|
|
446
|
+
This project is licensed under the Apache 2.0 License. Please refer to the LICENSE file for the full terms.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
src/config.py,sha256=4AlUk078e_LI7XU_WOHC0eBRNrc15Sb-dx94lgB875Q,1198
|
|
3
|
+
src/server.py,sha256=etQ_mtAUPzw9nbX6HNvnC76w9WIQzit2OHuh30d1ML8,20776
|
|
4
|
+
src/trino_client.py,sha256=SXXI7uMr7J7DivGgI31T-7tZ8GsT1anyA_KBSMUwt1Q,25396
|
|
5
|
+
iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/METADATA,sha256=lgYVcHfwq88h6BD5gn6vfxNQncGiUoiolBkVhzl0cCE,12507
|
|
6
|
+
iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/entry_points.txt,sha256=q6JzFPo1Lq0dLTb8QYnLmGczDTU2HZ_cgZzzTAH8_Aw,69
|
|
8
|
+
iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
9
|
+
iflow_mcp_alaturqua_mcp_trino_python-0.7.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
src/__init__.py
ADDED
|
File without changes
|