Hi,
I assume you want to do this from CLI. The information can be easily extracted with ctorrent.
Code:
ctorrent -x file.torrent
You can further parse the output with sed/awk/perl to extract the info you need. I do not recommend to parse the *.torrent file directly with one of the above tools since it is "semi-binary".
Hope this helps.