crowsetta
crowsetta copied to clipboard
Write `__repr__`/`__str__` for format classes that uses `reprlib` so a user can print to get something readable
Right now if we just do something like
>>> import crowsetta
>>> birdsongrec = crowsetta.example('Annotation.xml')
>>> birdsongrec
the auto-generated __repr__ provided by attrs will dump out every annotation to stdout. This is technically correct but not very helpful
Might be good to
- [ ] override the
__repr__for each class and usereprlibin it to get an abbreviated representation of attributes - [ ] possibly provide an even friendlier version with
__str__? In some cases I think it might be good to have an almost human-readable summary of the annotations in the file, "TextGrid with 5 tiers" or something like that
... I think having a __str__ that uses reprlib so that the convention is you print(annot) to get some more readable version might make the most sense