machinera 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.
- machinera-0.1.0/.github/dependabot.yml +23 -0
- machinera-0.1.0/.github/workflows/ci.yml +91 -0
- machinera-0.1.0/.github/workflows/publish.yml +99 -0
- machinera-0.1.0/.gitignore +13 -0
- machinera-0.1.0/.python-version +1 -0
- machinera-0.1.0/CHANGELOG.md +56 -0
- machinera-0.1.0/CONTRIBUTING.md +62 -0
- machinera-0.1.0/LICENSE +201 -0
- machinera-0.1.0/PKG-INFO +446 -0
- machinera-0.1.0/README.md +419 -0
- machinera-0.1.0/SECURITY.md +24 -0
- machinera-0.1.0/api.md +634 -0
- machinera-0.1.0/examples/README.md +93 -0
- machinera-0.1.0/examples/async_submit_and_resume.py +129 -0
- machinera-0.1.0/examples/async_transcribe_file.py +26 -0
- machinera-0.1.0/examples/handle_errors.py +87 -0
- machinera-0.1.0/examples/submit_and_resume.py +116 -0
- machinera-0.1.0/examples/transcribe_file.py +22 -0
- machinera-0.1.0/examples/transcribe_large_file.py +55 -0
- machinera-0.1.0/examples/transcribe_url.py +21 -0
- machinera-0.1.0/pyproject.toml +74 -0
- machinera-0.1.0/scripts/check_release.py +66 -0
- machinera-0.1.0/src/machinera/__init__.py +79 -0
- machinera-0.1.0/src/machinera/_async_client.py +391 -0
- machinera-0.1.0/src/machinera/_client.py +356 -0
- machinera-0.1.0/src/machinera/_codes.py +8 -0
- machinera-0.1.0/src/machinera/_contract.py +546 -0
- machinera-0.1.0/src/machinera/_core.py +1005 -0
- machinera-0.1.0/src/machinera/_exceptions.py +156 -0
- machinera-0.1.0/src/machinera/_files.py +207 -0
- machinera-0.1.0/src/machinera/_io.py +267 -0
- machinera-0.1.0/src/machinera/_logs.py +19 -0
- machinera-0.1.0/src/machinera/_multipart.py +210 -0
- machinera-0.1.0/src/machinera/_types.py +256 -0
- machinera-0.1.0/src/machinera/_uploads.py +151 -0
- machinera-0.1.0/src/machinera/_version.py +1 -0
- machinera-0.1.0/src/machinera/py.typed +1 -0
- machinera-0.1.0/tests/test_api_reference.py +51 -0
- machinera-0.1.0/tests/test_async_client.py +743 -0
- machinera-0.1.0/tests/test_client.py +1124 -0
- machinera-0.1.0/tests/test_contract.py +757 -0
- machinera-0.1.0/tests/test_examples.py +510 -0
- machinera-0.1.0/tests/test_release.py +76 -0
- machinera-0.1.0/tests/test_reliability.py +853 -0
- machinera-0.1.0/tests/test_typed_contract.py +414 -0
- machinera-0.1.0/tests/test_uploads.py +1280 -0
- machinera-0.1.0/uv.lock +1325 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
cooldown:
|
|
8
|
+
default-days: 7
|
|
9
|
+
groups:
|
|
10
|
+
actions-minor-patch:
|
|
11
|
+
patterns: ["*"]
|
|
12
|
+
update-types: ["minor", "patch"]
|
|
13
|
+
- package-ecosystem: "uv"
|
|
14
|
+
directory: "/"
|
|
15
|
+
schedule:
|
|
16
|
+
interval: "weekly"
|
|
17
|
+
cooldown:
|
|
18
|
+
default-days: 7
|
|
19
|
+
versioning-strategy: lockfile-only
|
|
20
|
+
groups:
|
|
21
|
+
uv-minor-patch:
|
|
22
|
+
patterns: ["*"]
|
|
23
|
+
update-types: ["minor", "patch"]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ci-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
timeout-minutes: 15
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python }}
|
|
30
|
+
- run: uv sync --locked --group dev
|
|
31
|
+
- run: uv run ruff check .
|
|
32
|
+
- run: uv run ruff format --check .
|
|
33
|
+
- run: uv run mypy --strict src
|
|
34
|
+
- run: uv run pytest -q
|
|
35
|
+
test-minimum:
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
timeout-minutes: 15
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
40
|
+
with:
|
|
41
|
+
persist-credentials: false
|
|
42
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.10"
|
|
45
|
+
cache: pip
|
|
46
|
+
cache-dependency-path: pyproject.toml
|
|
47
|
+
- run: python -m pip install 'pip>=25.1'
|
|
48
|
+
- run: python -m pip install -e . --group dev 'pydantic==2.0.*' 'httpx==0.27.*'
|
|
49
|
+
- run: pytest -q
|
|
50
|
+
lock:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
timeout-minutes: 15
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
55
|
+
with:
|
|
56
|
+
persist-credentials: false
|
|
57
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
58
|
+
- run: uv lock --check
|
|
59
|
+
build:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
timeout-minutes: 15
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
64
|
+
with:
|
|
65
|
+
persist-credentials: false
|
|
66
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
67
|
+
with:
|
|
68
|
+
python-version: "3.12"
|
|
69
|
+
cache: pip
|
|
70
|
+
cache-dependency-path: pyproject.toml
|
|
71
|
+
- run: python -m pip install 'build==1.6.1' 'twine==7.0.0'
|
|
72
|
+
- run: python -m build
|
|
73
|
+
- run: twine check dist/*
|
|
74
|
+
- name: Check distribution versions
|
|
75
|
+
run: python scripts/check_release.py "v$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' src/machinera/_version.py)"
|
|
76
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
77
|
+
with:
|
|
78
|
+
name: distributions
|
|
79
|
+
path: dist/*
|
|
80
|
+
wheel-import:
|
|
81
|
+
needs: build
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
timeout-minutes: 15
|
|
84
|
+
container: python:3.12-slim
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
87
|
+
with:
|
|
88
|
+
name: distributions
|
|
89
|
+
path: dist
|
|
90
|
+
- run: python -m pip install dist/*.whl
|
|
91
|
+
- run: python -c "import machinera; from importlib.metadata import version; assert machinera.__version__ == version('machinera')"
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: publish-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
if: github.repository == 'machinera-labs/machinera-python'
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
actions: read
|
|
20
|
+
contents: read
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
23
|
+
with:
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
- run: python -m pip install 'build==1.6.1' 'twine==7.0.0'
|
|
29
|
+
- name: Require the tagged commit to be on main
|
|
30
|
+
env:
|
|
31
|
+
GH_TOKEN: ${{ github.token }}
|
|
32
|
+
run: |
|
|
33
|
+
status=$(gh api "repos/$GITHUB_REPOSITORY/compare/main...$GITHUB_SHA" --jq .status)
|
|
34
|
+
case "$status" in
|
|
35
|
+
identical|behind) ;;
|
|
36
|
+
*) echo "::error::Tagged commit $GITHUB_SHA is not on main (compare status: $status)"; exit 1 ;;
|
|
37
|
+
esac
|
|
38
|
+
- name: Wait for a successful CI run for the tagged commit
|
|
39
|
+
env:
|
|
40
|
+
GH_TOKEN: ${{ github.token }}
|
|
41
|
+
run: |
|
|
42
|
+
deadline=$(( $(date +%s) + 1800 ))
|
|
43
|
+
while :; do
|
|
44
|
+
runs=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow CI --commit "$GITHUB_SHA" --json status,conclusion --jq '.[] | "\(.status) \(.conclusion)"') || runs=""
|
|
45
|
+
if grep -q ' success$' <<<"$runs"; then
|
|
46
|
+
exit 0
|
|
47
|
+
fi
|
|
48
|
+
if grep -E '^completed ' <<<"$runs" | grep -qv ' success$'; then
|
|
49
|
+
echo "::error::CI for $GITHUB_SHA completed without success"; exit 1
|
|
50
|
+
fi
|
|
51
|
+
if [ "$(date +%s)" -ge "$deadline" ]; then
|
|
52
|
+
echo "::error::Timed out after 30 minutes waiting for CI on $GITHUB_SHA"; exit 1
|
|
53
|
+
fi
|
|
54
|
+
sleep 30
|
|
55
|
+
done
|
|
56
|
+
- run: python -m build
|
|
57
|
+
- run: twine check dist/*
|
|
58
|
+
- name: Check tag and distribution versions
|
|
59
|
+
env:
|
|
60
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
61
|
+
run: python scripts/check_release.py "$RELEASE_TAG"
|
|
62
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
63
|
+
with:
|
|
64
|
+
name: distributions
|
|
65
|
+
path: dist/*
|
|
66
|
+
if-no-files-found: error
|
|
67
|
+
publish:
|
|
68
|
+
if: github.repository == 'machinera-labs/machinera-python'
|
|
69
|
+
needs: build
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
permissions:
|
|
72
|
+
contents: read
|
|
73
|
+
id-token: write
|
|
74
|
+
environment:
|
|
75
|
+
name: pypi
|
|
76
|
+
url: https://pypi.org/p/machinera
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
79
|
+
with:
|
|
80
|
+
name: distributions
|
|
81
|
+
path: dist
|
|
82
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
83
|
+
release:
|
|
84
|
+
if: github.repository == 'machinera-labs/machinera-python'
|
|
85
|
+
needs: [build, publish]
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
permissions:
|
|
88
|
+
contents: write
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
91
|
+
with:
|
|
92
|
+
name: distributions
|
|
93
|
+
path: dist
|
|
94
|
+
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
|
|
95
|
+
with:
|
|
96
|
+
tag_name: ${{ github.ref_name }}
|
|
97
|
+
files: dist/*
|
|
98
|
+
fail_on_unmatched_files: true
|
|
99
|
+
generate_release_notes: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.1.0 — 2026-10-02
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Blocking `Machinera` and native asyncio `AsyncMachinera` clients for file and
|
|
10
|
+
URL transcription, job status, polling, and resumption, with context-managed
|
|
11
|
+
lifecycle and configurable concurrency.
|
|
12
|
+
- File inputs from paths, binary handles, bytes, and file tuples, with supported
|
|
13
|
+
format detection and local input validation; a handle whose reads return text
|
|
14
|
+
raises `TypeError`.
|
|
15
|
+
- Durable server jobs selected by `transport="job"` or an `idempotency_key`, with the
|
|
16
|
+
inline size limit `Limits.job_inline_body_bytes`, which defaults to the SDK's
|
|
17
|
+
staged-upload threshold `STAGED_UPLOAD_THRESHOLD_BYTES`; inline job submission
|
|
18
|
+
failures report `phase == "job_submit"`.
|
|
19
|
+
- Automatic staged uploads for files above that limit with bounded streaming,
|
|
20
|
+
checksums, integrity validation, and safe retries. When the service reports staged
|
|
21
|
+
uploads unavailable before granting an upload, a body within the service inline
|
|
22
|
+
limit is submitted once as an inline durable job under the same operation key. Custom HTTP proxy and URL-mount settings
|
|
23
|
+
are preserved without forwarding client credentials or cookies to upload storage.
|
|
24
|
+
- Idempotent submission and recovery using operation keys, upload context, and job
|
|
25
|
+
IDs, with transcription options validated before resuming bound uploads.
|
|
26
|
+
- Configurable elapsed deadlines, HTTP timeouts, retry limits, headers, and
|
|
27
|
+
environment-based credentials and endpoint defaults, with service retry guidance.
|
|
28
|
+
`Retry-After` accepts seconds, including fractional values, or an HTTP date, and a
|
|
29
|
+
`retry-after-ms` header takes precedence when present.
|
|
30
|
+
- Cancellation and interruption recovery context, bounded file reads, and safe
|
|
31
|
+
file cleanup that preserves caller ownership and offsets.
|
|
32
|
+
`TranscriptionInterrupted.ambiguous` is `True` when an unkeyed synchronous request
|
|
33
|
+
was interrupted and may have run.
|
|
34
|
+
- Typed, frozen Pydantic transcription results and job snapshots that preserve
|
|
35
|
+
exact transcript text and retain unknown response fields in `raw`.
|
|
36
|
+
`JobSnapshot.status` is a plain string with known values in the `JobStatus` type;
|
|
37
|
+
`get_job` returns unrecognized statuses, and polling treats them as terminal and
|
|
38
|
+
raises `TerminalJobError` with the status in `last_status`.
|
|
39
|
+
- Status-specific API exceptions, upload errors with sanitized storage codes,
|
|
40
|
+
and explicit deadline, ambiguous-submission, and terminal-job errors with
|
|
41
|
+
sanitized recovery context. Service errors with an `upload_` code raise
|
|
42
|
+
`UploadError`, except rate limits.
|
|
43
|
+
- `APIResponseValidationError` for a malformed or unexpected response body,
|
|
44
|
+
including an upload initialization response or grant; it is never retried.
|
|
45
|
+
- `TerminalIntegrityError`, raised when a job fails because the uploaded file did not
|
|
46
|
+
match; it is both an `IntegrityError` and a `TerminalJobError`.
|
|
47
|
+
- A `machinera` logger with retry decisions at `DEBUG` and job status changes at
|
|
48
|
+
`INFO`, and an opt-in `MACHINERA_LOG=debug|info` environment variable.
|
|
49
|
+
- Pooled, reusable connections for job status polling; uploads and submissions keep
|
|
50
|
+
connections that a deadline can close.
|
|
51
|
+
- Support for Python 3.10–3.14 and every `pydantic>=2,<3` release, an API reference,
|
|
52
|
+
and runnable file, URL, large-file, recovery, error-handling, and asyncio examples
|
|
53
|
+
with offline tests. The examples construct `Machinera()` and `AsyncMachinera()`, so
|
|
54
|
+
`MACHINERA_API_KEY` and `MACHINERA_BASE_URL` apply.
|
|
55
|
+
- Contribution and security policies, documented versioning, reproducible
|
|
56
|
+
development dependencies, and release artifact validation.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Report bugs and request features in the
|
|
4
|
+
[public issue tracker](https://github.com/machinera-labs/machinera-python/issues).
|
|
5
|
+
Include the SDK and Python versions, expected behavior, and a minimal reproduction
|
|
6
|
+
with synthetic inputs. Remove credentials, source URLs, audio, transcripts, and
|
|
7
|
+
other private data. Report vulnerabilities through [SECURITY.md](SECURITY.md).
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
Fork the [public repository](https://github.com/machinera-labs/machinera-python),
|
|
12
|
+
clone your fork, and create a branch for the change. Python 3.12 is the development
|
|
13
|
+
default in `.python-version`; CI tests Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
uv sync --locked --group dev
|
|
17
|
+
uv run ruff check .
|
|
18
|
+
uv run ruff format --check .
|
|
19
|
+
uv run mypy --strict src
|
|
20
|
+
uv run pytest -q
|
|
21
|
+
uv run python -m build
|
|
22
|
+
uv run twine check dist/*
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`uv sync --locked --group dev` installs the committed development lock, as CI does.
|
|
26
|
+
With pip 25.1 or later, `python -m pip install -e . --group dev` installs the same
|
|
27
|
+
tools without the lock. After intentionally changing dependencies, regenerate the
|
|
28
|
+
lock with `uv lock`. Runtime dependency ranges live in `pyproject.toml`; the
|
|
29
|
+
development lock does not constrain users. CI also installs the lowest supported
|
|
30
|
+
runtime versions with pip to check those ranges independently of the lock.
|
|
31
|
+
|
|
32
|
+
`src/machinera/_contract.py` is generated from the service's API contract; do not
|
|
33
|
+
edit it by hand.
|
|
34
|
+
|
|
35
|
+
Use type hints, keep strict mypy clean, and format with Ruff (100 columns).
|
|
36
|
+
Keep Python 3.10 compatibility. Add focused offline tests for behavior changes,
|
|
37
|
+
using `httpx.MockTransport` and the helpers in `tests/`. Do not require real API
|
|
38
|
+
credentials or send network requests in tests. Preserve exact transcript text and
|
|
39
|
+
caller file ownership. Add comments only to explain a non-obvious reason; keep
|
|
40
|
+
public API docstrings short. End text files with one newline and no trailing spaces.
|
|
41
|
+
|
|
42
|
+
## Pull requests
|
|
43
|
+
|
|
44
|
+
Open a pull request against `main` in the public repository. Describe the problem,
|
|
45
|
+
observable behavior, and validation performed. Keep changes focused and update
|
|
46
|
+
examples, `api.md`, and the relevant category under `Unreleased` in `CHANGELOG.md`
|
|
47
|
+
when behavior changes. Maintainers may integrate contributions through their own
|
|
48
|
+
process, so a contribution may appear in a later release without a direct merge of
|
|
49
|
+
the original pull request.
|
|
50
|
+
|
|
51
|
+
## Release maintenance
|
|
52
|
+
|
|
53
|
+
Review `api.md` against the exported API at every release (tests check that every
|
|
54
|
+
export has an entry) and check examples on the supported Python matrix. Use
|
|
55
|
+
semantic versions and move completed changelog entries into a dated release
|
|
56
|
+
section when preparing a release.
|
|
57
|
+
|
|
58
|
+
The tag workflow runs only in `machinera-labs/machinera-python`. Maintainers must
|
|
59
|
+
configure PyPI trusted publishing for `publish.yml` and the GitHub environment
|
|
60
|
+
`pypi`, with required reviewers, before publishing. A `v` tag must match the package,
|
|
61
|
+
wheel, and source metadata versions. The workflow builds once, publishes the checked
|
|
62
|
+
artifacts after environment approval, then attaches them to a GitHub Release.
|
machinera-0.1.0/LICENSE
ADDED
|
@@ -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.
|