tabella-core 0.1.0__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.
@@ -0,0 +1,10 @@
1
+ """tabella-core: models, connector SDK, backend interfaces, registration pipeline."""
2
+
3
+ from tabella_core.models import (
4
+ TABELLA_SPEC_VERSION,
5
+ AssetDescriptor,
6
+ OnboardingManifest,
7
+ )
8
+
9
+ __version__ = "0.1.0"
10
+ __all__ = ["AssetDescriptor", "OnboardingManifest", "TABELLA_SPEC_VERSION", "__version__"]
@@ -0,0 +1,75 @@
1
+ """Connector SDK: base contract and scheme registry (spec/connector-interface.md)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+ from collections.abc import Mapping
7
+ from typing import Any, ClassVar, NamedTuple
8
+
9
+ from tabella_core.models import AssetDescriptor, AssetSchema
10
+
11
+
12
+ class FetchResult(NamedTuple):
13
+ records: list[dict[str, Any]]
14
+ total: int | None
15
+
16
+
17
+ class Connector(ABC):
18
+ scheme: ClassVar[str]
19
+ aliases: ClassVar[tuple[str, ...]] = ()
20
+
21
+ def source_name(self, uri: str) -> str:
22
+ """Default logical source name derived from the URI (last path segment,
23
+ extension stripped). Discovery drafts use this; owners override it in
24
+ the manifest."""
25
+ from urllib.parse import urlparse
26
+
27
+ from tabella_core.models import slug
28
+
29
+ parsed = urlparse(uri)
30
+ path = parsed.path.strip("/")
31
+ last = path.rsplit("/", 1)[-1] if path else (parsed.netloc or self.scheme)
32
+ stem = last.rsplit(".", 1)[0] if "." in last else last
33
+ return slug(stem or self.scheme)
34
+
35
+ @abstractmethod
36
+ def list_assets(self, uri: str) -> list[str]: ...
37
+
38
+ @abstractmethod
39
+ def introspect(self, uri: str, native_name: str) -> AssetSchema: ...
40
+
41
+ @abstractmethod
42
+ def fetch(
43
+ self,
44
+ descriptor: AssetDescriptor,
45
+ *,
46
+ filters: Mapping[str, Any] | None = None,
47
+ limit: int = 100,
48
+ offset: int = 0,
49
+ ) -> FetchResult: ...
50
+
51
+
52
+ _REGISTRY: dict[str, type[Connector]] = {}
53
+
54
+
55
+ def register(cls: type[Connector]) -> type[Connector]:
56
+ _REGISTRY[cls.scheme] = cls
57
+ for alias in cls.aliases:
58
+ _REGISTRY[alias] = cls
59
+ return cls
60
+
61
+
62
+ def get_connector(scheme: str) -> Connector:
63
+ try:
64
+ return _REGISTRY[scheme]()
65
+ except KeyError:
66
+ raise KeyError(
67
+ f"No connector registered for scheme '{scheme}' (available: {sorted(_REGISTRY)})"
68
+ ) from None
69
+
70
+
71
+ def scheme_of(uri: str) -> str:
72
+ scheme, sep, _ = uri.partition("://")
73
+ if not sep:
74
+ raise ValueError(f"Not a source URI (expected '<scheme>://...'): {uri!r}")
75
+ return scheme
@@ -0,0 +1,65 @@
1
+ """Pluggable backend interfaces: catalog, governance, embeddings.
2
+
3
+ Reference adapters: tabella-catalog-om (OpenMetadata, M1), tabella-governance-aws
4
+ (Glue + Lake Formation, M3), pgvector embeddings (tabella-enable, M2).
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from abc import ABC, abstractmethod
10
+
11
+ from tabella_core.models import AssetDescriptor
12
+
13
+
14
+ class CatalogBackend(ABC):
15
+ """Mirrors descriptors into a metadata catalog (entity, tags, domain,
16
+ custom properties, contract)."""
17
+
18
+ name: str
19
+
20
+ @abstractmethod
21
+ def upsert_asset(self, descriptor: AssetDescriptor) -> None: ...
22
+
23
+
24
+ class GovernanceBackend(ABC):
25
+ """Registers assets with a governance system and applies access policy
26
+ (e.g. AWS Glue registration + Lake Formation grants)."""
27
+
28
+ name: str
29
+
30
+ @abstractmethod
31
+ def apply(self, descriptor: AssetDescriptor) -> None: ...
32
+
33
+
34
+ class EmbeddingProvider(ABC):
35
+ """Embeds text chunks for RAG vectorization."""
36
+
37
+ name: str
38
+ model: str
39
+ dimensions: int
40
+
41
+ @abstractmethod
42
+ def embed(self, texts: list[str]) -> list[list[float]]: ...
43
+
44
+
45
+ class VectorStore(ABC):
46
+ """Stores and searches embedded chunks per asset collection.
47
+
48
+ Reference backends: local JSON files (dev/tests, no infra) and pgvector
49
+ (production). Re-vectorizing an asset MUST replace its collection
50
+ idempotently.
51
+ """
52
+
53
+ name: str
54
+
55
+ @abstractmethod
56
+ def replace_collection(
57
+ self, collection: str, chunks: list[dict], dimensions: int
58
+ ) -> None:
59
+ """Chunks are dicts: {id, record_ref, content, metadata, embedding}."""
60
+
61
+ @abstractmethod
62
+ def search(
63
+ self, collection: str, query_embedding: list[float], top_k: int = 5
64
+ ) -> list[dict]:
65
+ """Returns chunk dicts (sans embedding) with an added `score`."""
@@ -0,0 +1,23 @@
1
+ """Load Onboarding Manifests from YAML (human entry) or JSON (form/API entry)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from pathlib import Path
7
+
8
+ import yaml
9
+
10
+ from tabella_core.models import OnboardingManifest
11
+
12
+
13
+ def load_manifest(path: str | Path) -> OnboardingManifest:
14
+ path = Path(path)
15
+ text = path.read_text()
16
+ data = json.loads(text) if path.suffix == ".json" else yaml.safe_load(text)
17
+ if not isinstance(data, dict):
18
+ raise ValueError(f"Manifest is not a mapping: {path}")
19
+ return OnboardingManifest.model_validate(data)
20
+
21
+
22
+ def dump_manifest_yaml(manifest: OnboardingManifest) -> str:
23
+ return yaml.safe_dump(manifest.to_json_dict(), sort_keys=False)
tabella_core/models.py ADDED
@@ -0,0 +1,169 @@
1
+ """Models for the Tabella spec artifacts: Onboarding Manifest and Asset Descriptor.
2
+
3
+ Serialized forms always use the spec's field names (`schema`, not
4
+ `asset_schema`): dump with `to_json_dict()`.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import re
10
+ from enum import StrEnum
11
+ from typing import Any
12
+
13
+ from pydantic import BaseModel, ConfigDict, Field
14
+
15
+ TABELLA_SPEC_VERSION = "0.1.0"
16
+
17
+
18
+ def slug(text: str) -> str:
19
+ return re.sub(r"[^a-z0-9_.-]+", "-", text.lower()).strip("-")
20
+
21
+
22
+ class FieldType(StrEnum):
23
+ string = "string"
24
+ integer = "integer"
25
+ number = "number"
26
+ boolean = "boolean"
27
+ date = "date"
28
+ datetime = "datetime"
29
+ json = "json"
30
+ binary = "binary"
31
+ unknown = "unknown"
32
+
33
+
34
+ class Classification(StrEnum):
35
+ public = "public"
36
+ internal = "internal"
37
+ confidential = "confidential"
38
+ restricted = "restricted"
39
+
40
+
41
+ class FieldDef(BaseModel):
42
+ name: str
43
+ type: FieldType = FieldType.unknown
44
+ nullable: bool = True
45
+ description: str | None = None
46
+ semantic_tags: list[str] = Field(default_factory=list)
47
+ pii: bool = False
48
+
49
+
50
+ class ForeignKey(BaseModel):
51
+ fields: list[str]
52
+ ref_asset: str
53
+ ref_fields: list[str]
54
+
55
+
56
+ class AssetSchema(BaseModel):
57
+ fields: list[FieldDef]
58
+ primary_key: list[str] = Field(default_factory=list)
59
+ foreign_keys: list[ForeignKey] = Field(default_factory=list)
60
+
61
+ def field(self, name: str) -> FieldDef | None:
62
+ return next((f for f in self.fields if f.name == name), None)
63
+
64
+
65
+ class SourceRef(BaseModel):
66
+ connector: str
67
+ name: str = Field(pattern=r"^[a-z0-9_.-]+$")
68
+ uri: str
69
+ native_name: str
70
+
71
+
72
+ class AccessPolicy(BaseModel):
73
+ read_roles: list[str] = Field(default_factory=lambda: ["*"])
74
+ row_limit: int = 1000
75
+
76
+
77
+ class ChunkingStrategy(StrEnum):
78
+ semantic = "semantic"
79
+ fixed = "fixed"
80
+ document = "document"
81
+
82
+
83
+ class VectorizationProfile(BaseModel):
84
+ enabled: bool = False
85
+ content_fields: list[str] = Field(default_factory=list)
86
+ metadata_fields: list[str] = Field(default_factory=list)
87
+ chunking: ChunkingStrategy = ChunkingStrategy.fixed
88
+ chunk_size: int = 512
89
+ embedding_model: str | None = None
90
+
91
+
92
+ class EnablementProfile(BaseModel):
93
+ api: bool = True
94
+ mcp: bool = True
95
+ vectorization: VectorizationProfile = Field(default_factory=VectorizationProfile)
96
+
97
+
98
+ class ContractField(BaseModel):
99
+ name: str
100
+ type: FieldType | None = None
101
+ required: bool = False
102
+ pii: bool = False
103
+
104
+
105
+ class Contract(BaseModel):
106
+ fields: list[ContractField] = Field(default_factory=list)
107
+
108
+
109
+ class AssetMeta(BaseModel):
110
+ name: str
111
+ description: str | None = None
112
+ owner: str | None = None
113
+ domain: str
114
+ tags: list[str] = Field(default_factory=list)
115
+ classification: Classification = Classification.internal
116
+
117
+
118
+ class OnboardingManifest(BaseModel):
119
+ """The registration entry artifact (spec/onboarding-manifest.md)."""
120
+
121
+ tabella_version: str = TABELLA_SPEC_VERSION
122
+ asset: AssetMeta
123
+ source: SourceRef
124
+ contract: Contract = Field(default_factory=Contract)
125
+ access: AccessPolicy = Field(default_factory=AccessPolicy)
126
+ enablement: EnablementProfile = Field(default_factory=EnablementProfile)
127
+ custom_properties: dict[str, str] = Field(default_factory=dict)
128
+
129
+ @property
130
+ def asset_id(self) -> str:
131
+ return f"{slug(self.asset.domain)}.{slug(self.asset.name)}"
132
+
133
+ def to_json_dict(self) -> dict[str, Any]:
134
+ return self.model_dump(by_alias=True, mode="json")
135
+
136
+
137
+ class AssetDescriptor(BaseModel):
138
+ """The cataloged asset record (spec/asset-descriptor.md)."""
139
+
140
+ model_config = ConfigDict(populate_by_name=True)
141
+
142
+ tabella_version: str = TABELLA_SPEC_VERSION
143
+ id: str = Field(pattern=r"^[a-z0-9_.-]+$")
144
+ name: str
145
+ description: str | None = None
146
+ owner: str | None = None
147
+ domain: str
148
+ tags: list[str] = Field(default_factory=list)
149
+ classification: Classification = Classification.internal
150
+ source: SourceRef
151
+ asset_schema: AssetSchema = Field(alias="schema")
152
+ contract: Contract = Field(default_factory=Contract)
153
+ access: AccessPolicy = Field(default_factory=AccessPolicy)
154
+ enablement: EnablementProfile = Field(default_factory=EnablementProfile)
155
+ custom_properties: dict[str, str] = Field(default_factory=dict)
156
+ lineage: list[str] = Field(default_factory=list)
157
+
158
+ def to_json_dict(self) -> dict[str, Any]:
159
+ return self.model_dump(by_alias=True, mode="json")
160
+
161
+ def summary(self) -> dict[str, Any]:
162
+ return {
163
+ "id": self.id,
164
+ "name": self.name,
165
+ "description": self.description,
166
+ "domain": self.domain,
167
+ "classification": self.classification.value,
168
+ "tags": self.tags,
169
+ }
@@ -0,0 +1,143 @@
1
+ """The registration pipeline: manifest -> verified Asset Descriptor -> backends.
2
+
3
+ Local reference flow (spec/onboarding-manifest.md, "Registration semantics"):
4
+
5
+ validate -> introspect -> verify contract -> descriptor -> local store
6
+ -> catalog backend(s) -> governance backend(s)
7
+
8
+ Enablement artifact generation (APIs, tools, RAG) is performed by tabella-enable
9
+ generators over the resulting catalog.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from dataclasses import dataclass, field
15
+ from pathlib import Path
16
+
17
+ from tabella_core.connectors import get_connector
18
+ from tabella_core.interfaces import CatalogBackend, GovernanceBackend
19
+ from tabella_core.models import (
20
+ AssetDescriptor,
21
+ AssetMeta,
22
+ AssetSchema,
23
+ Classification,
24
+ OnboardingManifest,
25
+ SourceRef,
26
+ slug,
27
+ )
28
+ from tabella_core.store import save_descriptor
29
+
30
+
31
+ class ContractViolation(Exception):
32
+ def __init__(self, asset_id: str, problems: list[str]):
33
+ self.asset_id = asset_id
34
+ self.problems = problems
35
+ super().__init__(
36
+ f"Contract violations for '{asset_id}':\n - " + "\n - ".join(problems)
37
+ )
38
+
39
+
40
+ def _verify_contract(manifest: OnboardingManifest, schema: AssetSchema) -> list[str]:
41
+ problems = []
42
+ for spec in manifest.contract.fields:
43
+ actual = schema.field(spec.name)
44
+ if actual is None:
45
+ problems.append(f"declared field '{spec.name}' not found in source")
46
+ continue
47
+ if spec.type is not None and actual.type != spec.type:
48
+ problems.append(
49
+ f"field '{spec.name}': declared type {spec.type.value},"
50
+ f" source has {actual.type.value}"
51
+ )
52
+ if spec.required and actual.nullable:
53
+ problems.append(f"field '{spec.name}' declared required but is nullable in source")
54
+ return problems
55
+
56
+
57
+ def _apply_contract_metadata(manifest: OnboardingManifest, schema: AssetSchema) -> None:
58
+ for spec in manifest.contract.fields:
59
+ actual = schema.field(spec.name)
60
+ if actual and spec.pii:
61
+ actual.pii = True
62
+
63
+
64
+ @dataclass
65
+ class RegistrationResult:
66
+ descriptor: AssetDescriptor
67
+ descriptor_path: Path
68
+ catalog_backends: list[str] = field(default_factory=list)
69
+ governance_backends: list[str] = field(default_factory=list)
70
+
71
+
72
+ def register(
73
+ manifest: OnboardingManifest,
74
+ catalog_dir: str | Path,
75
+ *,
76
+ catalog_backends: list[CatalogBackend] | None = None,
77
+ governance_backends: list[GovernanceBackend] | None = None,
78
+ ) -> RegistrationResult:
79
+ connector = get_connector(manifest.source.connector)
80
+ schema = connector.introspect(manifest.source.uri, manifest.source.native_name)
81
+
82
+ problems = _verify_contract(manifest, schema)
83
+ if problems:
84
+ raise ContractViolation(manifest.asset_id, problems)
85
+ _apply_contract_metadata(manifest, schema)
86
+
87
+ descriptor = AssetDescriptor(
88
+ id=manifest.asset_id,
89
+ name=manifest.asset.name,
90
+ description=manifest.asset.description,
91
+ owner=manifest.asset.owner,
92
+ domain=manifest.asset.domain,
93
+ tags=manifest.asset.tags,
94
+ classification=manifest.asset.classification,
95
+ source=manifest.source,
96
+ schema=schema,
97
+ contract=manifest.contract,
98
+ access=manifest.access,
99
+ enablement=manifest.enablement,
100
+ custom_properties=manifest.custom_properties,
101
+ )
102
+ path = save_descriptor(descriptor, catalog_dir)
103
+
104
+ result = RegistrationResult(descriptor=descriptor, descriptor_path=path)
105
+ # Governance first: catalog backends in ingest mode (OM <- Glue ingestion)
106
+ # depend on the governed asset already existing.
107
+ for backend in governance_backends or []:
108
+ backend.apply(descriptor)
109
+ result.governance_backends.append(backend.name)
110
+ for backend in catalog_backends or []:
111
+ backend.upsert_asset(descriptor)
112
+ result.catalog_backends.append(backend.name)
113
+ return result
114
+
115
+
116
+ def discover(
117
+ uri: str,
118
+ *,
119
+ connector_scheme: str | None = None,
120
+ source_name: str | None = None,
121
+ domain: str = "unassigned",
122
+ classification: Classification = Classification.internal,
123
+ ) -> list[OnboardingManifest]:
124
+ """Draft one Onboarding Manifest per asset found at `uri`, for human review."""
125
+ from tabella_core.connectors import scheme_of
126
+
127
+ scheme = connector_scheme or scheme_of(uri)
128
+ connector = get_connector(scheme)
129
+ source = source_name or connector.source_name(uri)
130
+ return [
131
+ OnboardingManifest(
132
+ asset=AssetMeta(
133
+ name=slug(native_name),
134
+ description=None,
135
+ domain=domain,
136
+ classification=classification,
137
+ ),
138
+ source=SourceRef(
139
+ connector=scheme, name=source, uri=uri, native_name=native_name
140
+ ),
141
+ )
142
+ for native_name in connector.list_assets(uri)
143
+ ]
tabella_core/store.py ADDED
@@ -0,0 +1,30 @@
1
+ """Local catalog store: a directory of `<id>.json` Asset Descriptors.
2
+
3
+ This is the reference catalog — portable, diffable, no external dependency.
4
+ Catalog backends (OpenMetadata) mirror it; they never replace it.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ from pathlib import Path
11
+
12
+ from tabella_core.models import AssetDescriptor
13
+
14
+
15
+ def save_descriptor(descriptor: AssetDescriptor, directory: str | Path) -> Path:
16
+ directory = Path(directory)
17
+ directory.mkdir(parents=True, exist_ok=True)
18
+ path = directory / f"{descriptor.id}.json"
19
+ path.write_text(json.dumps(descriptor.to_json_dict(), indent=2) + "\n")
20
+ return path
21
+
22
+
23
+ def load_catalog(directory: str | Path) -> list[AssetDescriptor]:
24
+ directory = Path(directory)
25
+ if not directory.is_dir():
26
+ raise FileNotFoundError(f"Catalog directory not found: {directory}")
27
+ return [
28
+ AssetDescriptor.model_validate(json.loads(p.read_text()))
29
+ for p in sorted(directory.glob("*.json"))
30
+ ]
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.5
2
+ Name: tabella-core
3
+ Version: 0.1.0
4
+ Summary: Tabella core: spec models, connector SDK, backend interfaces, registration pipeline
5
+ Project-URL: Homepage, https://github.com/Inceptium-ai/tabella
6
+ Project-URL: Repository, https://github.com/Inceptium-ai/tabella
7
+ Project-URL: Issues, https://github.com/Inceptium-ai/tabella/issues
8
+ Author: Yazdan Ahmed
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: pydantic>=2.7
21
+ Requires-Dist: pyyaml>=6.0
22
+ Description-Content-Type: text/markdown
23
+
24
+ # tabella-core
25
+
26
+ Models for the Tabella spec artifacts (Onboarding Manifest, Asset Descriptor),
27
+ the connector SDK and registry, pluggable backend interfaces (catalog,
28
+ governance, embeddings), and the registration pipeline. See `../../spec/`.
@@ -0,0 +1,11 @@
1
+ tabella_core/__init__.py,sha256=WXHDrntvMVNKZ4P_oRNqGmjRwzt_RHBGExJUMMngPNI,308
2
+ tabella_core/connectors.py,sha256=uQ12gtvHauxqFdkmsC4dn1xH_FH_i6Nijbp9R2i9kFk,2105
3
+ tabella_core/interfaces.py,sha256=SnAAP3BjBd0GDmLjEwNsPmM7DOkg-AnB5Q169YosPYY,1774
4
+ tabella_core/manifest.py,sha256=NXFaGJ4hR7iHvfZv4-2ataEn72W_q5SsXCwFpXnYpaI,692
5
+ tabella_core/models.py,sha256=P4UBYlc_8g4E5M8cgjREvdzYVxNFiTEeGeVIUEEnmdo,4708
6
+ tabella_core/pipeline.py,sha256=wNKgJtiW0WtX49SEyByR2HLE03Xb6wW4udEYXcqPorY,4887
7
+ tabella_core/store.py,sha256=VGOMxSycCKJlC_KwSUNY2q0BgFiHgjeu-LR9bEikzeg,988
8
+ tabella_core-0.1.0.dist-info/METADATA,sha256=GEV62E-zri7GzSfLG8UY_2Skqr6gh97qy_qbtetHV6c,1170
9
+ tabella_core-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
10
+ tabella_core-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
11
+ tabella_core-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.