Skip to main content

Connector framework for financial data — typed fetch and hybrid-search catalogs.

Project description

parsimony

Parsimony is a minimal connector framework for financial data and coding agents. A connector is an async Python callable that returns data; the kernel wraps successful calls in Result objects with provenance.

Quickstart

from parsimony import connector

@connector
async def hello(name: str) -> str:
    """Return a greeting."""
    return f"hello {name}"

result = await hello(name="world")
print(result.data)

Credentials

Credentials are normal parameters. Bind operator-supplied values before exposing a connector to an agent:

runtime_fetch = fred_fetch.bind(api_key="...")
result = await runtime_fetch(series_id="GDP")

The bound connector no longer exposes api_key, and provenance records only the call-time arguments.

Connector implementations decide how to handle provider-specific auth, including optional environment-variable fallback.

Core Primitives

  • @connector: wraps an async callable.
  • @enumerator: connector for catalog enumeration output.
  • @loader: connector for observation-loading output.
  • Connector.bind: schema-aware partial application.
  • Connectors: immutable collection with +, bind, filter, search, callbacks, and keyed lookup.

Plugins

Plugins register under parsimony.providers and export CONNECTORS: Connectors.

[project.entry-points."parsimony.providers"]
yourname = "parsimony_yourname"
from parsimony import Connectors, connector

@connector
async def yourname_fetch(symbol: str, api_key: str = ""):
    """Fetch private source data."""
    ...

CONNECTORS = Connectors([yourname_fetch])

The authoritative plugin contract is docs/contract.md.

Catalogs

Catalog snapshots are built directly from entries and catalog primitives:

from parsimony.catalog.source import entities_from_connector

entries = await entities_from_connector(enumerate_provider, ENUMERATE_OUTPUT)

catalog = Catalog("provider_catalog")
catalog.set_entities(entries)
await catalog.build()
await catalog.save("hf://org/repo/provider_catalog")
loaded = await Catalog.load("hf://org/repo/provider_catalog")

Tabular connectors return raw pd.DataFrame values. Use ColumnRole.DATA for observations and any field that can vary by row or time (for example a benchmark bond's rolling constituent ISIN). Use ColumnRole.METADATA only for entity descriptors that are constant per entity key when projecting catalog entries.

MCP

parsimony-mcp is a separate distribution. MCP/tool schemas are projections of connector signatures; Python connectors do not need JSON-compatible parameters unless they are exported as tools.

License

Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsimony_core-0.7.0.tar.gz (73.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsimony_core-0.7.0-py3-none-any.whl (78.6 kB view details)

Uploaded Python 3

File details

Details for the file parsimony_core-0.7.0.tar.gz.

File metadata

  • Download URL: parsimony_core-0.7.0.tar.gz
  • Upload date:
  • Size: 73.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parsimony_core-0.7.0.tar.gz
Algorithm Hash digest
SHA256 67f3e70f756b7637420db1f3b06f84b7db235aad250edfae3d5052a266876ce1
MD5 829d33f9fb7c85027b78738154f44b8b
BLAKE2b-256 1e953625f6189570cfcba372fd8588d9ae7fcd4d07321edd0c620d8c343effcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_core-0.7.0.tar.gz:

Publisher: publish.yml on ockham-sh/parsimony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file parsimony_core-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: parsimony_core-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 78.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parsimony_core-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa92953871732450e20eb942fd62ede1dd4457f776889eec799549cfc58d188c
MD5 32965e0dc224fe347abf522432321114
BLAKE2b-256 fde498f4d2c318387da091d865c73e773652c06ffebb210a2a40b7f922699e72

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_core-0.7.0-py3-none-any.whl:

Publisher: publish.yml on ockham-sh/parsimony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page