Shameless plug: pybedtools now does almost everything you asked (with the exception of the chromosome attribute access), and it's in Cython for speed.
For example, say we have this BED file:
$ cat a.bed
chr1 1 100 feature1 0 +
chr1 100 200 feature2 0 +
chr1 150 500 feature3 0 -
chr1 900 950 feature4 0 +
And this GFF file:
$ cat d.gff
chr1 fake gene 50 300 . + . ID=gene1
chr1 fake mRNA 50 300 . + . ID=mRNA1;Parent=gene1;
chr1 fake CDS 75 150 . + . ID=CDS1;Parent=mRNA1;
chr1 fake CDS 200 275 . + . ID=CDS2;Parent=mRNA1;
chr1 fake rRNA 1200 1275 . + . ID=rRNA1;
Then:
>>> from pybedtools import BedTool
pybedtools has auto-detection of BED/GFF/VCF based on position of string and integer fields:
>>> a = BedTool('a.bed')
>>> d = BedTool('d.gff')
>>> a.file_type
'bed'
>>> d.file_type
'gff'
BedTools are iterable, and you get an Interval for each feature. So you can do list comprehension:
>>> [i.name, i.strand) for i in a if len(i) < 150]
[('feature1', '+'), ('feature2', '+'), ('feature4', '+')]
or indexing:
>>> feature = d[0]
You have GFF attribute access (lazily parsed):
>>> feature['ID']
'gene1'
And arbitrary access of fields:
>>> d[1].fields[1]
'mRNA'
...not to mention access to all of BEDTools:
>>> not_in_d = a.intersect(d, v=True)
>>> print not_in_d
chr1 900 950 feature4 0 +
Reddit cross-post discussion: http://www.reddit.com/r/bioinformatics/comments/gizhg/any_good_bedwig_parsers_in_python/