I need to add XMP data to a PDF file obtained through pypdf. In question reading/writing XML metadata on PDF files through pypdf, KyleBrooks answered that this is impossible. But that was in 2009. Maybe it is now possible to use the latest version of pypdf?
If not, do you know any other non-commercial way of embedding an XMP XML file into a PDF document?
You can run
cpdf -print-metadata in.pdf
And
cpdf -set-metadata data.xml in.pdf -o out.pdf
License is AGPL.