simple and fast coreference solver, uses pos tags, a word gender classifier and lists of pronouns
Supported languages: English, Portuguese, Spanish, Catalan
pip install pronomial
from pronomial import replace_corefs
replace_corefs("London has been a major settlement for two millennia. "
"It was founded by the Romans, who named it Londinium.",
lang="en")
"""
"London has been a major settlement for two millennia . "
"London was founded by the Romans , Romans named London Londinium ."
"""
Pronomial will work fine for short sentences and should be safe to use in the context of simple things, but it tends to fail horribly in complex sentences.
It you want a proper coreference resolution library I suggest you check out neuralcoref or coreferee
Pronomial should not be used in production most of the time, it is intended as baseline and an experiment on how well this task can be solved using only simple heuristics.