Import code already exists here: we just need to move it into tsconvert.
https://github.com/jeromekelleher/phylokit/blob/main/phylokit/inference.py
Some details of Newick<->lineage matrix here: tskit-dev/tskit#3159 (comment) which might help export, I guess?