You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,12 @@
1
-
*A simple and pythonic Python implementation of ThoughtSpot's REST APIs (both V1 and V2).*
2
-
# LAST RELEASE NOTICE
3
-
The 1.8.8 release will be the last under the `thoughtspot_rest_api_v1 / thoughtspot-rest-api-v1`package name.
1
+
*A simple and pythonic Python implementation of ThoughtSpot's REST APIs (both V1 and V2.0).*
2
+
# PACKAGE RENAME NOTICE
3
+
The 2.N.N releases of `thoughtspot_rest_api` are a renamed continuation of the older `thoughtspot_rest_api_v1 / thoughtspot-rest-api-v1`packages.
4
4
5
-
The package will transition to just `thoughtspot_rest_api / thoughtspot-rest-api` to reflect that V2.0 API is the primary API for ThoughtSpot. All code will remain the same other than the package name changing.
6
-
7
-
The repository itself will switch to a public / private mirror system at this time as well, which will break existing watching / forks.
5
+
If you are using the `thoughtspot_rest_api_v1` package, please install `thoughtspot_rest_api` and update your import statements and everything should work. All new releases will be under this package name.
8
6
9
7
# README
10
8
11
-
`thoughtspot_rest_api_v1` library implements the ThoughtSpot public REST APIs as directly as possible. It is not a "full SDK" with representation of each request and response type, but rather uses Python's Lists and Dicts for input and output.
9
+
`thoughtspot_rest_api` library implements the ThoughtSpot public REST APIs as directly as possible. It is not a "full SDK" with representation of each request and response type, but rather uses Python's Lists and Dicts for input and output.
12
10
13
11
When using ThoughtSpot Cloud, always chose the V2.0 REST API via the `TSRestApiV2` class.
14
12
@@ -28,9 +26,9 @@ Method and argument names closely match to the documented API endpoints, with a
28
26
---
29
27
30
28
## Learning from the source code for V1
31
-
At this point, if you have a need to use the V1 REST API, please use the TSRestApiV1 class. If you have some need for using the V1 REST API outside of Pyython, the library can be used a reference for how a V1 REST API endpoint is called correctly, look at the `/src/thoughtspot_rest_api_v1/tsrestapiv1.py` file. It contains the definition of all the ENUMs and the `TSRestApiV1` class.
29
+
At this point, if you have a need to use the V1 REST API, please use the TSRestApiV1 class. If you have some need for using the V1 REST API outside of Pyython, the library can be used a reference for how a V1 REST API endpoint is called correctly, look at the `/src/thoughtspot_rest_api/tsrestapiv1.py` file. It contains the definition of all the ENUMs and the `TSRestApiV1` class.
32
30
33
-
Similarly, the `TSRestApiV2` class is defined in the `/src/thoughtspot_rest_api_v1/tsrestapiv2.py` file.
31
+
Similarly, the `TSRestApiV2` class is defined in the `/src/thoughtspot_rest_api/tsrestapiv2.py` file.
34
32
35
33
The `TSRestApiV1` class uses the *requests* library to create an internal requests.Session object when the REST API sign-in command is run. This fulfils the ThoughtSpot REST API V1 requirement for session cookie details to be passed in every request.
36
34
@@ -42,29 +40,29 @@ The library is designed to work with the latest version of ThoughtSpot Cloud. It
42
40
43
41
## Getting Started
44
42
45
-
To install thoughtspot_rest_api_v1, simply run this simple command in your terminal of choice:
43
+
To install thoughtspot_rest_api, simply run this simple command in your terminal of choice:
Once you have a copy of the source, you can embed it in your own Python package, or install it into your site-packages easily:
58
56
59
57
```
60
-
$ cd thoughtspot_rest_api_v1_python
58
+
$ cd thoughtspot_rest_api_python
61
59
$ python3 -m pip install --upgrade
62
60
```
63
61
64
62
---
65
63
66
64
## Importing the library
67
-
from thoughtspot_rest_api_v1 import *
65
+
from thoughtspot_rest_api import *
68
66
69
67
This will bring the `TSRestApiV1` and `TSRestApiV2` classes, as well as the following enumerations: `TSTypes`, `MetadataNames`, `MetadataSorts`, `MetadataSubtypes`, `MetadataCategories`, `ShareModes`, `Privileges`.
70
68
@@ -94,7 +92,7 @@ REST API V2 allows for Bearer Token authentication, which is the preferred metho
94
92
Next request a Full Access token using `auth_token_full()`. Get the `token` value from the response, then set the `bearer_token` property of the TSRestApiV2 object with the token. The object will keep the bearer token and use it in the headers of any subsequent call.
95
93
96
94
97
-
from thoughtspot_rest_api_v1 import *
95
+
from thoughtspot_rest_api import *
98
96
99
97
username = os.getenv('username') # or type in yourself
100
98
password = os.getenv('password') # or type in yourself
@@ -110,7 +108,7 @@ Next request a Full Access token using `auth_token_full()`. Get the `token` valu
110
108
111
109
If you have requested an auth token from the REST API Playground, you can simply set the `bearer_token` property directly
0 commit comments