datahub-agent-context 1.3.1.8__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.
Files changed (41) hide show
  1. datahub_agent_context-1.3.1.8/PKG-INFO +233 -0
  2. datahub_agent_context-1.3.1.8/README.md +171 -0
  3. datahub_agent_context-1.3.1.8/pyproject.toml +60 -0
  4. datahub_agent_context-1.3.1.8/setup.cfg +16 -0
  5. datahub_agent_context-1.3.1.8/setup.py +127 -0
  6. datahub_agent_context-1.3.1.8/src/datahub_agent_context/__init__.py +25 -0
  7. datahub_agent_context-1.3.1.8/src/datahub_agent_context/_version.py +16 -0
  8. datahub_agent_context-1.3.1.8/src/datahub_agent_context/context.py +97 -0
  9. datahub_agent_context-1.3.1.8/src/datahub_agent_context/langchain_tools/__init__.py +8 -0
  10. datahub_agent_context-1.3.1.8/src/datahub_agent_context/langchain_tools/builder.py +127 -0
  11. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/__init__.py +46 -0
  12. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/_token_estimator.py +71 -0
  13. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/base.py +325 -0
  14. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/descriptions.py +299 -0
  15. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/documents.py +473 -0
  16. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/domains.py +246 -0
  17. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/entities.py +349 -0
  18. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/get_me.py +99 -0
  19. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/__init__.py +13 -0
  20. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/document_search.gql +114 -0
  21. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/document_semantic_search.gql +111 -0
  22. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/entity_details.gql +1682 -0
  23. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/queries.gql +51 -0
  24. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/query_entity.gql +37 -0
  25. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/read_documents.gql +16 -0
  26. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/gql/search.gql +242 -0
  27. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/helpers.py +448 -0
  28. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/lineage.py +698 -0
  29. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/owners.py +318 -0
  30. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/queries.py +191 -0
  31. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/search.py +239 -0
  32. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/structured_properties.py +447 -0
  33. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/tags.py +296 -0
  34. datahub_agent_context-1.3.1.8/src/datahub_agent_context/mcp_tools/terms.py +295 -0
  35. datahub_agent_context-1.3.1.8/src/datahub_agent_context/py.typed +2 -0
  36. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/PKG-INFO +233 -0
  37. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/SOURCES.txt +40 -0
  38. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/dependency_links.txt +1 -0
  39. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/not-zip-safe +1 -0
  40. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/requires.txt +23 -0
  41. datahub_agent_context-1.3.1.8/src/datahub_agent_context.egg-info/top_level.txt +1 -0
