parsimony-core 0.1.0a1__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.
- parsimony_core-0.1.0a1/.gitignore +54 -0
- parsimony_core-0.1.0a1/CHANGELOG.md +71 -0
- parsimony_core-0.1.0a1/LICENSE +190 -0
- parsimony_core-0.1.0a1/PKG-INFO +184 -0
- parsimony_core-0.1.0a1/README.md +127 -0
- parsimony_core-0.1.0a1/parsimony/__init__.py +162 -0
- parsimony_core-0.1.0a1/parsimony/catalog/__init__.py +43 -0
- parsimony_core-0.1.0a1/parsimony/catalog/builder.py +128 -0
- parsimony_core-0.1.0a1/parsimony/catalog/catalog.py +478 -0
- parsimony_core-0.1.0a1/parsimony/catalog/identity_from_params.py +73 -0
- parsimony_core-0.1.0a1/parsimony/catalog/models.py +181 -0
- parsimony_core-0.1.0a1/parsimony/connector.py +760 -0
- parsimony_core-0.1.0a1/parsimony/connectors/__init__.py +184 -0
- parsimony_core-0.1.0a1/parsimony/connectors/alpha_vantage.py +2260 -0
- parsimony_core-0.1.0a1/parsimony/connectors/bde.py +285 -0
- parsimony_core-0.1.0a1/parsimony/connectors/bdf.py +218 -0
- parsimony_core-0.1.0a1/parsimony/connectors/bdp.py +285 -0
- parsimony_core-0.1.0a1/parsimony/connectors/bls.py +261 -0
- parsimony_core-0.1.0a1/parsimony/connectors/boc.py +219 -0
- parsimony_core-0.1.0a1/parsimony/connectors/boj.py +302 -0
- parsimony_core-0.1.0a1/parsimony/connectors/coingecko.py +915 -0
- parsimony_core-0.1.0a1/parsimony/connectors/destatis.py +275 -0
- parsimony_core-0.1.0a1/parsimony/connectors/eia.py +168 -0
- parsimony_core-0.1.0a1/parsimony/connectors/eodhd.py +1038 -0
- parsimony_core-0.1.0a1/parsimony/connectors/financial_reports.py +704 -0
- parsimony_core-0.1.0a1/parsimony/connectors/finnhub.py +848 -0
- parsimony_core-0.1.0a1/parsimony/connectors/fmp.py +993 -0
- parsimony_core-0.1.0a1/parsimony/connectors/fmp_screener.py +552 -0
- parsimony_core-0.1.0a1/parsimony/connectors/fred.py +292 -0
- parsimony_core-0.1.0a1/parsimony/connectors/polymarket.py +159 -0
- parsimony_core-0.1.0a1/parsimony/connectors/rba.py +370 -0
- parsimony_core-0.1.0a1/parsimony/connectors/riksbank.py +239 -0
- parsimony_core-0.1.0a1/parsimony/connectors/sdmx.py +795 -0
- parsimony_core-0.1.0a1/parsimony/connectors/sec_edgar.py +913 -0
- parsimony_core-0.1.0a1/parsimony/connectors/snb.py +305 -0
- parsimony_core-0.1.0a1/parsimony/connectors/tiingo.py +1063 -0
- parsimony_core-0.1.0a1/parsimony/connectors/treasury.py +211 -0
- parsimony_core-0.1.0a1/parsimony/embeddings/__init__.py +5 -0
- parsimony_core-0.1.0a1/parsimony/embeddings/litellm.py +117 -0
- parsimony_core-0.1.0a1/parsimony/errors.py +147 -0
- parsimony_core-0.1.0a1/parsimony/mcp/__init__.py +17 -0
- parsimony_core-0.1.0a1/parsimony/mcp/__main__.py +25 -0
- parsimony_core-0.1.0a1/parsimony/mcp/bridge.py +41 -0
- parsimony_core-0.1.0a1/parsimony/mcp/server.py +75 -0
- parsimony_core-0.1.0a1/parsimony/py.typed +0 -0
- parsimony_core-0.1.0a1/parsimony/result.py +402 -0
- parsimony_core-0.1.0a1/parsimony/stores/__init__.py +7 -0
- parsimony_core-0.1.0a1/parsimony/stores/catalog_store.py +66 -0
- parsimony_core-0.1.0a1/parsimony/stores/data_store.py +123 -0
- parsimony_core-0.1.0a1/parsimony/stores/memory_data.py +38 -0
- parsimony_core-0.1.0a1/parsimony/stores/sqlite_catalog.py +539 -0
- parsimony_core-0.1.0a1/parsimony/transport/__init__.py +7 -0
- parsimony_core-0.1.0a1/parsimony/transport/http.py +176 -0
- parsimony_core-0.1.0a1/parsimony/transport/json_helpers.py +89 -0
- parsimony_core-0.1.0a1/pyproject.toml +117 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
*.egg
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
ENV/
|
|
17
|
+
|
|
18
|
+
# Testing
|
|
19
|
+
.pytest_cache/
|
|
20
|
+
.coverage
|
|
21
|
+
htmlcov/
|
|
22
|
+
.tox/
|
|
23
|
+
.nox/
|
|
24
|
+
|
|
25
|
+
# Linting / type checking
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.ruff_cache/
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.idea/
|
|
31
|
+
.vscode/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# OS
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
39
|
+
|
|
40
|
+
# Environment variables
|
|
41
|
+
.env
|
|
42
|
+
.env.*
|
|
43
|
+
|
|
44
|
+
# Claude Code
|
|
45
|
+
.claude/
|
|
46
|
+
|
|
47
|
+
# Council reviews
|
|
48
|
+
.council/
|
|
49
|
+
|
|
50
|
+
# Internal planning documents
|
|
51
|
+
PLAN-*.md
|
|
52
|
+
|
|
53
|
+
# mkdocs build output
|
|
54
|
+
site/
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to parsimony will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Distribution name is now `parsimony-core` on PyPI.** The `parsimony` name on PyPI
|
|
12
|
+
is currently held by an unrelated squatted project. Import path is unchanged
|
|
13
|
+
(`from parsimony import ...`). The distribution will migrate to the bare `parsimony`
|
|
14
|
+
name once it becomes available; a shim `parsimony-core` will then depend on `parsimony`
|
|
15
|
+
for backwards compatibility.
|
|
16
|
+
- `pyproject.toml`: explicit `[tool.hatch.build.targets.wheel]` and `sdist` sections added
|
|
17
|
+
so the `parsimony/` package is unambiguously included in the built distributions.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `@loader` decorator for observation-persistence connectors
|
|
22
|
+
- `DataStore` abstract class and `InMemoryDataStore` implementation
|
|
23
|
+
- `LoadResult` statistics model for data loading
|
|
24
|
+
- MCP (Model Context Protocol) server integration (`parsimony.mcp`)
|
|
25
|
+
- Provider registry pattern (`ProviderSpec`) for declarative connector wiring
|
|
26
|
+
- `Connectors.filter()` for tag/property-based connector filtering
|
|
27
|
+
- `Connectors.to_llm()` and `Connector.to_llm()` for LLM-ready descriptions
|
|
28
|
+
- `Connector.describe()` for human-readable documentation
|
|
29
|
+
- `Result.to_table()` for late schema application
|
|
30
|
+
- `Result.entity_keys`, `Result.data_columns`, `Result.metadata_columns` accessors
|
|
31
|
+
- Arrow/Parquet serialization (`Result.to_arrow()`, `Result.to_parquet()`)
|
|
32
|
+
- `Namespace` annotation for catalog-aware parameter fields
|
|
33
|
+
- `Catalog` lazy namespace population (GitHub download + live enumerator fallback)
|
|
34
|
+
- `Catalog.embed_pending()` for backfilling embeddings
|
|
35
|
+
- Hybrid search (FTS5 BM25 + vec0 cosine via Reciprocal Rank Fusion) in `SQLiteCatalogStore`
|
|
36
|
+
- New connectors: CoinGecko, Finnhub, Tiingo, Alpha Vantage, EIA, BLS, US Treasury
|
|
37
|
+
- Central bank connectors: SNB, RBA, Riksbank, BDE, BOJ, BOC, BDP, BDF, Destatis
|
|
38
|
+
- Financial reports connector
|
|
39
|
+
- `Makefile` with common development commands
|
|
40
|
+
- `CLAUDE.md` for AI-assisted development conventions
|
|
41
|
+
- `py.typed` marker for PEP 561
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- `build_connectors_from_env()` now driven by declarative `PROVIDERS` registry
|
|
46
|
+
- Improved error messages for missing dependencies and validation failures
|
|
47
|
+
- `RateLimitError.retry_after` now validates against epoch timestamp misuse
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- `from parsimony import client` no longer crashes without API keys (uses `lenient=True`)
|
|
52
|
+
- Bare `Exception` catches narrowed to specific operational types (EC-1 convention)
|
|
53
|
+
- Fixed import ordering in riksbank, snb, coingecko, tiingo modules
|
|
54
|
+
- All ruff linting issues resolved (E501, E402, F841, B904, B905, SIM)
|
|
55
|
+
|
|
56
|
+
## [0.1.0a1] - 2026-04-10
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- `@connector` and `@enumerator` decorators for typed data source wrappers
|
|
61
|
+
- `Connectors` composition with `+` operator and `bind_deps()`
|
|
62
|
+
- `Result` and `SemanticTableResult` with provenance tracking
|
|
63
|
+
- `Catalog` with optional vector-searchable catalog
|
|
64
|
+
- `SQLiteCatalogStore` implementation with FTS5 and optional vector search
|
|
65
|
+
- `LiteLLMEmbeddingProvider` for catalog embeddings
|
|
66
|
+
- `OutputConfig` with `Column` roles (KEY, TITLE, METADATA, DATA)
|
|
67
|
+
- Built-in connectors: FRED, SDMX, FMP, FMP Screener, SEC Edgar, Polymarket, EODHD
|
|
68
|
+
- `with_callback()` for post-fetch hooks on connectors and collections
|
|
69
|
+
- Typed error hierarchy: `ConnectorError`, `UnauthorizedError`, `PaymentRequiredError`,
|
|
70
|
+
`RateLimitError`, `ProviderError`, `EmptyDataError`, `ParseError`
|
|
71
|
+
- `HttpClient` with credential redaction in logs
|
|
@@ -0,0 +1,190 @@
|
|
|
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 the 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 the 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 any 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
|
+
Copyright 2026 Ockham.sh
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: parsimony-core
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Connector framework for financial data — search, fetch, and catalog series from FRED, SDMX, FMP, SEC Edgar, and more
|
|
5
|
+
Project-URL: Homepage, https://parsimony.dev
|
|
6
|
+
Project-URL: Repository, https://github.com/ockham-sh/parsimony
|
|
7
|
+
Project-URL: Documentation, https://docs.parsimony.dev
|
|
8
|
+
Author-email: "Ockham.sh" <team@ockham.sh>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: catalog,connectors,data,finance,fred,sdmx
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: httpx>=0.28.1
|
|
25
|
+
Requires-Dist: pandas<3,>=2.3.0
|
|
26
|
+
Requires-Dist: platformdirs<5,>=4.0.0
|
|
27
|
+
Requires-Dist: pyarrow>=23.0.1
|
|
28
|
+
Requires-Dist: pydantic<3,>=2.11.1
|
|
29
|
+
Requires-Dist: sdmx1<3,>=2.26.0
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: edgartools>=4.0.0; extra == 'all'
|
|
32
|
+
Requires-Dist: financial-reports-generated-client>=0.1.0; extra == 'all'
|
|
33
|
+
Requires-Dist: litellm<2,>=1.59.0; extra == 'all'
|
|
34
|
+
Requires-Dist: mcp>=1.0.0; extra == 'all'
|
|
35
|
+
Requires-Dist: sqlite-vec>=0.1.6; extra == 'all'
|
|
36
|
+
Requires-Dist: tabulate>=0.9.0; extra == 'all'
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest>=9.0.3; extra == 'dev'
|
|
42
|
+
Requires-Dist: ruff>=0.15.10; extra == 'dev'
|
|
43
|
+
Requires-Dist: types-requests>=2.31; extra == 'dev'
|
|
44
|
+
Provides-Extra: docs
|
|
45
|
+
Requires-Dist: mkdocs-material; extra == 'docs'
|
|
46
|
+
Provides-Extra: financial-reports
|
|
47
|
+
Requires-Dist: financial-reports-generated-client>=0.1.0; extra == 'financial-reports'
|
|
48
|
+
Provides-Extra: mcp
|
|
49
|
+
Requires-Dist: mcp>=1.0.0; extra == 'mcp'
|
|
50
|
+
Requires-Dist: tabulate>=0.9.0; extra == 'mcp'
|
|
51
|
+
Provides-Extra: search
|
|
52
|
+
Requires-Dist: litellm<2,>=1.59.0; extra == 'search'
|
|
53
|
+
Requires-Dist: sqlite-vec>=0.1.6; extra == 'search'
|
|
54
|
+
Provides-Extra: sec
|
|
55
|
+
Requires-Dist: edgartools>=4.0.0; extra == 'sec'
|
|
56
|
+
Description-Content-Type: text/markdown
|
|
57
|
+
|
|
58
|
+
# parsimony
|
|
59
|
+
|
|
60
|
+
[](https://pypi.org/project/parsimony-core/)
|
|
61
|
+
[](LICENSE)
|
|
62
|
+
[](https://pypi.org/project/parsimony-core/)
|
|
63
|
+
[](https://github.com/ockham-sh/parsimony/actions)
|
|
64
|
+
[](https://docs.parsimony.dev)
|
|
65
|
+
|
|
66
|
+
Typed, composable data connectors with searchable catalogs for Python.
|
|
67
|
+
|
|
68
|
+
## Why parsimony?
|
|
69
|
+
|
|
70
|
+
- **Unified interface** -- one async calling convention (`await connectors["name"](params)`) across FRED, SDMX, FMP, SEC Edgar, Polymarket, and more.
|
|
71
|
+
- **Typed parameters** -- every connector validates input through a Pydantic model with a JSON Schema for agent integration.
|
|
72
|
+
- **Provenance on every result** -- every `Result` carries its source, params, and fetch timestamp alongside the DataFrame.
|
|
73
|
+
- **Searchable catalog** -- index entities from any source into a `Catalog` with optional vector embeddings for semantic search.
|
|
74
|
+
- **MCP integration** -- expose connectors as [Model Context Protocol](https://modelcontextprotocol.io/) tools for AI agents.
|
|
75
|
+
|
|
76
|
+
## Install
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install parsimony-core # FRED, ECB, Eurostat, IMF, World Bank + all httpx connectors
|
|
80
|
+
pip install parsimony-core[sec] # + SEC Edgar
|
|
81
|
+
pip install parsimony-core[all] # everything (adds semantic search, MCP server)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> Installed from PyPI as **`parsimony-core`**; imports remain `from parsimony import ...`.
|
|
85
|
+
> The bare `parsimony` name on PyPI is currently unavailable — we plan to migrate the
|
|
86
|
+
> distribution name to `parsimony` once it becomes available. The import path will not change.
|
|
87
|
+
|
|
88
|
+
## 30-Second Example (No API Key)
|
|
89
|
+
|
|
90
|
+
Fetch daily USD/EUR exchange rates from the ECB:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
import asyncio
|
|
94
|
+
from parsimony.connectors.sdmx import CONNECTORS as SDMX
|
|
95
|
+
|
|
96
|
+
async def main():
|
|
97
|
+
result = await SDMX["sdmx_fetch"](
|
|
98
|
+
dataset_key="ECB-EXR",
|
|
99
|
+
series_key="D.USD.EUR.SP00.A",
|
|
100
|
+
start_period="2024-01",
|
|
101
|
+
)
|
|
102
|
+
print(result.data.tail())
|
|
103
|
+
print(result.provenance)
|
|
104
|
+
|
|
105
|
+
asyncio.run(main())
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
series_key title ... TIME_PERIOD value
|
|
110
|
+
D.USD.EUR.SP00.A US dollar/Euro (EXR) ... 2024-12-27 1.0427
|
|
111
|
+
D.USD.EUR.SP00.A US dollar/Euro (EXR) ... 2024-12-30 1.0389
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## With API Keys
|
|
115
|
+
|
|
116
|
+
FRED provides US macroeconomic data. Get a free key at [fred.stlouisfed.org](https://fred.stlouisfed.org/docs/api/api_key.html):
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from parsimony.connectors.fred import CONNECTORS as FRED
|
|
120
|
+
|
|
121
|
+
fred = FRED.bind_deps(api_key="your-key")
|
|
122
|
+
|
|
123
|
+
# Search
|
|
124
|
+
search = await fred["fred_search"](search_text="US unemployment rate")
|
|
125
|
+
print(search.data[["id", "title"]].head())
|
|
126
|
+
|
|
127
|
+
# Fetch
|
|
128
|
+
result = await fred["fred_fetch"](series_id="UNRATE", observation_start="2020-01-01")
|
|
129
|
+
print(result.data.tail())
|
|
130
|
+
print(result.provenance)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Built-in Data Sources
|
|
134
|
+
|
|
135
|
+
| Source | API Key | Category |
|
|
136
|
+
|--------|---------|----------|
|
|
137
|
+
| **FRED** (Federal Reserve Economic Data) | Free | Macro |
|
|
138
|
+
| **SDMX** (ECB, Eurostat, IMF, World Bank, BIS) | None | Macro |
|
|
139
|
+
| **FMP** (Financial Modeling Prep) | Paid | Equities |
|
|
140
|
+
| **SEC Edgar** | None | Filings |
|
|
141
|
+
| **EODHD** (End of Day Historical Data) | Paid | Multi-asset |
|
|
142
|
+
| **Polymarket** | None | Prediction markets |
|
|
143
|
+
| **CoinGecko** | Free | Crypto |
|
|
144
|
+
| **Finnhub** | Free | News & events |
|
|
145
|
+
| **Tiingo** | Free | Equities |
|
|
146
|
+
| **Alpha Vantage** | Free | Equities |
|
|
147
|
+
| **EIA** (Energy Information Administration) | Free | Energy |
|
|
148
|
+
| **BLS** (Bureau of Labor Statistics) | Free | Employment |
|
|
149
|
+
| **US Treasury** | None | Bonds |
|
|
150
|
+
| **Central Banks** (SNB, RBA, Riksbank, BDE, BOJ, BOC, BDP, BDF, Destatis) | None | Macro |
|
|
151
|
+
|
|
152
|
+
## Features
|
|
153
|
+
|
|
154
|
+
**Three decorator primitives** -- all produce the same `Connector` runtime type:
|
|
155
|
+
|
|
156
|
+
- `@connector` -- typed fetch/search; `output=` is optional for schema-aware results.
|
|
157
|
+
- `@enumerator` -- catalog population (KEY + TITLE + METADATA, no DATA); requires `output=`.
|
|
158
|
+
- `@loader` -- observation persistence (KEY + DATA only); requires `output=` and a `DataStore`.
|
|
159
|
+
|
|
160
|
+
**Catalog** -- `Catalog` indexes entities by `(namespace, code)` from any connector result. Supports text search out of the box and semantic search with optional `LiteLLMEmbeddingProvider`.
|
|
161
|
+
|
|
162
|
+
**Provenance** -- every result tracks source, parameters, and fetch timestamp. Serialize to Arrow/Parquet for reproducible pipelines.
|
|
163
|
+
|
|
164
|
+
**Composable routing** -- combine connectors from multiple sources with `+`, bind dependencies once with `bind_deps()`, attach callbacks with `with_callback()`.
|
|
165
|
+
|
|
166
|
+
**MCP server** -- run `python -m parsimony.mcp` to expose all configured connectors as MCP tools for Claude, GPT, and other AI agents.
|
|
167
|
+
|
|
168
|
+
## Documentation
|
|
169
|
+
|
|
170
|
+
Full docs at [docs.parsimony.dev](https://docs.parsimony.dev):
|
|
171
|
+
|
|
172
|
+
- [Quickstart](https://docs.parsimony.dev/quickstart/) -- zero to fetching data in five minutes
|
|
173
|
+
- [User Guide](https://docs.parsimony.dev/user-guide/) -- custom connectors, catalog, data stores
|
|
174
|
+
- [Architecture](https://docs.parsimony.dev/architecture/) -- design principles and internals
|
|
175
|
+
- [API Reference](https://docs.parsimony.dev/api-reference/) -- full class and function reference
|
|
176
|
+
- [Connector Guide](https://docs.parsimony.dev/connector-implementation-guide/) -- building new connectors
|
|
177
|
+
|
|
178
|
+
## Contributing
|
|
179
|
+
|
|
180
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, coding conventions, and the connector checklist.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
Apache 2.0
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# parsimony
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/parsimony-core/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://pypi.org/project/parsimony-core/)
|
|
6
|
+
[](https://github.com/ockham-sh/parsimony/actions)
|
|
7
|
+
[](https://docs.parsimony.dev)
|
|
8
|
+
|
|
9
|
+
Typed, composable data connectors with searchable catalogs for Python.
|
|
10
|
+
|
|
11
|
+
## Why parsimony?
|
|
12
|
+
|
|
13
|
+
- **Unified interface** -- one async calling convention (`await connectors["name"](params)`) across FRED, SDMX, FMP, SEC Edgar, Polymarket, and more.
|
|
14
|
+
- **Typed parameters** -- every connector validates input through a Pydantic model with a JSON Schema for agent integration.
|
|
15
|
+
- **Provenance on every result** -- every `Result` carries its source, params, and fetch timestamp alongside the DataFrame.
|
|
16
|
+
- **Searchable catalog** -- index entities from any source into a `Catalog` with optional vector embeddings for semantic search.
|
|
17
|
+
- **MCP integration** -- expose connectors as [Model Context Protocol](https://modelcontextprotocol.io/) tools for AI agents.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install parsimony-core # FRED, ECB, Eurostat, IMF, World Bank + all httpx connectors
|
|
23
|
+
pip install parsimony-core[sec] # + SEC Edgar
|
|
24
|
+
pip install parsimony-core[all] # everything (adds semantic search, MCP server)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> Installed from PyPI as **`parsimony-core`**; imports remain `from parsimony import ...`.
|
|
28
|
+
> The bare `parsimony` name on PyPI is currently unavailable — we plan to migrate the
|
|
29
|
+
> distribution name to `parsimony` once it becomes available. The import path will not change.
|
|
30
|
+
|
|
31
|
+
## 30-Second Example (No API Key)
|
|
32
|
+
|
|
33
|
+
Fetch daily USD/EUR exchange rates from the ECB:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import asyncio
|
|
37
|
+
from parsimony.connectors.sdmx import CONNECTORS as SDMX
|
|
38
|
+
|
|
39
|
+
async def main():
|
|
40
|
+
result = await SDMX["sdmx_fetch"](
|
|
41
|
+
dataset_key="ECB-EXR",
|
|
42
|
+
series_key="D.USD.EUR.SP00.A",
|
|
43
|
+
start_period="2024-01",
|
|
44
|
+
)
|
|
45
|
+
print(result.data.tail())
|
|
46
|
+
print(result.provenance)
|
|
47
|
+
|
|
48
|
+
asyncio.run(main())
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
series_key title ... TIME_PERIOD value
|
|
53
|
+
D.USD.EUR.SP00.A US dollar/Euro (EXR) ... 2024-12-27 1.0427
|
|
54
|
+
D.USD.EUR.SP00.A US dollar/Euro (EXR) ... 2024-12-30 1.0389
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## With API Keys
|
|
58
|
+
|
|
59
|
+
FRED provides US macroeconomic data. Get a free key at [fred.stlouisfed.org](https://fred.stlouisfed.org/docs/api/api_key.html):
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from parsimony.connectors.fred import CONNECTORS as FRED
|
|
63
|
+
|
|
64
|
+
fred = FRED.bind_deps(api_key="your-key")
|
|
65
|
+
|
|
66
|
+
# Search
|
|
67
|
+
search = await fred["fred_search"](search_text="US unemployment rate")
|
|
68
|
+
print(search.data[["id", "title"]].head())
|
|
69
|
+
|
|
70
|
+
# Fetch
|
|
71
|
+
result = await fred["fred_fetch"](series_id="UNRATE", observation_start="2020-01-01")
|
|
72
|
+
print(result.data.tail())
|
|
73
|
+
print(result.provenance)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Built-in Data Sources
|
|
77
|
+
|
|
78
|
+
| Source | API Key | Category |
|
|
79
|
+
|--------|---------|----------|
|
|
80
|
+
| **FRED** (Federal Reserve Economic Data) | Free | Macro |
|
|
81
|
+
| **SDMX** (ECB, Eurostat, IMF, World Bank, BIS) | None | Macro |
|
|
82
|
+
| **FMP** (Financial Modeling Prep) | Paid | Equities |
|
|
83
|
+
| **SEC Edgar** | None | Filings |
|
|
84
|
+
| **EODHD** (End of Day Historical Data) | Paid | Multi-asset |
|
|
85
|
+
| **Polymarket** | None | Prediction markets |
|
|
86
|
+
| **CoinGecko** | Free | Crypto |
|
|
87
|
+
| **Finnhub** | Free | News & events |
|
|
88
|
+
| **Tiingo** | Free | Equities |
|
|
89
|
+
| **Alpha Vantage** | Free | Equities |
|
|
90
|
+
| **EIA** (Energy Information Administration) | Free | Energy |
|
|
91
|
+
| **BLS** (Bureau of Labor Statistics) | Free | Employment |
|
|
92
|
+
| **US Treasury** | None | Bonds |
|
|
93
|
+
| **Central Banks** (SNB, RBA, Riksbank, BDE, BOJ, BOC, BDP, BDF, Destatis) | None | Macro |
|
|
94
|
+
|
|
95
|
+
## Features
|
|
96
|
+
|
|
97
|
+
**Three decorator primitives** -- all produce the same `Connector` runtime type:
|
|
98
|
+
|
|
99
|
+
- `@connector` -- typed fetch/search; `output=` is optional for schema-aware results.
|
|
100
|
+
- `@enumerator` -- catalog population (KEY + TITLE + METADATA, no DATA); requires `output=`.
|
|
101
|
+
- `@loader` -- observation persistence (KEY + DATA only); requires `output=` and a `DataStore`.
|
|
102
|
+
|
|
103
|
+
**Catalog** -- `Catalog` indexes entities by `(namespace, code)` from any connector result. Supports text search out of the box and semantic search with optional `LiteLLMEmbeddingProvider`.
|
|
104
|
+
|
|
105
|
+
**Provenance** -- every result tracks source, parameters, and fetch timestamp. Serialize to Arrow/Parquet for reproducible pipelines.
|
|
106
|
+
|
|
107
|
+
**Composable routing** -- combine connectors from multiple sources with `+`, bind dependencies once with `bind_deps()`, attach callbacks with `with_callback()`.
|
|
108
|
+
|
|
109
|
+
**MCP server** -- run `python -m parsimony.mcp` to expose all configured connectors as MCP tools for Claude, GPT, and other AI agents.
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
Full docs at [docs.parsimony.dev](https://docs.parsimony.dev):
|
|
114
|
+
|
|
115
|
+
- [Quickstart](https://docs.parsimony.dev/quickstart/) -- zero to fetching data in five minutes
|
|
116
|
+
- [User Guide](https://docs.parsimony.dev/user-guide/) -- custom connectors, catalog, data stores
|
|
117
|
+
- [Architecture](https://docs.parsimony.dev/architecture/) -- design principles and internals
|
|
118
|
+
- [API Reference](https://docs.parsimony.dev/api-reference/) -- full class and function reference
|
|
119
|
+
- [Connector Guide](https://docs.parsimony.dev/connector-implementation-guide/) -- building new connectors
|
|
120
|
+
|
|
121
|
+
## Contributing
|
|
122
|
+
|
|
123
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, coding conventions, and the connector checklist.
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
Apache 2.0
|