Skip to content

Conversation

@davenquinn
Copy link
Member

@davenquinn davenquinn commented Nov 21, 2025

Addresses #128 by creating a prototype matching API.

This is based on SGP matching utilities (#138) and has several new features. Both spatial and temporal constraints for matching can be applied.

The docs are at /api/v3/docs, and the routes are under /api/v3/dev/match/strat-names.

This API is still a little rough around the edges, and the return semantics and format could potentially be improved, but it works!

Example (Pierre Shale)

  • You can either GET a single match or POST up to 100 items (in a json list) to get a bulk match back.
  • As @mmcclenn suggested, you can send your own identifiers to associate with requests:
    example
  • You can limit matching to a single project, column, or age range (with either numerical ages or interval ids/names)

Code and heritage

The core API code is here. It is based on a shared macrostrat.match-utils module that was derived from scripts for bulk linking of Macrostrat and SGP. All of these elements now have tests.

Some of the code is derived from utilities developed by @jonhusson in 2016.

Future work

  • Decide on output format (e.g., whether to return 404 on no match, whether to flatten results)
  • accept/return CSVs
  • Improve matching to lexicons where no columns are available
  • Match to map units
  • Fuzzy matching (spatial/temporal/text)

@davenquinn davenquinn merged commit 805310c into main Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants