This extension to Inkscape will export SVG layers independently to PDFs
To install this extension, download and unpack the archive file. Copy the files into the directory listed at Edit > Preferences > System: User extensions (on my machine, for instance, it is ~/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions
). After a restart of Inkscape, the new extension will be available.
There is some official documentation available but I found the best source to the official Python extensions. The one most closely related is the Guillotine extension. Take a look!
Once you done you changes, be sure to run the tests:
pipenv install --dev
pipenv run pytest -v
This code is released under GPL3.