Utilities¶
- exception pypipedrive.utils.BetaWarning[source]¶
Indicates a Pipedrive API endpoint that is still in beta.
- pypipedrive.utils.build_multipart_file_tuple(data: bytes = None, file_name: str = None, content_type: str = None) Tuple[str, bytes, str][source]¶
Build the multipart/form-data file tuple for uploading.
- Args:
data: The binary data to upload. file_name: The name of the file. content_type: The MIME type of the file.
- Returns:
A dictionary suitable for the files parameter in requests.
- pypipedrive.utils.date_from_iso_str(value: str | date | None) date | None[source]¶
Convert ISO 8601 date string into a
dateobject.- Args:
value: date string, e.g. “2014-09-05”
- pypipedrive.utils.date_to_iso_str(value: date | datetime | None) str | None[source]¶
Convert a
dateordatetimeinto a ISO 8601 string- Args:
value: date or datetime object, e.g. “2014-09-05”
- pypipedrive.utils.datetime_from_iso_str(value: str | None) datetime | None[source]¶
Convert an ISO 8601 datetime string into a
datetimeobject.- Args:
value: datetime string, e.g. “2014-09-05T07:00:00.000Z”
- pypipedrive.utils.datetime_to_iso_str(value: datetime | None) str | None[source]¶
Convert
datetimeobject into a ISO 8601 string e.g. “2014-09-05T12:34:56.000Z”- Args:
value: datetime object
- pypipedrive.utils.duration_from_hh_ss_str(value: str | None) timedelta | None[source]¶
Convert an ISO 8601 time string HH:SS into a
durationobject.- Args:
value: time string, e.g. “00:15” (15 minutes)
- pypipedrive.utils.duration_to_hh_ss_str(value: timedelta | None) str | None[source]¶
Convert an ISO 8601 time object into a
durationstring HH:SS.- Args:
value: time string, e.g. “00:15” (15 minutes)
- pypipedrive.utils.time_from_iso_str(value: str | None) time | None[source]¶
Convert an ISO 8601 time string into a
timeobject.- Args:
value: time string, e.g. “12:34”
- pypipedrive.utils.time_to_iso_str(value: time | None) str | None[source]¶
Convert an ISO 8601 time object into a
timestring.- Args:
value: time string, e.g. “12:34”