{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Guides","type":"markdown"},"seo":{"title":"pytd vs td-client-python vs pandas-td","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pytd-vs-td-client-python-vs-pandas-td","__idx":0},"children":["pytd vs td-client-python vs pandas-td"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data offers three different Python clients. The following list summarizes each client’s characteristics."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-client-python","__idx":1},"children":["td-client-python"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic REST API wrapper."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Similar functionalities to td-client-{",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-client-ruby"},"children":["ruby"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-client-java"},"children":["java"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-client-node"},"children":["node"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/td-client-go"},"children":["go"]},"}."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The capability is limited by ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/tools/cli-and-sdks/td-toolbelt"},"children":["what Treasure Data REST API can do"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pytd","__idx":2},"children":["pytd"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Efficient connection to Trino(Presto) based on ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/prestodb/presto-python-client"},"children":["presto-python-client"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Multiple data ingestion methods and a variety of utility functions."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pandas-td-deprecated","__idx":3},"children":["pandas-td (deprecated)"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Old tool optimized for ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://pandas.pydata.org/"},"children":["pandas"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://jupyter.org/"},"children":["Jupyter Notebook"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["pytd"]}," offers a compatible function set under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pytd.pandas_td"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"choosing-a-client","__idx":4},"children":["Choosing a Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The client you choose depends on your specific use case. Here are some common guidelines:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use td-client-python if you want to execute ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["basic CRUD operations"]}," from Python applications."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["pytd"]}," for (1) ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["analytical purpose"]}," relying on pandas and Jupyter Notebook, and (2) achieving ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["more efficient data access"]},"."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There is a known difference to the  ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pandas_td.to_td"]}," function for type conversion. Since ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pytd.writer.BulkImportWriter"]}," (default writer pytd) uses CSV as an intermediate file before uploading a table, the column type might change via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pandas.read_csv"]},". To respect the column type as much as possible, you need to pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fmt=\"msgpack\""]}," argument to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["to_td"]}," function."]}]}]},"headings":[{"value":"pytd vs td-client-python vs pandas-td","id":"pytd-vs-td-client-python-vs-pandas-td","depth":1},{"value":"td-client-python","id":"td-client-python","depth":2},{"value":"pytd","id":"pytd","depth":2},{"value":"pandas-td (deprecated)","id":"pandas-td-deprecated","depth":2},{"value":"Choosing a Client","id":"choosing-a-client","depth":2}],"frontmatter":{"seo":{"title":"pytd vs td-client-python vs pandas-td"}},"lastModified":"2026-02-17T01:46:37.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/tools/pytd/pytd-vs-td-client-python-vs-pandas-td","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}