Bother. I misunderstood the question!
Anyway, if you happened to want to count footnotes, and are using something with unix command-line tools available (e.g. linux / mac / unix-tools for windows), then you can do something like this:
cat FILENAME | tr '\\' '\n' | awk '/^f /{footnote++;}/^x /{xref++;}/^c /{print chapter, footnote, xref ; chapter=0+$2; footnote=0;xref=0;}END{print chapter, footnote, xref; }'
What it does is make sure that every new SFM starts a new line, and then counts the footnotes, xrefs and when there’s a chapter number (or the end) it prints the counts. I don’t speak python though, and notes are in an XML file which is quite a bit too nasty to decode with awk.