Skip to content

adi-DATEX-472-publish-data-apis-sdk#1

Merged
adithyasamavedhi-ttd merged 6 commits into
mainfrom
adi-DATEX-472-publish-data-apis-sdk
Feb 12, 2026
Merged

adi-DATEX-472-publish-data-apis-sdk#1
adithyasamavedhi-ttd merged 6 commits into
mainfrom
adi-DATEX-472-publish-data-apis-sdk

Conversation

@adithyasamavedhi-ttd
Copy link
Copy Markdown
Collaborator

@adithyasamavedhi-ttd adithyasamavedhi-ttd commented Feb 5, 2026

What does this MR do?

  • Generates first version of Data APIs SDK
  • Sets up a pipeline to raise a PR if any changes to swagger occur
  • Merging PR will publish to Pypi as 0.0.1

Local Tests:
Screenshot 2026-02-11 at 11 02 04 AM

Comment thread .speakeasy/gen.yaml Outdated
Comment thread .speakeasy/gen.yaml Outdated
Comment thread USAGE.md Outdated


with Ttddata(
server_url="https://api.example.com",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if appropriate, i recommend setting up a default server (if there is a default server—I don't really know what the data API does). See workflows SDK: https://github.com/thetradedesk/ttd-workflows-python/blob/main/README.md#server-selection

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll look to add a more comprehensive readme. Default Server is appropriate here, I'll be looking into what fits appropriately here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default here points to an example endpoint though. The default should be something that actually works.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The USAGE.md file is generated by speakeasy. In the next iteration, I'll look into editing the speakeasy configs to ensure any changes to this file is not overwritten by speakeasy. That will help ensure once we set a default server, it isnt overwritten.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a default URL in the file.

@adithyasamavedhi-ttd adithyasamavedhi-ttd force-pushed the adi-DATEX-472-publish-data-apis-sdk branch 2 times, most recently from 29a840d to 5102a1b Compare February 11, 2026 01:41
@adithyasamavedhi-ttd adithyasamavedhi-ttd force-pushed the adi-DATEX-472-publish-data-apis-sdk branch from 5102a1b to 507a37c Compare February 11, 2026 18:51
@adithyasamavedhi-ttd adithyasamavedhi-ttd self-assigned this Feb 11, 2026
@adithyasamavedhi-ttd adithyasamavedhi-ttd changed the title Draft: adi-DATEX-472-publish-data-apis-sdk adi-DATEX-472-publish-data-apis-sdk Feb 11, 2026
Comment thread README.md
from ttd_data import TTDData

sdk = TTDData(
# SDK arguments
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you still need to set up auth? I'd think this would take an auth token

Comment thread .speakeasy/gen.yaml Outdated
devContainers:
enabled: true
schemaPath: .speakeasy/out.openapi.yaml
sdkClassName: TTDData
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too sold on TTDData, perhaps DataClient might be a better fit since TTD comes up in the package name already so it's clear that the client is from TTD.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, open to renaming it to TTDDataClient, for reason being that once its imported as
from ttd_data import DataClient, its not clear reading DataClient.DoSomething() to understand where its coming from.

Having TTD part of the client name makes it clear when reading code.

Comment thread .speakeasy/gen.yaml Outdated
asyncMode: both
authors:
- Speakeasy
baseErrorName: TTDDataError
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In spirit of the above how about DataError and ApiError?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel DataError and ApiError are too generic. TTDDataError is clear by name, where the error came from. I am in favor of editing ApiError to be TTDApiError to match. But generic names like DataError, ApiError may conflict with other libraries which may have generic error names.

Comment thread data-api-local/TESTING.md Outdated
| Variable | Description |
|---|---|
| `TTD_AUTH_TOKEN` | **(Required)** Your TTD authentication token |
| `TTD_DATA_SERVER_URL` | API server URL (defaults to `https://api.example.com`) |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this needs to be regenerated? Does not seem to be accurate anymore

Comment thread data-api-local/TESTING.md
source .venv/bin/activate
pip install -e .
export TTD_AUTH_TOKEN="your-ttd-auth-token-here"
export TTD_DATA_SERVER_URL="https://usw-data.adsrvr.org"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we pick usw-data.adsrvr.org as a default?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://partner.thetradedesk.com/v3/portal/data/doc/DataEnvironments#first-pd-servers
Referred to this while setting it up, all first-party dataservers are region specific. I can change it to https://bulk-data.adsrvr.org that seems like the only generic name but is confusing since our documentation does not state it as first party dataserver.

| `ttd_auth` | *Optional[str]* | :heavy_minus_sign: | Data API token for authentication. If not provided, TtdSignature is required. |
| `ttd_signature` | *Optional[str]* | :heavy_minus_sign: | Legacy signature-based authentication. Required if TTD-Auth is not provided. |
| `data_provider_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `items` | List[[models.AdvertiserDataItem](../../models/advertiserdataitem.md)] | :heavy_minus_sign: | N/A |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tangential but I feel like I should look into why this is coming as optional from swagger

import pydantic
from ttd_data.errors import TTDDataError
from ttd_data.models import (
advertiserdataserverresponseline as models_advertiserdataserverresponseline,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a very ugly name, is there some policy we can tweak so that this gets generated with some _ in between or smth.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to do with how its named in swagger. We can override it and change some setting in speakeasy to ensure that it is not overwritten everytime speakeasy generates a new version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, i agree this would be a good improvement, we do this in workflows if you need a model or the speakeasy docs should have guidance

Comment thread README.md Outdated


with TTDData(
server_url="https://api.example.com",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still see a lot of these and no default alias'ed URL 🤔

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed this in the slack thread, there should be a follow-up to set a default / alias

@adithyasamavedhi-ttd adithyasamavedhi-ttd force-pushed the adi-DATEX-472-publish-data-apis-sdk branch from feec7aa to 3515943 Compare February 12, 2026 01:35
@adithyasamavedhi-ttd adithyasamavedhi-ttd merged commit 8317523 into main Feb 12, 2026
@ezra-ttd ezra-ttd deleted the adi-DATEX-472-publish-data-apis-sdk branch February 12, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants