gildea 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.
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .eggs/
7
+ *.egg
8
+ .env
9
+ .venv/
10
+ venv/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .mypy_cache/
14
+ *.log
15
+ .DS_Store
gildea-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.4
2
+ Name: gildea
3
+ Version: 0.1.0
4
+ Summary: Python client and MCP server for the Gildea AI market intelligence API
5
+ Project-URL: Homepage, https://gildea.ai
6
+ Project-URL: Documentation, https://docs.gildea.ai
7
+ Project-URL: Repository, https://github.com/hjones20/gildea-api
8
+ Project-URL: Issues, https://github.com/hjones20/gildea-api/issues
9
+ Author: Holly Jones
10
+ License-Expression: MIT
11
+ Keywords: ai,api-client,competitive-intelligence,market-intelligence,mcp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.9
22
+ Requires-Dist: httpx>=0.27
23
+ Provides-Extra: dev
24
+ Requires-Dist: mcp[server]>=1.3; extra == 'dev'
25
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
26
+ Requires-Dist: pytest-httpx>=0.35; extra == 'dev'
27
+ Requires-Dist: pytest>=8; extra == 'dev'
28
+ Requires-Dist: ruff>=0.15; extra == 'dev'
29
+ Provides-Extra: mcp
30
+ Requires-Dist: mcp[server]>=1.3; extra == 'mcp'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Gildea
34
+
35
+ Python client and MCP server for the [Gildea](https://gildea.ai) AI market intelligence API.
36
+
37
+ Gildea tracks 500+ expert sources on AI, decomposes every signal into verified reasoning chains (thesis, arguments, claims, evidence), and serves it through a REST API. This package gives you a Python client and an MCP server so AI assistants can use the data directly.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ # Python client only
43
+ pip install gildea
44
+
45
+ # With MCP server
46
+ pip install gildea[mcp]
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```python
52
+ from gildea_sdk import Gildea
53
+
54
+ client = Gildea(api_key="gld_your_key_here")
55
+
56
+ # Search verified text units
57
+ results = client.search.query(q="data center infrastructure spending")
58
+ for hit in results.data:
59
+ print(f"{hit.unit.text}")
60
+ print(f" Source: {hit.citation.signal_title} ({hit.citation.registrable_domain})")
61
+
62
+ # Get full signal decomposition with evidence
63
+ signal = client.signals.get("signal_id", include="evidence")
64
+
65
+ # Entity intelligence with trend analytics
66
+ entity = client.entities.get("NVIDIA")
67
+ print(f"{entity.display_name}: {entity.direction}, {entity.scale} scale, {entity.priority} priority")
68
+
69
+ # Cross-source consensus mapping
70
+ similar = client.search.query(similar_to="unit_id")
71
+ ```
72
+
73
+ ## MCP Server
74
+
75
+ Use Gildea as a tool in Claude, ChatGPT, Cursor, VS Code, or any MCP-compatible client.
76
+
77
+ ```bash
78
+ # Run directly
79
+ gildea-mcp
80
+
81
+ # Or via uvx (no install needed)
82
+ uvx --from gildea[mcp] gildea-mcp
83
+ ```
84
+
85
+ Set your API key:
86
+ ```bash
87
+ export GILDEA_API_KEY=gld_your_key_here
88
+ ```
89
+
90
+ ### Claude Desktop
91
+
92
+ Add to your `claude_desktop_config.json`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "gildea": {
98
+ "command": "uvx",
99
+ "args": ["--from", "gildea[mcp]", "gildea-mcp"],
100
+ "env": {
101
+ "GILDEA_API_KEY": "gld_your_key_here"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ ### Available MCP Tools
109
+
110
+ | Tool | Description |
111
+ |------|-------------|
112
+ | `search_text_units` | Semantic search across verified text units, or vector similarity via `similar_to` |
113
+ | `list_signals` | Browse signals by entity, theme, date, content type |
114
+ | `get_signal_detail` | Full decomposition: thesis, arguments, claims, evidence |
115
+ | `get_entity_profile` | Entity trend analytics, co-occurrence, theme distribution |
116
+ | `list_entities` | Discover entities by trend direction, priority, scale |
117
+ | `get_themes` | Theme overview across value chain and market force axes |
118
+ | `get_theme_detail` | Single theme trend analytics and cross-theme relationships |
119
+
120
+ ## API Key
121
+
122
+ Get your API key at [gildea.ai](https://gildea.ai). Free tier includes 5 requests/minute and 200 requests/month.
123
+
124
+ ## Documentation
125
+
126
+ Full API docs at [docs.gildea.ai](https://docs.gildea.ai).
127
+
128
+ ## License
129
+
130
+ MIT
gildea-0.1.0/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # Gildea
2
+
3
+ Python client and MCP server for the [Gildea](https://gildea.ai) AI market intelligence API.
4
+
5
+ Gildea tracks 500+ expert sources on AI, decomposes every signal into verified reasoning chains (thesis, arguments, claims, evidence), and serves it through a REST API. This package gives you a Python client and an MCP server so AI assistants can use the data directly.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # Python client only
11
+ pip install gildea
12
+
13
+ # With MCP server
14
+ pip install gildea[mcp]
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```python
20
+ from gildea_sdk import Gildea
21
+
22
+ client = Gildea(api_key="gld_your_key_here")
23
+
24
+ # Search verified text units
25
+ results = client.search.query(q="data center infrastructure spending")
26
+ for hit in results.data:
27
+ print(f"{hit.unit.text}")
28
+ print(f" Source: {hit.citation.signal_title} ({hit.citation.registrable_domain})")
29
+
30
+ # Get full signal decomposition with evidence
31
+ signal = client.signals.get("signal_id", include="evidence")
32
+
33
+ # Entity intelligence with trend analytics
34
+ entity = client.entities.get("NVIDIA")
35
+ print(f"{entity.display_name}: {entity.direction}, {entity.scale} scale, {entity.priority} priority")
36
+
37
+ # Cross-source consensus mapping
38
+ similar = client.search.query(similar_to="unit_id")
39
+ ```
40
+
41
+ ## MCP Server
42
+
43
+ Use Gildea as a tool in Claude, ChatGPT, Cursor, VS Code, or any MCP-compatible client.
44
+
45
+ ```bash
46
+ # Run directly
47
+ gildea-mcp
48
+
49
+ # Or via uvx (no install needed)
50
+ uvx --from gildea[mcp] gildea-mcp
51
+ ```
52
+
53
+ Set your API key:
54
+ ```bash
55
+ export GILDEA_API_KEY=gld_your_key_here
56
+ ```
57
+
58
+ ### Claude Desktop
59
+
60
+ Add to your `claude_desktop_config.json`:
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "gildea": {
66
+ "command": "uvx",
67
+ "args": ["--from", "gildea[mcp]", "gildea-mcp"],
68
+ "env": {
69
+ "GILDEA_API_KEY": "gld_your_key_here"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### Available MCP Tools
77
+
78
+ | Tool | Description |
79
+ |------|-------------|
80
+ | `search_text_units` | Semantic search across verified text units, or vector similarity via `similar_to` |
81
+ | `list_signals` | Browse signals by entity, theme, date, content type |
82
+ | `get_signal_detail` | Full decomposition: thesis, arguments, claims, evidence |
83
+ | `get_entity_profile` | Entity trend analytics, co-occurrence, theme distribution |
84
+ | `list_entities` | Discover entities by trend direction, priority, scale |
85
+ | `get_themes` | Theme overview across value chain and market force axes |
86
+ | `get_theme_detail` | Single theme trend analytics and cross-theme relationships |
87
+
88
+ ## API Key
89
+
90
+ Get your API key at [gildea.ai](https://gildea.ai). Free tier includes 5 requests/minute and 200 requests/month.
91
+
92
+ ## Documentation
93
+
94
+ Full API docs at [docs.gildea.ai](https://docs.gildea.ai).
95
+
96
+ ## License
97
+
98
+ MIT
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "gildea"
7
+ version = "0.1.0"
8
+ description = "Python client and MCP server for the Gildea AI market intelligence API"
9
+ requires-python = ">=3.9"
10
+ license = "MIT"
11
+ authors = [{name = "Holly Jones"}]
12
+ readme = "README.md"
13
+ keywords = ["ai", "market-intelligence", "mcp", "api-client", "competitive-intelligence"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ ]
25
+ dependencies = ["httpx>=0.27"]
26
+
27
+ [project.urls]
28
+ Homepage = "https://gildea.ai"
29
+ Documentation = "https://docs.gildea.ai"
30
+ Repository = "https://github.com/hjones20/gildea-api"
31
+ Issues = "https://github.com/hjones20/gildea-api/issues"
32
+
33
+ [project.optional-dependencies]
34
+ mcp = ["mcp[server]>=1.3"]
35
+ dev = ["pytest>=8", "pytest-httpx>=0.35", "pytest-asyncio>=0.24", "mcp[server]>=1.3", "ruff>=0.15"]
36
+
37
+ [project.scripts]
38
+ gildea-mcp = "gildea_sdk.mcp.server:main"
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["src/gildea_sdk"]
42
+
43
+ [tool.ruff]
44
+ target-version = "py39"
45
+
46
+ [tool.pytest.ini_options]
47
+ asyncio_mode = "auto"
48
+ testpaths = ["tests"]
@@ -0,0 +1,21 @@
1
+ """Gildea Python SDK — client for the Gildea AI market intelligence API."""
2
+
3
+ from .client import Gildea
4
+ from .exceptions import (
5
+ APIError,
6
+ AuthenticationError,
7
+ BadRequestError,
8
+ GildeaError,
9
+ NotFoundError,
10
+ RateLimitError,
11
+ )
12
+
13
+ __all__ = [
14
+ "Gildea",
15
+ "GildeaError",
16
+ "AuthenticationError",
17
+ "NotFoundError",
18
+ "RateLimitError",
19
+ "BadRequestError",
20
+ "APIError",
21
+ ]
@@ -0,0 +1,49 @@
1
+ """Main Gildea client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+
7
+ import httpx
8
+
9
+ from .exceptions import AuthenticationError
10
+ from .resources import EntitiesResource, SearchResource, SignalsResource, ThemesResource
11
+
12
+
13
+ class Gildea:
14
+ """Synchronous client for the Gildea AI market intelligence API."""
15
+
16
+ def __init__(self, api_key=None, base_url="https://api.gildea.ai", timeout=30.0):
17
+ self.api_key = api_key or os.environ.get("GILDEA_API_KEY")
18
+ if not self.api_key:
19
+ raise AuthenticationError(
20
+ "No API key provided. Set GILDEA_API_KEY or pass api_key=."
21
+ )
22
+ self._client = httpx.Client(
23
+ base_url=base_url,
24
+ headers={"X-API-Key": self.api_key},
25
+ timeout=timeout,
26
+ )
27
+ self.signals = SignalsResource(self._client)
28
+ self.entities = EntitiesResource(self._client)
29
+ self.themes = ThemesResource(self._client)
30
+ self._search = SearchResource(self._client)
31
+
32
+ def search(self, query=None, *, similar_to=None, **kwargs):
33
+ """Search across all verified text units.
34
+
35
+ Two modes: pass ``query`` for hybrid semantic + keyword search,
36
+ or ``similar_to`` with a text unit ID for pure vector similarity.
37
+ Exactly one is required.
38
+ """
39
+ return self._search.query(query, similar_to=similar_to, **kwargs)
40
+
41
+ def close(self):
42
+ """Close the underlying HTTP connection."""
43
+ self._client.close()
44
+
45
+ def __enter__(self):
46
+ return self
47
+
48
+ def __exit__(self, *args):
49
+ self.close()
@@ -0,0 +1,34 @@
1
+ """Exception classes for the Gildea SDK."""
2
+
3
+
4
+ class GildeaError(Exception):
5
+ """Base exception for all Gildea SDK errors."""
6
+
7
+ def __init__(self, message, *, code=None, status=None):
8
+ super().__init__(message)
9
+ self.code = code
10
+ self.status = status
11
+
12
+
13
+ class AuthenticationError(GildeaError):
14
+ """Raised on 401/403 responses or missing API key."""
15
+
16
+
17
+ class NotFoundError(GildeaError):
18
+ """Raised on 404 responses."""
19
+
20
+
21
+ class RateLimitError(GildeaError):
22
+ """Raised on 429 responses."""
23
+
24
+ def __init__(self, message, *, code=None, status=None, retry_after=None):
25
+ super().__init__(message, code=code, status=status)
26
+ self.retry_after = retry_after
27
+
28
+
29
+ class BadRequestError(GildeaError):
30
+ """Raised on 400 responses."""
31
+
32
+
33
+ class APIError(GildeaError):
34
+ """Raised on 5xx or other unexpected responses."""
File without changes
@@ -0,0 +1,5 @@
1
+ """Allow running MCP server as: python -m gildea_sdk.mcp"""
2
+
3
+ from gildea_sdk.mcp.server import main
4
+
5
+ main()