Skip to content

Releases: xdevplatform/twitter-python-ads-sdk

v6.0.1

07 Oct 19:32
598e86c
Compare
Choose a tag to compare

New

  • Added support for the new Tweets endpoint #228
  • Added following endpoints support:
    • LineItemApps
    • LineItemPlacements
    • ContentCategories
    • IabCategories

Changed

  • The Analytics class now moved from twitter_ads.resouce to its dedicated path twitter_ads.analytics. Please updated the import path accordingly (PR: #227):
- from twitter_ads.resouce import Analytics
+ from twitter_ads.analytics import Analytics

v6.0.0

06 Sep 01:25
43074bd
Compare
Choose a tag to compare

This release is mainly focused on following the recent Ads API version 6 release.
Several important changes are made in version 6 so please see the full details as to what's changed: https://twittercommunity.com/t/ads-api-version-6/129060

You can check all the SDK changes we made in this new release from this PR: #223
We also updated the handy Postman collection (v6 support) to make your testing and development workflow even easier.
Run in Postman

New

Number of processing jobs

https://twittercommunity.com/t/ads-api-version-6/129060/1#heading--number-of-processing-jobs
In order to make it easier to manage asynchronous analytics workflows, the Ads API now returns two new response headers:

  • X-Concurrent-Job-Limit: The maximum number of jobs that may be in a processing state at any given time
  • X-Concurrent-Job-Limit-Remaining: The number of jobs that can be created given the number currently being processed

These values are returned when asynchronous analytics jobs are created using the POST stats/jobs/accounts/:account_id endpoint, and SDK users can access these headers through instance variables:

stats = LineItem.queue_async_stats_job(account, ids, metric_groups)

print(stats.concurrent_job_limit)
print(stats.concurrent_job_limit_remaining)

New helper function split_list()

This small new helper functionsplit_list() can be used for splitting list that contains entity ids by a given number.

from twitter_ads.utils import split_list

test_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(list(split_list(test_list, 2)))
# => [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]

promoted_tweets = PromotedTweet.all(account)
ids = list(map(lambda x: x.id, promoted_tweets))

sync_data = []
# Sync/Async endpoint can handle max 20 entity IDs per request
# so split the ids list into multiple requests
for chunk_ids in split_list(ids, 20):
    sync_data.append(PromotedTweet.all_stats(account, chunk_ids, metric_groups))

print(sync_data)

Changed

Analytics.queue_async_stats_job()

  • Analytics.queue_async_stats_job() can now be called directly (with specifying entity parameter)
  • Analytics.queue_async_stats_job() now returns instance rather than dict
- job_id = LineItem.queue_async_stats_job(account, ids, metric_groups)[id]
+ job_id = LineItem.queue_async_stats_job(account, ids, metric_groups).id

as_user_id now required c8f0e0e

https://twittercommunity.com/t/ads-api-version-6/129060/1#heading--as-user-id-now-required
Given the impact of this change, SDK now provides a new class method UserIdLookup.load() that can be used to lookup an user_id by a given Twitter screen name.

user_id = UserIdLookup.load(account, screen_name='your_twitter_handle_name').id

Deprecated

Scoped Timeline

The GET accounts/:account_id/scoped_timeline endpoint is no longer available in v6. fcb6096
https://twittercommunity.com/t/ads-api-version-6/129060/1#heading--scoped-timeline
* SDK will continue to support this endpoint until the v5 became sunset.

Removed

Audience Intelligence

https://twittercommunity.com/t/announcement-audience-intelligence-deprecation/127907

Old Tweet preview endpoints

Below endpoints are removed in this release:

  • GET accounts/:account_id/tweet/preview
  • GET accounts/:account_id/tweet/preview/:tweet_id
  • GET accounts/:account_id/draft_tweets/preview/:draft_tweet_id
  • GET accounts/:account_id/scheduled_tweets/preview/:scheduled_tweet_id

v5.3.0

20 Aug 07:56
719fa5d
Compare
Choose a tag to compare

See all updates from Release Notes page:
https://github.com/twitterdev/twitter-python-ads-sdk/wiki/Release-Notes

New

  • Native support for rate-limit handling and request retry: #213
    We're excited to announce that the Ads API Python SDK now supports rate-limit handling & request retry for the first time ever!:tada:

Changed

  • Use PromotedTweet.attach() instead of PromotedTweet.save(): #212
  • Analytics.async_stats_job_result() returns data through instance attributes (previously returned a list): #211

v5.2.0

25 Jul 18:58
7d8a481
Compare
Choose a tag to compare

Bug fix

  • Bug fixes in Analytics class: #203
    => fix: active_entities() ignores optional parameters
  • Some minor fixes: #198

New

  • Added conversation targeting support: #198
  • Added Draft Tweets support: #199

v5.1.1

06 Jun 02:57
54cb2da
Compare
Choose a tag to compare

New

Changed

  • Removed TONUpload class (deprecated)
  • Drop support for Python 3.3 and 3.4 (EOL) #194

v4.0.0

08 Feb 17:45
3f91354
Compare
Choose a tag to compare

This is a version 4 ready release for the Python SDK.

New

  • Adds support for the Audience API
  • Adds support for User Settings API
  • Adds support for Tax Settings API
  • Adds enums for Lookalike expansion

Changed

  • Updated app_country_code to country_code
  • Removed Videos endpoint

v3.0.0

21 Mar 04:23
22cb40a
Compare
Choose a tag to compare

This is a version 3-ready release for the Python SDK.

Changes:

  • Audience Intelligence (#160)
  • Media Library (#151)
  • Media Polls (#155)
  • Cards Fetch (#157)
  • Other
    • Update funding instrument resource properties (#149)

v2.0.0

12 Dec 18:34
eeb4efa
Compare
Choose a tag to compare

This is a version 2-ready release for the Python SDK.

Changes:

  • Scheduled Tweets (#131)
  • Video website cards (#130)
  • Draft campaigns (#135, #137)
  • Other
    • Add card_uri resource property, where appropriate (#138)
    • Remove status from Tweet create (#139)
    • Remove PUT (update) from PromotedTweet (#129)
    • Remove LeadGenCard and AppDownloadCard (#140)

v1.2.3

29 Aug 00:27
Compare
Choose a tag to compare

Changes:

v1.2.2

03 May 23:11
Compare
Choose a tag to compare

Changes:

  • Fixes AttributeError when importing httplib2 #113