small-python 0.1.0__py3-none-macosx_11_0_arm64.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.
@@ -0,0 +1,71 @@
1
+ from collections.abc import Callable, Iterator
2
+ from os import PathLike
3
+ from typing import Any
4
+
5
+ WORKER: str
6
+
7
+ class Error(Exception):
8
+ def __init__(self, type: str | None = None, message: str | None = None, exception: Object | None = None) -> None: ...
9
+ type: str | None
10
+ message: str | None
11
+ exception: Object | None
12
+ filename: str | None
13
+ lineno: int | None
14
+
15
+ class WorkerError(RuntimeError):
16
+ returncode: int | None
17
+ def __init__(self, message: str, returncode: int | None = None) -> None: ...
18
+
19
+ class Timeout(WorkerError, TimeoutError): ...
20
+
21
+ class Runtime:
22
+ version: str
23
+ def __init__(
24
+ self,
25
+ *,
26
+ std: bool = True,
27
+ step_limit: int = 0,
28
+ memory_limit: int = 0,
29
+ timeout: float | None = None,
30
+ output: Callable[[str], object] | None = None,
31
+ loader: Callable[[str], str | None] | None = None,
32
+ message_limit: int = 67108864,
33
+ ) -> None: ...
34
+ @property
35
+ def closed(self) -> bool: ...
36
+ def eval(self, source: str, filename: str = "<string>") -> Any: ...
37
+ def exec(self, source: str, filename: str = "<string>") -> None: ...
38
+ def call(self, function: str | Object | Callable[..., Any], /, *args: Any, **kwargs: Any) -> Any: ...
39
+ def define(self, name: str, function: Callable[..., Any]) -> Callable[..., Any]: ...
40
+ def function(self, func: Callable[..., Any] | None = None, *, name: str | None = None) -> Any: ...
41
+ def register_module(
42
+ self, name: str, members: dict[str, Any] | None = None, source: str | None = None
43
+ ) -> None: ...
44
+ def mount(self, directory: str | bytes | PathLike[str] | PathLike[bytes], path: str | None = None,
45
+ *, read_only: bool = False) -> None: ...
46
+ def collect(self) -> int: ...
47
+ def close(self) -> None: ...
48
+ def __enter__(self) -> Runtime: ...
49
+ def __exit__(self, *exc: object) -> None: ...
50
+ def __getitem__(self, name: str) -> Any: ...
51
+ def __setitem__(self, name: str, value: Any) -> None: ...
52
+ def __delitem__(self, name: str) -> None: ...
53
+
54
+ class Object:
55
+ def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
56
+ def __getattr__(self, name: str) -> Any: ...
57
+ def __setattr__(self, name: str, value: Any) -> None: ...
58
+ def __getitem__(self, key: Any) -> Any: ...
59
+ def __setitem__(self, key: Any, value: Any) -> None: ...
60
+ def __len__(self) -> int: ...
61
+ def __contains__(self, item: Any) -> bool: ...
62
+ def __iter__(self) -> Iterator[Any]: ...
63
+ def __next__(self) -> Any: ...
64
+ def __bool__(self) -> bool: ...
65
+ def __hash__(self) -> int: ...
66
+ def __eq__(self, other: object) -> Any: ...
67
+ def __ne__(self, other: object) -> Any: ...
68
+ def __lt__(self, other: Any) -> Any: ...
69
+ def __le__(self, other: Any) -> Any: ...
70
+ def __gt__(self, other: Any) -> Any: ...
71
+ def __ge__(self, other: Any) -> Any: ...
small_python/_wire.py ADDED
@@ -0,0 +1,178 @@
1
+ """Values and messages of the worker protocol (docs/packaging/protocol.md).
2
+
3
+ Encoding trusts the parent's values; decoding trusts nothing and raises
4
+ Violation for any message that breaks the protocol.
5
+ """
6
+ import struct
7
+
8
+ MAX_DEPTH = 200
9
+
10
+ INIT, EVAL, EXEC, CALL, GET, SET, DELETE, MODULE, MOUNT, COLLECT, OP, RELEASE = range(0x01, 0x0D)
11
+ HOST, LOAD, OUTPUT = 0x21, 0x22, 0x23
12
+ RESULT, RAISE = 0x40, 0x41
13
+
14
+ _I64 = struct.Struct("<q")
15
+ _U32 = struct.Struct("<I")
16
+ _U64 = struct.Struct("<Q")
17
+ _F64 = struct.Struct("<d")
18
+ _C128 = struct.Struct("<dd")
19
+
20
+
21
+ class Violation(Exception):
22
+ """The worker sent something the protocol does not allow."""
23
+
24
+
25
+ def message(kind, fields, reference):
26
+ """A framed message. reference(value) encodes any value that is not plain
27
+ data as 'h' or 'p', or raises TypeError."""
28
+ out = bytearray(4)
29
+ out.append(kind)
30
+ for field in fields:
31
+ _encode(out, field, reference, 0)
32
+ _U32.pack_into(out, 0, len(out) - 4)
33
+ return out
34
+
35
+
36
+ def _encode(out, value, reference, depth):
37
+ # type() rather than isinstance(), which would ask a proxy for __class__.
38
+ if depth > MAX_DEPTH:
39
+ raise RecursionError("value is too deeply nested to convert")
40
+ cls = type(value)
41
+ if value is None:
42
+ out += b"N"
43
+ elif cls is bool:
44
+ out += b"T" if value else b"F"
45
+ elif issubclass(cls, int):
46
+ value = int(value)
47
+ if -(1 << 63) <= value < 1 << 63:
48
+ out += b"i" + _I64.pack(value)
49
+ else:
50
+ _text(out, b"I", hex(value).encode("ascii"))
51
+ elif issubclass(cls, float):
52
+ out += b"f" + _F64.pack(value)
53
+ elif issubclass(cls, complex):
54
+ out += b"c" + _C128.pack(value.real, value.imag)
55
+ elif issubclass(cls, str):
56
+ _text(out, b"s", str.encode(value, "utf-8", "surrogatepass"))
57
+ elif issubclass(cls, (bytes, bytearray)):
58
+ _text(out, b"B" if issubclass(cls, bytearray) else b"b", value)
59
+ elif issubclass(cls, dict):
60
+ out += b"d" + _U32.pack(len(value))
61
+ for key, item in dict.items(value):
62
+ _encode(out, key, reference, depth + 1)
63
+ _encode(out, item, reference, depth + 1)
64
+ elif issubclass(cls, (list, tuple, set, frozenset)):
65
+ tag = b"l" if issubclass(cls, list) else b"t" if issubclass(cls, tuple) else \
66
+ b"z" if issubclass(cls, frozenset) else b"S"
67
+ out += tag + _U32.pack(len(value))
68
+ for item in value:
69
+ _encode(out, item, reference, depth + 1)
70
+ else:
71
+ out += reference(value)
72
+
73
+
74
+ def _text(out, tag, data):
75
+ out += tag + _U32.pack(len(data))
76
+ out += data
77
+
78
+
79
+ def handle(id):
80
+ return b"h" + _U64.pack(id)
81
+
82
+
83
+ def function(id, name):
84
+ data = name.encode("utf-8", "surrogatepass")
85
+ return b"p" + _U64.pack(id) + b"s" + _U32.pack(len(data)) + data
86
+
87
+
88
+ class Reader:
89
+ """Decodes one message's values. obtain(id) turns a handle id into the
90
+ parent's object for it. A value that decodes but cannot be built (an
91
+ unhashable key) does not stop decoding: the rest is read so every handle
92
+ is obtained, and the first such error is raised by finish()."""
93
+
94
+ def __init__(self, data, obtain):
95
+ self.data = memoryview(data)
96
+ self.at = 1
97
+ self.obtain = obtain
98
+ self.error = None
99
+
100
+ def take(self, n):
101
+ at = self.at
102
+ if n > len(self.data) - at:
103
+ raise Violation("truncated message")
104
+ self.at = at + n
105
+ return self.data[at:at + n]
106
+
107
+ def count(self, minimum):
108
+ n = _U32.unpack(self.take(4))[0]
109
+ if n * minimum > len(self.data) - self.at:
110
+ raise Violation("count exceeds the message")
111
+ return n
112
+
113
+ def value(self, depth=0):
114
+ if depth > MAX_DEPTH:
115
+ raise Violation("value nested too deeply")
116
+ tag = self.take(1)[0]
117
+ if tag == 0x4E: # N
118
+ return None
119
+ if tag == 0x46 or tag == 0x54: # F T
120
+ return tag == 0x54
121
+ if tag == 0x69: # i
122
+ return _I64.unpack(self.take(8))[0]
123
+ if tag == 0x49: # I
124
+ return self._big()
125
+ if tag == 0x66: # f
126
+ return _F64.unpack(self.take(8))[0]
127
+ if tag == 0x63: # c
128
+ return complex(*_C128.unpack(self.take(16)))
129
+ if tag == 0x73: # s
130
+ try:
131
+ return str(self.take(self.count(1)), "utf-8", "surrogatepass")
132
+ except UnicodeDecodeError:
133
+ raise Violation("invalid UTF-8") from None
134
+ if tag == 0x62: # b
135
+ return bytes(self.take(self.count(1)))
136
+ if tag == 0x42: # B
137
+ return bytearray(self.take(self.count(1)))
138
+ if tag in b"ltSz":
139
+ items = [self.value(depth + 1) for _ in range(self.count(1))]
140
+ if tag == 0x6C:
141
+ return items
142
+ if tag == 0x74:
143
+ return tuple(items)
144
+ return self._build(set if tag == 0x53 else frozenset, items)
145
+ if tag == 0x64: # d
146
+ pairs = [(self.value(depth + 1), self.value(depth + 1)) for _ in range(self.count(2))]
147
+ return self._build(dict, pairs)
148
+ if tag == 0x68: # h
149
+ return self.obtain(_U64.unpack(self.take(8))[0])
150
+ raise Violation(f"unknown value tag {tag:#x}")
151
+
152
+ def _big(self):
153
+ try:
154
+ text = str(self.take(self.count(1)), "ascii")
155
+ except UnicodeDecodeError:
156
+ raise Violation("invalid integer") from None
157
+ digits = text[3:] if text.startswith("-0x") else text[2:] if text.startswith("0x") else ""
158
+ if not digits or digits.strip("0123456789abcdef") or digits[0] == "0":
159
+ raise Violation("invalid integer")
160
+ n = int(text, 16)
161
+ if -(1 << 63) <= n < 1 << 63:
162
+ raise Violation("integer should have been sent as 'i'")
163
+ return n
164
+
165
+ def _build(self, kind, items):
166
+ try:
167
+ return kind(items)
168
+ except Exception as e:
169
+ if self.error is None:
170
+ self.error = e
171
+ return None
172
+
173
+ def finish(self):
174
+ if self.at != len(self.data):
175
+ raise Violation("trailing bytes in message")
176
+ if self.error is not None:
177
+ error, self.error = self.error, None
178
+ raise error
small_python/py.typed ADDED
File without changes
Binary file
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: small-python
3
+ Version: 0.1.0
4
+ Summary: Run Small Python, a small embeddable Python runtime, from CPython.
5
+ Author-email: Ju Lin <soasme@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/soasme/small-python
8
+ Classifier: Programming Language :: C
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: Implementation :: CPython
11
+ Classifier: Operating System :: POSIX
12
+ Classifier: Operating System :: MacOS
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ License-File: csrc/licenses/python.txt
17
+ License-File: csrc/licenses/unicode.txt
18
+ Dynamic: license-file
19
+
20
+ # Small Python
21
+
22
+ Small Python is a small and embeddable Python runtime. This package,
23
+ `small-python`, runs it from CPython: create isolated interpreters, run code in
24
+ them, and give that code exactly the functions, modules, and files you choose.
25
+
26
+ ![logo](docs/assets/logo-sm.png)
27
+
28
+ ## Features
29
+
30
+ * Small, just a few C files, no external dependencies.
31
+ * No Python Libs. Attach your own modules.
32
+ * Almost complete Python 3.15 support.
33
+ * Run code generated by AI against only the functions you expose.
34
+ * Each runtime runs in its own worker process: an engine crash raises an
35
+ exception instead of taking down your program.
36
+ * Limits on steps, memory, time, and message size.
37
+ * Can compile Python code to executables with no external dependency.
38
+ * GC uses reference counting with cycle removal.
39
+
40
+ ## Install
41
+
42
+ ```sh
43
+ pip install small-python
44
+ ```
45
+
46
+ Requires CPython 3.10 or newer on Linux or macOS.
47
+
48
+ ## Example
49
+
50
+ ```python
51
+ import small_python
52
+
53
+ with small_python.Runtime(step_limit=1_000_000, memory_limit=64 << 20, timeout=5) as rt:
54
+ @rt.function
55
+ def fetch(key, *, default=None):
56
+ return {"answer": 42}.get(key, default)
57
+
58
+ rt.register_module("host", {"fetch": fetch}, source="def twice(n): return n * 2")
59
+ rt.exec("from host import twice")
60
+ print(rt.eval("twice(fetch('answer'))")) # 84
61
+ ```
62
+
63
+ ## Documentation
64
+
65
+ - [Getting started](docs/getting-started.md)
66
+ - [Embedding guide](docs/embedding.md): host functions, modules, output, files, errors
67
+ - [Limits and safety](docs/safety.md)
68
+ - [API reference](docs/api.md)
69
+ - [Development](docs/development.md): building, testing, and releasing
70
+
71
+ ## Build
72
+
73
+ Requires a C11 compiler. Manage the project with [uv](https://docs.astral.sh/uv/):
74
+
75
+ ```sh
76
+ uv sync --locked
77
+ uv run python -c "import small_python"
78
+ uv build
79
+ ```
80
+
81
+ See [Development](docs/development.md) for tests and the release process.
@@ -0,0 +1,13 @@
1
+ small_python/__init__.py,sha256=5r9AVzBozrYtxnyVof3NY_mmu4HX4nno9Lhr1RQm7Pk,1222
2
+ small_python/_runtime.py,sha256=c8NFiYSIQv5aTwP5g99krBSqJaMpdepZ9ezB466zkeg,24136
3
+ small_python/_wire.py,sha256=YJOqiQCgsnn36eqwsDmF6Dv2bNOQeEIvuelwi1qwru4,6183
4
+ small_python/_runtime.pyi,sha256=YwyLuB7UJlpSf38kwEIEcSwjwy1952eA6MsKlAQjlX4,2847
5
+ small_python/spy-worker,sha256=_8r4gLmxqdtiMcXGiv3NkvbchTwz-q83LrhVkP5CNCY,1794792
6
+ small_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ small_python-0.1.0.dist-info/RECORD,,
8
+ small_python-0.1.0.dist-info/WHEEL,sha256=xm96Vum9-XRaAAu49DqyVgD_ZQX-UXyLCRueL51cUCY,133
9
+ small_python-0.1.0.dist-info/top_level.txt,sha256=Kw39GjHcfHHJDxNREF-3_16GHHbA26wk9whA0EtxdvU,13
10
+ small_python-0.1.0.dist-info/METADATA,sha256=wIYVyqdkDp4aXzsm2wOouEpcyKnKN0XmSq712I-em38,2519
11
+ small_python-0.1.0.dist-info/licenses/LICENSE,sha256=-PLaKGZFrtCpEyu6v0yJCWrR95hROnRQ3eEh0Fq2_Wg,1063
12
+ small_python-0.1.0.dist-info/licenses/csrc/licenses/python.txt,sha256=sOJaeM_7Q_TZLei2HM-h8fmOy8IjMLVLUlHntroBAjE,13804
13
+ small_python-0.1.0.dist-info/licenses/csrc/licenses/unicode.txt,sha256=56k7AJVlz85VkZo4FDesTbiD6dohJvoouR0ScyvFPZY,1995
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
6
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ju Lin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,277 @@
1
+ A. HISTORY OF THE SOFTWARE
2
+ ==========================
3
+
4
+ Python was created in the early 1990s by Guido van Rossum at Stichting
5
+ Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands
6
+ as a successor of a language called ABC. Guido remains Python's
7
+ principal author, although it includes many contributions from others.
8
+
9
+ In 1995, Guido continued his work on Python at the Corporation for
10
+ National Research Initiatives (CNRI, see https://www.cnri.reston.va.us)
11
+ in Reston, Virginia where he released several versions of the
12
+ software.
13
+
14
+ In May 2000, Guido and the Python core development team moved to
15
+ BeOpen.com to form the BeOpen PythonLabs team. In October of the same
16
+ year, the PythonLabs team moved to Digital Creations, which became
17
+ Zope Corporation. In 2001, the Python Software Foundation (PSF, see
18
+ https://www.python.org/psf/) was formed, a non-profit organization
19
+ created specifically to own Python-related Intellectual Property.
20
+ Zope Corporation was a sponsoring member of the PSF.
21
+
22
+ All Python releases are Open Source (see https://opensource.org for
23
+ the Open Source Definition). Historically, most, but not all, Python
24
+ releases have also been GPL-compatible; the table below summarizes
25
+ the various releases.
26
+
27
+ Release Derived Year Owner GPL-
28
+ from compatible? (1)
29
+
30
+ 0.9.0 thru 1.2 1991-1995 CWI yes
31
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
32
+ 1.6 1.5.2 2000 CNRI no
33
+ 2.0 1.6 2000 BeOpen.com no
34
+ 1.6.1 1.6 2001 CNRI yes (2)
35
+ 2.1 2.0+1.6.1 2001 PSF no
36
+ 2.0.1 2.0+1.6.1 2001 PSF yes
37
+ 2.1.1 2.1+2.0.1 2001 PSF yes
38
+ 2.1.2 2.1.1 2002 PSF yes
39
+ 2.1.3 2.1.2 2002 PSF yes
40
+ 2.2 and above 2.1.1 2001-now PSF yes
41
+
42
+ Footnotes:
43
+
44
+ (1) GPL-compatible doesn't mean that we're distributing Python under
45
+ the GPL. All Python licenses, unlike the GPL, let you distribute
46
+ a modified version without making your changes open source. The
47
+ GPL-compatible licenses make it possible to combine Python with
48
+ other software that is released under the GPL; the others don't.
49
+
50
+ (2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
51
+ because its license has a choice of law clause. According to
52
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
53
+ is "not incompatible" with the GPL.
54
+
55
+ Thanks to the many outside volunteers who have worked under Guido's
56
+ direction to make these releases possible.
57
+
58
+
59
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
60
+ ===============================================================
61
+
62
+ Python software and documentation are licensed under the
63
+ Python Software Foundation License Version 2.
64
+
65
+ Starting with Python 3.8.6, examples, recipes, and other code in
66
+ the documentation are dual licensed under the PSF License Version 2
67
+ and the Zero-Clause BSD license.
68
+
69
+ Some software incorporated into Python is under different licenses.
70
+ The licenses are listed with code falling under that license.
71
+
72
+
73
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
74
+ --------------------------------------------
75
+
76
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
77
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
78
+ otherwise using this software ("Python") in source or binary form and
79
+ its associated documentation.
80
+
81
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
82
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
83
+ analyze, test, perform and/or display publicly, prepare derivative works,
84
+ distribute, and otherwise use Python alone or in any derivative version,
85
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
86
+ i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved"
87
+ are retained in Python alone or in any derivative version prepared by Licensee.
88
+
89
+ 3. In the event Licensee prepares a derivative work that is based on
90
+ or incorporates Python or any part thereof, and wants to make
91
+ the derivative work available to others as provided herein, then
92
+ Licensee hereby agrees to include in any such work a brief summary of
93
+ the changes made to Python.
94
+
95
+ 4. PSF is making Python available to Licensee on an "AS IS"
96
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
97
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
98
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
99
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
100
+ INFRINGE ANY THIRD PARTY RIGHTS.
101
+
102
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
103
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
104
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
105
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
106
+
107
+ 6. This License Agreement will automatically terminate upon a material
108
+ breach of its terms and conditions.
109
+
110
+ 7. Nothing in this License Agreement shall be deemed to create any
111
+ relationship of agency, partnership, or joint venture between PSF and
112
+ Licensee. This License Agreement does not grant permission to use PSF
113
+ trademarks or trade name in a trademark sense to endorse or promote
114
+ products or services of Licensee, or any third party.
115
+
116
+ 8. By copying, installing or otherwise using Python, Licensee
117
+ agrees to be bound by the terms and conditions of this License
118
+ Agreement.
119
+
120
+
121
+ BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
122
+ -------------------------------------------
123
+
124
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
125
+
126
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
127
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
128
+ Individual or Organization ("Licensee") accessing and otherwise using
129
+ this software in source or binary form and its associated
130
+ documentation ("the Software").
131
+
132
+ 2. Subject to the terms and conditions of this BeOpen Python License
133
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
134
+ royalty-free, world-wide license to reproduce, analyze, test, perform
135
+ and/or display publicly, prepare derivative works, distribute, and
136
+ otherwise use the Software alone or in any derivative version,
137
+ provided, however, that the BeOpen Python License is retained in the
138
+ Software, alone or in any derivative version prepared by Licensee.
139
+
140
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
141
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
142
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
143
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
144
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
145
+ INFRINGE ANY THIRD PARTY RIGHTS.
146
+
147
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
148
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
149
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
150
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
151
+
152
+ 5. This License Agreement will automatically terminate upon a material
153
+ breach of its terms and conditions.
154
+
155
+ 6. This License Agreement shall be governed by and interpreted in all
156
+ respects by the law of the State of California, excluding conflict of
157
+ law provisions. Nothing in this License Agreement shall be deemed to
158
+ create any relationship of agency, partnership, or joint venture
159
+ between BeOpen and Licensee. This License Agreement does not grant
160
+ permission to use BeOpen trademarks or trade names in a trademark
161
+ sense to endorse or promote products or services of Licensee, or any
162
+ third party. As an exception, the "BeOpen Python" logos available at
163
+ http://www.pythonlabs.com/logos.html may be used according to the
164
+ permissions granted on that web page.
165
+
166
+ 7. By copying, installing or otherwise using the software, Licensee
167
+ agrees to be bound by the terms and conditions of this License
168
+ Agreement.
169
+
170
+
171
+ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
172
+ ---------------------------------------
173
+
174
+ 1. This LICENSE AGREEMENT is between the Corporation for National
175
+ Research Initiatives, having an office at 1895 Preston White Drive,
176
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
177
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
178
+ source or binary form and its associated documentation.
179
+
180
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
181
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
182
+ license to reproduce, analyze, test, perform and/or display publicly,
183
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
184
+ alone or in any derivative version, provided, however, that CNRI's
185
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
186
+ 1995-2001 Corporation for National Research Initiatives; All Rights
187
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
188
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
189
+ Agreement, Licensee may substitute the following text (omitting the
190
+ quotes): "Python 1.6.1 is made available subject to the terms and
191
+ conditions in CNRI's License Agreement. This Agreement together with
192
+ Python 1.6.1 may be located on the internet using the following
193
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
194
+ Agreement may also be obtained from a proxy server on the internet
195
+ using the following URL: http://hdl.handle.net/1895.22/1013".
196
+
197
+ 3. In the event Licensee prepares a derivative work that is based on
198
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
199
+ the derivative work available to others as provided herein, then
200
+ Licensee hereby agrees to include in any such work a brief summary of
201
+ the changes made to Python 1.6.1.
202
+
203
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
204
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
205
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
206
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
207
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
208
+ INFRINGE ANY THIRD PARTY RIGHTS.
209
+
210
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
211
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
212
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
213
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
214
+
215
+ 6. This License Agreement will automatically terminate upon a material
216
+ breach of its terms and conditions.
217
+
218
+ 7. This License Agreement shall be governed by the federal
219
+ intellectual property law of the United States, including without
220
+ limitation the federal copyright law, and, to the extent such
221
+ U.S. federal law does not apply, by the law of the Commonwealth of
222
+ Virginia, excluding Virginia's conflict of law provisions.
223
+ Notwithstanding the foregoing, with regard to derivative works based
224
+ on Python 1.6.1 that incorporate non-separable material that was
225
+ previously distributed under the GNU General Public License (GPL), the
226
+ law of the Commonwealth of Virginia shall govern this License
227
+ Agreement only as to issues arising under or with respect to
228
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
229
+ License Agreement shall be deemed to create any relationship of
230
+ agency, partnership, or joint venture between CNRI and Licensee. This
231
+ License Agreement does not grant permission to use CNRI trademarks or
232
+ trade name in a trademark sense to endorse or promote products or
233
+ services of Licensee, or any third party.
234
+
235
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
236
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
237
+ bound by the terms and conditions of this License Agreement.
238
+
239
+ ACCEPT
240
+
241
+
242
+ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
243
+ --------------------------------------------------
244
+
245
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
246
+ The Netherlands. All rights reserved.
247
+
248
+ Permission to use, copy, modify, and distribute this software and its
249
+ documentation for any purpose and without fee is hereby granted,
250
+ provided that the above copyright notice appear in all copies and that
251
+ both that copyright notice and this permission notice appear in
252
+ supporting documentation, and that the name of Stichting Mathematisch
253
+ Centrum or CWI not be used in advertising or publicity pertaining to
254
+ distribution of the software without specific, written prior
255
+ permission.
256
+
257
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
258
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
259
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
260
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
261
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
262
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
263
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
264
+
265
+ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
266
+ ----------------------------------------------------------------------
267
+
268
+ Permission to use, copy, modify, and/or distribute this software for any
269
+ purpose with or without fee is hereby granted.
270
+
271
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
272
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
273
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
274
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
275
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
276
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
277
+ PERFORMANCE OF THIS SOFTWARE.