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: docs/cdn.md
+40-97Lines changed: 40 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,20 @@
3
3
4
4
The **Transpose CDN** provides supplementary data for endpoints across the Transpose API suite, including raw block data, NFT images, media, and metadata, collection images, and token symbols.
5
5
6
-
## Data Models
7
-
When querying the Transpose CDN, you will be dealing with the ``CDNResponse`` model.
The **CDN Response Model** contains the content type, content, and helper methods which can assist you in working with CDN data. The **CDN Record Model** follows the following structure:
11
21
12
22
#### Attributes
@@ -26,104 +36,37 @@ The **CDN Response Model** contains the content type, content, and helper method
26
36
| json | Attempt to get the CDNResponse.contents as a dict. |`CDNResponse.json()`|
27
37
| image | Attempt to parse the CDNResponse as a PIL image. |`CDNResponse.image()`|
28
38
39
+
</details>
29
40
30
-
# Endpoint Specifications
31
41
32
-
## Query Endpoints
42
+
## Download Endpoints
33
43
34
-
### Single Query
35
-
This endpoint returns the CDN response for a given query.
The **CDN Response Model** contains the content type, content, and helper methods which can assist you in working with CDN data. The **CDN Record Model** follows the following structure:
Copy file name to clipboardExpand all lines: docs/documentation.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You can find specific documentation on a per-product basis below.
9
9
| <imgsrc="https://assets.website-files.com/624cc12cbb8535a77bafc47d/628d465b6551e284a9ae73e4_Wallet_Logo_ENS.png"width="50"height="50"><br> ENS API | The ENS API provides endpoints for looking up ENS names (both historical and primary), resolving ENS names and records, and monitoring ENS transfers and sales. |[ENS API Docs](https://github.com/TransposeData/transpose-python-sdk/blob/main/docs/ens.md)|
10
10
| <imgsrc="https://assets.website-files.com/624cc12cbb8535a77bafc47d/6286795ef57a1412d6d767fc_NFT_Logo_Solid.png"width="50"height="50"><br> NFT API | The NFT API provides endpoints for retrieving any collection and NFT in existence, as well as NFT images, operators, owners, transfers, approvals, and much more (fully supports both ERC-721 and ERC-1155 NFTs). |[NFT API Docs](https://github.com/TransposeData/transpose-python-sdk/blob/main/docs/nft.md)|
11
11
| <imgsrc="https://assets.website-files.com/624cc12cbb8535a77bafc47d/628fb0f77f6279a920577119_Token_Logo2_Solid.png"width="50"height="50"><br>Token API | The Token API provides endpoints for retrieving any token, token balance, transfer, and symbol in existence, including full support for native token transfers and balances (fully supports both ERC-20 and ERC-777 tokens). |[Token API Docs](https://github.com/TransposeData/transpose-python-sdk/blob/main/docs/token.md)|
12
-
| <imgsrc="https://assets.website-files.com/624c8536aa7f872fe6829dbd/628feeeb8eb1204a1c701cd1_CDN_Logo_Red-p-500.png"width="50"height="50"><br>CDN | The Transpose CDN provides supplementary data for endpoints across the Transpose API suite, including raw block data, NFT images, media, and metadata, collection images, and token symbols. |[CDN Docs](https://github.com/TransposeData/transpose-python-sdk/blob/main/docs/cdn.md)|
12
+
|<imgsrc="https://assets.website-files.com/624c8536aa7f872fe6829dbd/628feeeb8eb1204a1c701cd1_CDN_Logo_Red-p-500.png"width="50"height="50"><br>CDN | The Transpose CDN provides supplementary data for endpoints across the Transpose API suite, including raw block data, NFT images, media, and metadata, collection images, and token symbols. |[CDN Docs](https://github.com/TransposeData/transpose-python-sdk/blob/main/docs/cdn.md)|
13
13
14
14
## SDK Documentation
15
15
You can learn more about the Transpose SDK and how it works below.
@@ -18,7 +18,10 @@ You can learn more about the Transpose SDK and how it works below.
18
18
The Transpose SDK uses custom classes to represent API responses:
19
19
20
20
#### Error Classes
21
+
<details>
22
+
<summary>SDK Error Class Specifications</summary>
21
23
The SDK uses the following error classes to represent API errors:
24
+
22
25
-``TransposeBadRequest``
23
26
- Represents a 400 Bad Request error from the Transpose API.
24
27
-``TransposeRateLimit``
@@ -31,8 +34,12 @@ The SDK uses the following error classes to represent API errors:
31
34
- Represents a 404 Not Found error from the Transpose API.
32
35
33
36
These errors will be raised when the SDK encounters an error from the Transpose API.
37
+
</details>
34
38
35
39
#### Response Classes
40
+
<details>
41
+
<summary>Response Class Specifications</summary>
42
+
36
43
The SDK will always return a list of response objects from the Transpose API. For example, calling the ``ens.records_by_date`` endpoint will return a list of ``ENSRecord`` objects.
37
44
38
45
These response objects can be accessed in the following ways:
@@ -42,12 +49,13 @@ These response objects can be accessed in the following ways:
42
49
All response objects can also be accessed as a dictionary by calling ``.to_dict()`` on them:
43
50
-``ENSRecord[0].to_dict()`` will return the first record as a dictionary.
44
51
-``ENSRecord[i].to_dict()`` retrieves the i-th record as a dictionary.
52
+
</details>
45
53
46
54
### Pagination
55
+
<details>
56
+
<summary>Pagination with the Transpose SDK.</summary>
47
57
48
-
Pagination on the Transpose API is straightforward.
49
-
50
-
Transpose API endpoints will return a maximum of 500 results in a single query. To return the next page, simply call ``api.next()``. If ``api.next()`` returns ``None``, then there are no more pages.
58
+
Transpose endpoints will return a maximum of 500 results in a single query. To return the next page, simply call ``api.next()``. If ``api.next()`` returns ``None``, then there are no more pages.
51
59
52
60
Here is a standard pagination implementation:
53
61
@@ -64,9 +72,13 @@ while True:
64
72
# otherwise, print length of data
65
73
else: print(len(data))
66
74
```
75
+
</details>
76
+
67
77
68
78
### Bulk Requests
79
+
<details>
69
80
81
+
<summary>Bulk requesting data with the Transpose SDK</summary>
70
82
Alongside pagination, we also offer a convenience method for iterating over all pages. This method will handle pagination for you, and will return a list of all results.
The SDK natively includes a plotting library which implements [plotly](https://plot.ly/python/). Using it, you can quickly create plots of data obtained through the Transpose API.
113
129
114
130
For a plotting example, check out the [demo](https://github.com/TransposeData/transpose-python-sdk/blob/main/demo/plotting.py) file, which will graph the past hour's gas prices in a bar chart.
@@ -153,4 +169,5 @@ This will return an object on which you can call the following methods:
153
169
- ``shape`` -> OPTIONAL: The shape of the line. Can be either ``linear``, ``spline``, ``vh``, ``hv``, ``vhv``, or ``hvh``.
154
170
- ``smoothing`` -> OPTIONAL: The number of points to smooth the data with.
155
171
- For ``line``, this will calculate a moving average of the data with a period of ``smoothing``.
156
-
- For ``bar``, this will group and average the data over ``smoothing`` points.
172
+
- For ``bar``, this will group and average the data over ``smoothing`` points.
0 commit comments