The cmarkgfm
package provides Python bindings to GitHub's fork of cmark so that "rendering is compliant with GitHub's, since this package wraps GitHub's own C parser and serializer" (according to the pycmarkgfm
package which is very similar but less recently maintained).