I need a python library that can write Gedcom string inputs. all I have been able to find are parsers, but nothing that can write Gedcom. also, I need this to be able to generate a family tree to a webpage with flask, if anyone has a better way to do that please to tell me
Gramps is an open source fully functional genealogy program written in python. It includes all the python code to read and write GEDCOM. You might be able to pull what you need from it. The repository is on GitHub.
Gramps already can generate web sites. You might want to check out that functionality and see if it already does what you want. If not, you can modify it so that it does.
So you can pull the code out of Gramps that you need for your project.
Or better yet, you can contribute to the Gramps project by adding to it the functionality it is missing that you need.