If you are interested in creating or manipulating DXF files using Python,
then you can use ezdxf.
https://github.com/mozman/ezdxfhttps://ezdxf.readthedocs.io/en/latest/index.htmlI've used it to created an object that can remove duplicate entities from all DXF files in a folder.