Skip to content

Commit

Permalink
docs: adding docstrings to item.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dfulmer committed Oct 17, 2024
1 parent 2dd7009 commit b73f1cf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions aim/digifeeds/item.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
class Item:
"""A Digifeeds Item
An item to be processed by the Digifeeds process.
Attributes:
data: ?
"""

def __init__(self, data: dict) -> None:
"""Initializes the instance with data argument.
Args:
data (dict): ?
"""
self.data = data

def has_status(self, status: str) -> bool:
"""The status of this Digifeeds Item.
Args:
status (str): A Digifeeds status.
Returns:
bool: True if Digifeeds item has a status, Fales if Digifeeds item does not have a status.
"""
return any(s["name"] == status for s in self.data["statuses"])

@property
def barcode(self) -> str:
"""The barcode of the Digifeeds item.
Returns:
str: The barcode.
"""
return self.data["barcode"]

0 comments on commit b73f1cf

Please sign in to comment.