py-rattler is the python api for the ultra fast rattler library which is the technology underlying pixi: https://conda.github.io/rattler/py-rattler/
Usage should be straightforward, but can also get inspiration from https://github.com/snakemake/snakemake-software-deployment-plugin-conda, or directly ask @johanneskoester who has implemented the plugin.