Show metadata for a filepath from music library

I am looking for a way to retrieve Beets metadata (similar to what beet info outputs) given a filepath URI for files imported into Beets library. What is the easiest way to do it?

Hello! Just to confirm what you’re trying to do, I think beet info /path/to/file should probably work already, right? So is the problem that you have a file:///... URI instead of a normal path? Maybe there’s a way to simply decode the URI to a path first before invoking beets?