twitter_ads_v2.utils module

Container for all helpers and utilities used throughout the Ads API SDK.

class twitter_ads_v2.utils.CustomDecorators[source]

Bases: object

static deprecated(message)[source]
static flatten_params(decorated)[source]
static resource_controller(*deco_args, **deco_kwargs)[source]
twitter_ads_v2.utils.format_date(time)[source]

Formats a datetime as an ISO 8601 compliant string, dropping time.

twitter_ads_v2.utils.format_time(time)[source]

Formats a datetime as an ISO 8601 compliant string.

twitter_ads_v2.utils.get_version()[source]

Returns a string representation of the current SDK version.

twitter_ads_v2.utils.http_time(time)[source]

Formats a datetime as an RFC 1123 compliant string.

twitter_ads_v2.utils.remove_hours(time)[source]

Sets the hours, minutes, seconds, and microseconds to zero.

twitter_ads_v2.utils.remove_minutes(time)[source]

Sets the minutes, seconds, and microseconds to zero.

twitter_ads_v2.utils.split_list(list_, n)[source]

Splits a list by a given number (n) and returns a generator object.

twitter_ads_v2.utils.to_time(time, granularity)[source]

Returns a truncated and rounded time string based on the specified granularity.

twitter_ads_v2.utils.validate_whole_hours(time)[source]