@@ -0,0 +1,233 @@
1
+ Metadata-Version: 2.4
2
+ Name: datahub-agent-context
3
+ Version: 1.3.1.8
4
+ Summary: DataHub Agent Context - MCP Tools for AI Agents
5
+ Home-page: https://datahub.io/
6
+ License: Apache License 2.0
7
+ Project-URL: Documentation, https://datahubproject.io/docs/
8
+ Project-URL: Source, https://github.com/datahub-project/datahub
9
+ Project-URL: Changelog, https://github.com/datahub-project/datahub/releases
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Intended Audience :: Information Technology
21
+ Classifier: Intended Audience :: System Administrators
22
+ Classifier: License :: OSI Approved
23
+ Classifier: License :: OSI Approved :: Apache Software License
24
+ Classifier: Operating System :: Unix
25
+ Classifier: Operating System :: POSIX :: Linux
26
+ Classifier: Environment :: Console
27
+ Classifier: Environment :: MacOS X
28
+ Classifier: Topic :: Software Development
29
+ Requires-Python: >=3.9
30
+ Description-Content-Type: text/markdown
31
+ Requires-Dist: google-re2<2.0,>=1.0
32
+ Requires-Dist: cachetools<7.0.0,>=5.0.0
33
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
34
+ Requires-Dist: h11<1.0,>=0.16
35
+ Requires-Dist: json-repair<1.0.0,>=0.25.0
36
+ Requires-Dist: acryl-datahub==1.3.1.8
37
+ Requires-Dist: httpcore<2.0,>=1.0.9
38
+ Requires-Dist: jmespath<2.0.0,>=1.0.0
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest-cov<7.0.0,>=2.8.0; extra == "dev"
41
+ Requires-Dist: pytest<9.0.0,>=8.3.4; extra == "dev"
42
+ Requires-Dist: types-PyYAML<7.0.0,>=6.0.0; extra == "dev"
43
+ Requires-Dist: types-requests<3.0.0,>=2.0.0; extra == "dev"
44
+ Requires-Dist: types-jmespath<2.0.0,>=1.0.0; extra == "dev"
45
+ Requires-Dist: types-toml<1.0.0,>=0.10.0; extra == "dev"
46
+ Requires-Dist: types-cachetools<7.0.0,>=5.0.0; extra == "dev"
47
+ Requires-Dist: tox<5.0.0,>=4.0.0; extra == "dev"
48
+ Requires-Dist: mypy==1.17.1; extra == "dev"
49
+ Requires-Dist: ruff==0.11.7; extra == "dev"
50
+ Provides-Extra: langchain
51
+ Requires-Dist: langchain-core<2.0.0,>=1.2.7; extra == "langchain"
52
+ Dynamic: classifier
53
+ Dynamic: description
54
+ Dynamic: description-content-type
55
+ Dynamic: home-page
56
+ Dynamic: license
57
+ Dynamic: project-url
58
+ Dynamic: provides-extra
59
+ Dynamic: requires-dist
60
+ Dynamic: requires-python
61
+ Dynamic: summary
62
+
63
+ # DataHub Agent Context
64
+
65
+ **DataHub Agent Context** provides a collection of tools and utilities for building AI agents that interact with DataHub metadata. This package contains MCP (Model Context Protocol) tools that enable AI agents to search, retrieve, and manipulate metadata in DataHub. These can be used directly to create an agent, or be included in an MCP server such as Datahub's open source MCP server.
66
+
67
+ ## Features
68
+
69
+ ## Installation
70
+
71
+ ### Base Installation
72
+
73
+ ```shell
74
+ python3 -m pip install --upgrade pip wheel setuptools
75
+ python3 -m pip install --upgrade datahub-agent-context
76
+ ```
77
+
78
+ ### With LangChain Support
79
+
80
+ For building LangChain agents with pre-built tools:
81
+
82
+ ```shell
83
+ python3 -m pip install --upgrade "datahub-agent-context[langchain]"
84
+ ```
85
+
86
+ ## Prerequisites
87
+
88
+ This package requires:
89
+
90
+ - Python 3.9 or higher
91
+ - `acryl-datahub` package
92
+
93
+ ## Quick Start
94
+
95
+ ### Basic Example
96
+
97
+ These tools are designed to be used with an AI agent and have the responses passed directly to an LLM, so the return schema is a simple dict, but they can be used independently if desired.
98
+
99
+ ```python
100
+ from datahub.ingestion.graph.client import DataHubGraph
101
+ from datahub_agent_context.mcp_tools.search import search
102
+ from datahub_agent_context.mcp_tools.entities import get_entities
103
+
104
+ # Initialize DataHub graph client
105
+ client = DataHubClient.from_env()
106
+
107
+ # Search for datasets
108
+ with client.graph as graph:
109
+ results = search(
110
+ query="user_data",
111
+ filters={"entity_type": ["dataset"]},
112
+ num_results=10
113
+ )
114
+
115
+ # Get detailed entity information
116
+ with client.graph as graph:
117
+ entities = get_entities(
118
+ urns=[result["entity"]["urn"] for result in results["searchResults"]]
119
+ )
120
+ ```
121
+
122
+ ### LangChain Integration
123
+
124
+ Build AI agents with pre-built LangChain tools:
125
+
126
+ ```python
127
+ from datahub.sdk.main_client import DataHubClient
128
+ from datahub_agent_context.langchain_tools import build_langchain_tools
129
+ from langchain.agents import create_agent
130
+
131
+ # Initialize DataHub client
132
+ client = DataHubClient.from_env()
133
+
134
+ # Build all tools (read-only by default)
135
+ tools = build_langchain_tools(client, include_mutations=False)
136
+
137
+ # Or include mutation tools for tagging, descriptions, etc.
138
+ tools = build_langchain_tools(client, include_mutations=True)
139
+
140
+ # Create agent
141
+ agent = create_agent(model, tools=tools, system_prompt="...")
142
+ ```
143
+
144
+ **See [examples/langchain/](examples/langchain/)** for complete LangChain agent examples including:
145
+
146
+ - [simple_search.py](examples/langchain/simple_search.py) - Minimal example with AWS Bedrock
147
+
148
+ ### Available Tools
149
+
150
+ #### Search Tools
151
+
152
+ - `search()` - Search across all entity types with filters and sorting
153
+ - `search_documents()` - Search specifically for Document entities
154
+ - `grep_documents()` - Grep for patterns in document content
155
+
156
+ #### Entity Tools
157
+
158
+ - `get_entities()` - Get detailed information about entities by URN
159
+ - `list_schema_fields()` - List and filter schema fields for datasets
160
+
161
+ #### Lineage Tools
162
+
163
+ - `get_lineage()` - Get upstream or downstream lineage
164
+ - `get_lineage_paths_between()` - Get detailed paths between two entities
165
+
166
+ #### Query Tools
167
+
168
+ - `get_dataset_queries()` - Get SQL queries for datasets or columns
169
+
170
+ #### Mutation Tools
171
+
172
+ - `add_tags()`, `remove_tags()` - Manage tags
173
+ - `update_description()` - Update entity descriptions
174
+ - `set_domains()`, `remove_domains()` - Manage domains
175
+ - `add_owners()`, `remove_owners()` - Manage owners
176
+ - `add_glossary_terms()`, `remove_glossary_terms()` - Manage glossary terms
177
+ - `add_structured_properties()`, `remove_structured_properties()` - Manage structured properties
178
+
179
+ #### User Tools
180
+
181
+ - `get_me()` - Get information about the authenticated user
182
+
183
+ ## Architecture
184
+
185
+ The package is organized into the following modules:
186
+
187
+ - `mcp_tools/` - Core MCP tool implementations
188
+ - `base.py` - Base GraphQL execution and response cleaning
189
+ - `search.py` - Search functionality
190
+ - `documents.py` - Document search and grep
191
+ - `entities.py` - Entity retrieval
192
+ - `lineage.py` - Lineage querying
193
+ - `queries.py` - Query retrieval
194
+ - `tags.py`, `descriptions.py`, `domains.py`, etc. - Mutation tools
195
+ - `helpers.py` - Shared utility functions
196
+ - `gql/` - GraphQL query definitions
197
+
198
+ ## Development
199
+
200
+ ### Setup
201
+
202
+ ```shell
203
+ # Clone the repository
204
+ git clone https://github.com/datahub-project/datahub.git
205
+ cd datahub/datahub-agent-context
206
+
207
+ # Set up development environment
208
+ ./gradlew :datahub-agent-context:installDev
209
+
210
+ # Run tests
211
+ ./gradlew :datahub-agent-context:testQuick
212
+
213
+ # Run linting
214
+ ./gradlew :datahub-agent-context:lintFix
215
+ ```
216
+
217
+ ### Testing
218
+
219
+ The package includes comprehensive unit tests for all tools:
220
+
221
+ ```shell
222
+ # Run quick tests
223
+ ./gradlew :datahub-agent-context:testQuick
224
+
225
+ # Run full test suite
226
+ ./gradlew :datahub-agent-context:testFull
227
+ ```
228
+
229
+ ## Support
230
+
231
+ - [Documentation](https://datahubproject.io/docs/)
232
+ - [Slack Community](https://datahub.com/slack)
233
+ - [GitHub Issues](https://github.com/datahub-project/datahub/issues)
@@ -0,0 +1,171 @@
1
+ # DataHub Agent Context
2
+
3
+ **DataHub Agent Context** provides a collection of tools and utilities for building AI agents that interact with DataHub metadata. This package contains MCP (Model Context Protocol) tools that enable AI agents to search, retrieve, and manipulate metadata in DataHub. These can be used directly to create an agent, or be included in an MCP server such as Datahub's open source MCP server.
4
+
5
+ ## Features
6
+
7
+ ## Installation
8
+
9
+ ### Base Installation
10
+
11
+ ```shell
12
+ python3 -m pip install --upgrade pip wheel setuptools
13
+ python3 -m pip install --upgrade datahub-agent-context
14
+ ```
15
+
16
+ ### With LangChain Support
17
+
18
+ For building LangChain agents with pre-built tools:
19
+
20
+ ```shell
21
+ python3 -m pip install --upgrade "datahub-agent-context[langchain]"
22
+ ```
23
+
24
+ ## Prerequisites
25
+
26
+ This package requires:
27
+
28
+ - Python 3.9 or higher
29
+ - `acryl-datahub` package
30
+
31
+ ## Quick Start
32
+
33
+ ### Basic Example
34
+
35
+ These tools are designed to be used with an AI agent and have the responses passed directly to an LLM, so the return schema is a simple dict, but they can be used independently if desired.
36
+
37
+ ```python
38
+ from datahub.ingestion.graph.client import DataHubGraph
39
+ from datahub_agent_context.mcp_tools.search import search
40
+ from datahub_agent_context.mcp_tools.entities import get_entities
41
+
42
+ # Initialize DataHub graph client
43
+ client = DataHubClient.from_env()
44
+
45
+ # Search for datasets
46
+ with client.graph as graph:
47
+ results = search(
48
+ query="user_data",
49
+ filters={"entity_type": ["dataset"]},
50
+ num_results=10
51
+ )
52
+
53
+ # Get detailed entity information
54
+ with client.graph as graph:
55
+ entities = get_entities(
56
+ urns=[result["entity"]["urn"] for result in results["searchResults"]]
57
+ )
58
+ ```
59
+
60
+ ### LangChain Integration
61
+
62
+ Build AI agents with pre-built LangChain tools:
63
+
64
+ ```python
65
+ from datahub.sdk.main_client import DataHubClient
66
+ from datahub_agent_context.langchain_tools import build_langchain_tools
67
+ from langchain.agents import create_agent
68
+
69
+ # Initialize DataHub client
70
+ client = DataHubClient.from_env()
71
+
72
+ # Build all tools (read-only by default)
73
+ tools = build_langchain_tools(client, include_mutations=False)
74
+
75
+ # Or include mutation tools for tagging, descriptions, etc.
76
+ tools = build_langchain_tools(client, include_mutations=True)
77
+
78
+ # Create agent
79
+ agent = create_agent(model, tools=tools, system_prompt="...")
80
+ ```
81
+
82
+ **See [examples/langchain/](examples/langchain/)** for complete LangChain agent examples including:
83
+
84
+ - [simple_search.py](examples/langchain/simple_search.py) - Minimal example with AWS Bedrock
85
+
86
+ ### Available Tools
87
+
88
+ #### Search Tools
89
+
90
+ - `search()` - Search across all entity types with filters and sorting
91
+ - `search_documents()` - Search specifically for Document entities
92
+ - `grep_documents()` - Grep for patterns in document content
93
+
94
+ #### Entity Tools
95
+
96
+ - `get_entities()` - Get detailed information about entities by URN
97
+ - `list_schema_fields()` - List and filter schema fields for datasets
98
+
99
+ #### Lineage Tools
100
+
101
+ - `get_lineage()` - Get upstream or downstream lineage
102
+ - `get_lineage_paths_between()` - Get detailed paths between two entities
103
+
104
+ #### Query Tools
105
+
106
+ - `get_dataset_queries()` - Get SQL queries for datasets or columns
107
+
108
+ #### Mutation Tools
109
+
110
+ - `add_tags()`, `remove_tags()` - Manage tags
111
+ - `update_description()` - Update entity descriptions
112
+ - `set_domains()`, `remove_domains()` - Manage domains
113
+ - `add_owners()`, `remove_owners()` - Manage owners
114
+ - `add_glossary_terms()`, `remove_glossary_terms()` - Manage glossary terms
115
+ - `add_structured_properties()`, `remove_structured_properties()` - Manage structured properties
116
+
117
+ #### User Tools
118
+
119
+ - `get_me()` - Get information about the authenticated user
120
+
121
+ ## Architecture
122
+
123
+ The package is organized into the following modules:
124
+
125
+ - `mcp_tools/` - Core MCP tool implementations
126
+ - `base.py` - Base GraphQL execution and response cleaning
127
+ - `search.py` - Search functionality
128
+ - `documents.py` - Document search and grep
129
+ - `entities.py` - Entity retrieval
130
+ - `lineage.py` - Lineage querying
131
+ - `queries.py` - Query retrieval
132
+ - `tags.py`, `descriptions.py`, `domains.py`, etc. - Mutation tools
133
+ - `helpers.py` - Shared utility functions
134
+ - `gql/` - GraphQL query definitions
135
+
136
+ ## Development
137
+
138
+ ### Setup
139
+
140
+ ```shell
141
+ # Clone the repository
142
+ git clone https://github.com/datahub-project/datahub.git
143
+ cd datahub/datahub-agent-context
144
+
145
+ # Set up development environment
146
+ ./gradlew :datahub-agent-context:installDev
147
+
148
+ # Run tests
149
+ ./gradlew :datahub-agent-context:testQuick
150
+
151
+ # Run linting
152
+ ./gradlew :datahub-agent-context:lintFix
153
+ ```
154
+
155
+ ### Testing
156
+
157
+ The package includes comprehensive unit tests for all tools:
158
+
159
+ ```shell
160
+ # Run quick tests
161
+ ./gradlew :datahub-agent-context:testQuick
162
+
163
+ # Run full test suite
164
+ ./gradlew :datahub-agent-context:testFull
165
+ ```
166
+
167
+ ## Support
168
+
169
+ - [Documentation](https://datahubproject.io/docs/)
170
+ - [Slack Community](https://datahub.com/slack)
171
+ - [GitHub Issues](https://github.com/datahub-project/datahub/issues)
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = ["setuptools>=78.1.1", "wheel>0.38.1", "pip>=21.0.0"]
4
+
5
+ [tool.ruff]
6
+ line-length = 88
7
+ target-version = "py39"
8
+ exclude = [
9
+ ".git",
10
+ "venv",
11
+ ".tox",
12
+ "__pycache__",
13
+ ]
14
+
15
+ [tool.ruff.format]
16
+ quote-style = "double"
17
+ indent-style = "space"
18
+ skip-magic-trailing-comma = false
19
+ line-ending = "auto"
20
+
21
+ [tool.ruff.lint.isort]
22
+ combine-as-imports = true
23
+ known-first-party = ["datahub", "datahub_agent_context"]
24
+ extra-standard-library = ["__future__"]
25
+ section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
26
+ force-sort-within-sections = false
27
+ force-wrap-aliases = false
28
+ split-on-trailing-comma = false
29
+ order-by-type = true
30
+ relative-imports-order = "closest-to-furthest"
31
+ force-single-line = false
32
+ single-line-exclusions = ["typing"]
33
+ length-sort = false
34
+ from-first = false
35
+ required-imports = []
36
+ classes = ["typing"]
37
+
38
+ [tool.ruff.lint]
39
+ extend-select = [
40
+ "B", # flake8-bugbear
41
+ "C90", # mccabe complexity
42
+ "E", # pycodestyle errors
43
+ "F", # pyflakes
44
+ "G010", # logging.warn -> logging.warning
45
+ "I", # isort
46
+ "TID", # flake8-tidy-imports
47
+ "RUF100", # unused-noqa
48
+ ]
49
+ ignore = [
50
+ "E501", # Line length violations (handled by formatter)
51
+ ]
52
+
53
+ [tool.ruff.lint.mccabe]
54
+ max-complexity = 15
55
+
56
+ [tool.ruff.lint.flake8-tidy-imports]
57
+ ban-relative-imports = "all"
58
+
59
+ [tool.ruff.lint.per-file-ignores]
60
+ "__init__.py" = ["F401"]
@@ -0,0 +1,16 @@
1
+ [metadata]
2
+ license_files = LICENSE
3
+
4
+ [mypy]
5
+ plugins = pydantic.mypy
6
+ exclude = venv/
7
+
8
+ [tool:pytest]
9
+ addopts = --cov=src --cov-report=html --cov-report=term
10
+ testpaths = tests
11
+ asyncio_mode = auto
12
+
13
+ [egg_info]
14
+ tag_build =
15
+ tag_date = 0
16
+
@@ -0,0 +1,127 @@
1
+ # Copyright 2025 Acryl Data, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import os
16
+ from typing import Dict, Set
17
+
18
+ import setuptools
19
+
20
+ package_metadata: dict = {}
21
+ with open("./src/datahub_agent_context/_version.py") as fp:
22
+ exec(fp.read(), package_metadata)
23
+
24
+ _version: str = package_metadata["__version__"]
25
+ _self_pin = (
26
+ f"=={_version}"
27
+ if not (_version.endswith(("dev0", "dev1")) or "docker" in _version)
28
+ else ""
29
+ )
30
+
31
+
32
+ def get_long_description():
33
+ root = os.path.dirname(__file__)
34
+ with open(os.path.join(root, "README.md")) as f:
35
+ description = f.read()
36
+
37
+ return description
38
+
39
+
40
+ lint_requirements = {
41
+ # This is pinned only to avoid spurious errors in CI.
42
+ # We should make an effort to keep it up to date.
43
+ "ruff==0.11.7",
44
+ "mypy==1.17.1",
45
+ }
46
+
47
+ base_requirements = {
48
+ f"acryl-datahub{_self_pin}",
49
+ # Core dependencies for MCP tools
50
+ "pydantic>=2.0.0,<3.0.0",
51
+ "json-repair>=0.25.0,<1.0.0",
52
+ "jmespath>=1.0.0,<2.0.0",
53
+ "cachetools>=5.0.0,<7.0.0",
54
+ "google-re2>=1.0,<2.0", # Required for documents grep functionality
55
+ # Lower bounds on httpcore and h11 due to CVE-2025-43859.
56
+ "httpcore>=1.0.9,<2.0",
57
+ "h11>=0.16,<1.0",
58
+ }
59
+
60
+ mypy_stubs = {
61
+ "types-cachetools>=5.0.0,<7.0.0",
62
+ "types-PyYAML>=6.0.0,<7.0.0",
63
+ "types-requests>=2.0.0,<3.0.0",
64
+ "types-toml>=0.10.0,<1.0.0",
65
+ "types-jmespath>=1.0.0,<2.0.0",
66
+ }
67
+
68
+ langchain_requirements = {
69
+ "langchain-core>=1.2.7,<2.0.0",
70
+ }
71
+
72
+ dev_requirements = {
73
+ *lint_requirements,
74
+ *mypy_stubs,
75
+ "pytest>=8.3.4,<9.0.0",
76
+ "pytest-cov>=2.8.0,<7.0.0",
77
+ "tox>=4.0.0,<5.0.0",
78
+ }
79
+
80
+ setuptools.setup(
81
+ name=package_metadata["__package_name__"],
82
+ version=package_metadata["__version__"],
83
+ url="https://datahub.io/",
84
+ project_urls={
85
+ "Documentation": "https://datahubproject.io/docs/",
86
+ "Source": "https://github.com/datahub-project/datahub",
87
+ "Changelog": "https://github.com/datahub-project/datahub/releases",
88
+ },
89
+ license="Apache License 2.0",
90
+ description="DataHub Agent Context - MCP Tools for AI Agents",
91
+ long_description=get_long_description(),
92
+ long_description_content_type="text/markdown",
93
+ classifiers=[
94
+ "Development Status :: 5 - Production/Stable",
95
+ "Programming Language :: Python",
96
+ "Programming Language :: Python :: 3",
97
+ "Programming Language :: Python :: 3 :: Only",
98
+ "Programming Language :: Python :: 3.9",
99
+ "Programming Language :: Python :: 3.10",
100
+ "Programming Language :: Python :: 3.11",
101
+ "Programming Language :: Python :: 3.12",
102
+ "Programming Language :: Python :: 3.13",
103
+ "Intended Audience :: Developers",
104
+ "Intended Audience :: Information Technology",
105
+ "Intended Audience :: System Administrators",
106
+ "License :: OSI Approved",
107
+ "License :: OSI Approved :: Apache Software License",
108
+ "Operating System :: Unix",
109
+ "Operating System :: POSIX :: Linux",
110
+ "Environment :: Console",
111
+ "Environment :: MacOS X",
112
+ "Topic :: Software Development",
113
+ ],
114
+ packages=setuptools.find_namespace_packages(where="./src"),
115
+ package_dir={"": "src"},
116
+ package_data={
117
+ "datahub_agent_context": ["py.typed"],
118
+ "datahub_agent_context.mcp_tools": ["gql/*.gql"],
119
+ },
120
+ python_requires=">=3.9",
121
+ zip_safe=False,
122
+ install_requires=list(base_requirements),
123
+ extras_require={
124
+ "dev": list(dev_requirements),
125
+ "langchain": list(langchain_requirements),
126
+ },
127
+ )
@@ -0,0 +1,25 @@
1
+ # Copyright 2025 Acryl Data, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """DataHub Agent Context - MCP Tools for AI Agents."""
16
+
17
+ from datahub_agent_context._version import __version__
18
+ from datahub_agent_context.context import (
19
+ DataHubContext,
20
+ get_graph,
21
+ reset_graph,
22
+ set_graph,
23
+ )
24
+
25
+ __all__ = ["__version__", "DataHubContext", "get_graph", "set_graph", "reset_graph"]
@@ -0,0 +1,16 @@
1
+ # Copyright 2025 Acryl Data, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ __package_name__ = "datahub-agent-context"
16
+ __version__ = "1.3.1.8"