import bs4
from vcalendar import vCalendar

class hCalendar(object):
    def __init__(self, markup, value=None, key='id'):
        self._soup = bs4.BeautifulSoup(markup)
        if value:
            self._soup = self._soup.find(**{key: value})
        self._cals = self._soup.findAll(attrs='vcalendar')
        if self._cals:
            self._cals = map(vCalendar, self._cals)
        else:
            self._cals = [vCalendar(self._soup)]

    def __len__(self):
        return len(self._cals)

    def __iter__(self):
        return iter(self._cals)

    def __getitem__(self, key):
        return self._cals[key]

    def getCalendar(self):
        return self._cals

@@ -1,16 +1,4 @@
-import bs4%0D%0A
 from
@@ -25,16 +25,47 @@
 alendar%0D
+%0Afrom bs4 import BeautifulSoup%0D
 %0A%0D%0Aclass
@@ -136,24 +136,123 @@
 key='id'):%0D%0A
+        if isinstance(markup, BeautifulSoup):%0D%0A            self._soup = markup%0D%0A        else:%0D%0A    
         self
@@ -264,12 +264,8 @@
 p = 
-bs4.
 Beau

Allow BeautifulSoup object being passed into hCalendar