I use rspamd.
This might be a little heavy if you’re solely looking for DMARC validation, but I use the other parts of rspamd as well for inbound email.
https://rspamd.com/modules/dmarc/
For a library, I mainly write Go and I use https://github.com/emersion/go-msgauth (formerly known as go-dkim).
Url seems to be https://docs.rspamd.com/modules/dmarc/
Thanks for the correction. I guess I had a mis-paste that stripped out the leading part of the hostname... weird.
This just brought back bad memories of websites manipulating the clipboard when copying text. The ones that append the website attribution with full URL is a crime against humanity.