Skip to content

Commit

Permalink
Added todict method to Entities.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric J. Humphrey committed Mar 12, 2016
1 parent 56f56f0 commit 164216f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions biggie/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def items(self):
"""Return the (key, value) items of the entity."""
return [(k, getattr(self, k)) for k in self.keys()]

def todict(self):
return {k: v for k, v in self.items()}

@classmethod
def from_hdf5_group(cls, group):
"""writeme."""
Expand Down
2 changes: 1 addition & 1 deletion biggie/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def add(self, key, entity, overwrite=False):
key : str
Key to write the entity under.
entity : Entity
entity : Entity or dict
Data to write to file.
overwrite : bool, default=False
Expand Down

0 comments on commit 164216f

Please sign in to comment.