openmarkets 0.1.0.dev48__tar.gz → 0.1.0.dev52__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.
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.pre-commit-config.yaml +3 -3
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/PKG-INFO +1 -1
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/_version.py +2 -2
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/options.py +28 -3
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.editorconfig +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.gitattributes +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.github/CODEOWNERS +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.gitignore +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/.python-version +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/CITATION.cff +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/LICENSE +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/README.md +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/pyproject.toml +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/__init__.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/py.typed +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/server.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/__init__.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/analyst_data.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/calendar.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/corporate_actions.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/crypto.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/extended_market.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/financial_statements.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/funds.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/historical_data.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/market_data.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/news.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/screener.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/stock_info.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/technical_analysis.py +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/__init__.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/base.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/cache.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/const.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/data.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/domain/__init__.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/domain/domain.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/domain/industry.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/domain/market.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/domain/sector.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/exceptions.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/live.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/lookup.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/multi.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/pricing_pb2.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/__init__.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/analysis.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/fundamentals.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/funds.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/history.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/holders.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/quote.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/screener/__init__.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/screener/query.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/screener/screener.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/search.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/shared.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/ticker.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/tickers.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/utils.pyi +0 -0
- {openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/version.pyi +0 -0
|
@@ -9,12 +9,12 @@ default_install_hook_types:
|
|
|
9
9
|
|
|
10
10
|
repos:
|
|
11
11
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
12
|
-
rev: 0.7.
|
|
12
|
+
rev: 0.7.10
|
|
13
13
|
hooks:
|
|
14
14
|
- id: uv-sync
|
|
15
|
-
args: ["--
|
|
15
|
+
args: ["--all-packages"]
|
|
16
16
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
-
rev: v0.11.
|
|
17
|
+
rev: v0.11.12
|
|
18
18
|
hooks:
|
|
19
19
|
- id: ruff
|
|
20
20
|
args: [--fix, --exit-non-zero-on-fix]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openmarkets
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev52
|
|
4
4
|
Summary: A Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
|
|
5
5
|
Project-URL: Homepage, https://github.com/danchev/openmarkets
|
|
6
6
|
Project-URL: Issues, https://github.com/danchev/openmarkets/issues
|
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.1.0.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 1, 0, '
|
|
20
|
+
__version__ = version = '0.1.0.dev52'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 1, 0, 'dev52')
|
|
@@ -3,10 +3,34 @@
|
|
|
3
3
|
import json
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
+
import pandas as pd
|
|
6
7
|
import yfinance as yf
|
|
7
8
|
from mcp.server import FastMCP
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
class PandasTimestampEncoder(json.JSONEncoder):
|
|
12
|
+
"""Custom JSON encoder to handle pandas Timestamp objects."""
|
|
13
|
+
|
|
14
|
+
def default(self, obj):
|
|
15
|
+
if isinstance(obj, pd.Timestamp):
|
|
16
|
+
return obj.isoformat()
|
|
17
|
+
return super().default(obj)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _safe_json_dumps(data, indent: Optional[int] = None) -> str:
|
|
21
|
+
"""Serialize data to a JSON string, converting pandas Timestamp objects to ISO format.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
data: The data to serialize.
|
|
25
|
+
indent: If not None, then JSON array elements and object members will be pretty-printed
|
|
26
|
+
with that indent level.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
JSON string.
|
|
30
|
+
"""
|
|
31
|
+
return json.dumps(data, cls=PandasTimestampEncoder, indent=indent)
|
|
32
|
+
|
|
33
|
+
|
|
10
34
|
def register_options_tools(mcp: FastMCP):
|
|
11
35
|
"""Register options tools with the MCP server."""
|
|
12
36
|
|
|
@@ -53,7 +77,8 @@ def register_options_tools(mcp: FastMCP):
|
|
|
53
77
|
"calls": option_chain.calls.to_dict("records") if hasattr(option_chain, "calls") else [],
|
|
54
78
|
"puts": option_chain.puts.to_dict("records") if hasattr(option_chain, "puts") else [],
|
|
55
79
|
}
|
|
56
|
-
|
|
80
|
+
|
|
81
|
+
return _safe_json_dumps(result, indent=2)
|
|
57
82
|
except Exception as e:
|
|
58
83
|
return json.dumps({"error": f"Failed to get options data: {str(e)}"})
|
|
59
84
|
|
|
@@ -95,7 +120,7 @@ def register_options_tools(mcp: FastMCP):
|
|
|
95
120
|
else None,
|
|
96
121
|
}
|
|
97
122
|
|
|
98
|
-
return
|
|
123
|
+
return _safe_json_dumps(analysis, indent=2)
|
|
99
124
|
except Exception as e:
|
|
100
125
|
return json.dumps({"error": f"Failed to analyze options data: {str(e)}"})
|
|
101
126
|
|
|
@@ -146,6 +171,6 @@ def register_options_tools(mcp: FastMCP):
|
|
|
146
171
|
"puts": filtered_puts.to_dict("records"),
|
|
147
172
|
}
|
|
148
173
|
|
|
149
|
-
return
|
|
174
|
+
return _safe_json_dumps(result, indent=2)
|
|
150
175
|
except Exception as e:
|
|
151
176
|
return json.dumps({"error": f"Failed to filter options data: {str(e)}"})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/corporate_actions.py
RENAMED
|
File without changes
|
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/extended_market.py
RENAMED
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/financial_statements.py
RENAMED
|
File without changes
|
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/historical_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/src/openmarkets/tools/technical_analysis.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openmarkets-0.1.0.dev48 → openmarkets-0.1.0.dev52}/typings/yfinance/scrapers/fundamentals.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|