|
1 | 1 | # Python SDK for ImageKit |
2 | 2 |
|
| 3 | +[](https://github.com/imagekit-developer/imagekitio-python/) |
| 4 | +[](https://opensource.org/licenses/MIT) |
| 5 | +[](https://twitter.com/ImagekitIo) |
| 6 | + |
3 | 7 | Python SDK for [ImageKit](https://imagekit.io/) that implements the new APIs and interface for performing different file |
4 | 8 | operations. |
5 | 9 |
|
@@ -90,16 +94,16 @@ https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg?tr=h-300%2Cw- |
90 | 94 |
|
91 | 95 | The ```.url()``` method accepts the following parameters |
92 | 96 |
|
93 | | -| Option | Description | |
94 | | -| :----------------| :----------------------------- | |
95 | | -| url_endpoint | Optional. The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ | |
96 | | -| path | Conditional. This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter need to be specified for URL generation. | |
97 | | -| src | Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter need to be specified for URL generation. | |
98 | | -| transformation | Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/imagekit-docs/chained-transformations) can be specified as different objects of the array. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. | |
99 | | -| transformation_position | Optional. Default value is `path` that places the transformation string as a path parameter in the URL. Can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use `src` parameter to create the URL, then the transformation string is always added as a query parameter. | |
100 | | -| query_parameters | Optional. These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful, if you want to add some versioning parameter to your URLs. | |
101 | | -| signed | Optional. Boolean. Default is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. This can only be used if you are creating the URL with the `url_endpoint` and `path` parameters, and not with the `src` parameter. | |
102 | | -| expire_seconds | Optional. Integer. Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL and the image signature is modified accordingly. | |
| 97 | +| Option | Description | |
| 98 | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 99 | +| url_endpoint | Optional. The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ | |
| 100 | +| path | Conditional. This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter need to be specified for URL generation. | |
| 101 | +| src | Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter need to be specified for URL generation. | |
| 102 | +| transformation | Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/imagekit-docs/chained-transformations) can be specified as different objects of the array. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. | |
| 103 | +| transformation_position | Optional. Default value is `path` that places the transformation string as a path parameter in the URL. Can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use `src` parameter to create the URL, then the transformation string is always added as a query parameter. | |
| 104 | +| query_parameters | Optional. These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful, if you want to add some versioning parameter to your URLs. | |
| 105 | +| signed | Optional. Boolean. Default is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. This can only be used if you are creating the URL with the `url_endpoint` and `path` parameters, and not with the `src` parameter. | |
| 106 | +| expire_seconds | Optional. Integer. Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL and the image signature is modified accordingly. | |
103 | 107 |
|
104 | 108 |
|
105 | 109 | ## Examples of generating URLs |
@@ -180,49 +184,49 @@ If a transformation is supported in ImageKit, but a name for it cannot be found |
180 | 184 | transformation code from ImageKit docs as the name when using in the ```url``` function. |
181 | 185 |
|
182 | 186 | | Supported Transformation Name | Translates to parameter | |
183 | | -|-------------------------------|-------------------------| |
184 | | -| height | h | |
185 | | -| width | w | |
186 | | -| aspect_ratio | ar | |
187 | | -| quality | q | |
188 | | -| crop | c | |
189 | | -| crop_mode | cm | |
190 | | -| x | x | |
191 | | -| y | y | |
192 | | -| focus | fo | |
193 | | -| format | f | |
194 | | -| radius | r | |
195 | | -| background | bg | |
196 | | -| border | bo | |
197 | | -| rotation | rt | |
198 | | -| blur | bl | |
199 | | -| named | n | |
200 | | -| overlay_image | oi | |
201 | | -| overlay_x | ox | |
202 | | -| overlay_y | oy | |
203 | | -| overlay_focus | ofo | |
204 | | -| overlay_height | oh | |
205 | | -| overlay_width | ow | |
206 | | -| overlay_text | ot | |
207 | | -| overlay_text_font_size | ots | |
208 | | -| overlay_text_font_family | otf | |
209 | | -| overlay_text_color | otc | |
210 | | -| overlay_alpha | oa | |
211 | | -| overlay_text_typography | ott | |
212 | | -| overlay_background | obg | |
213 | | -| overlay_image_trim | oit | |
214 | | -| progressive | pr | |
215 | | -| lossless | lo | |
216 | | -| trim | t | |
217 | | -| metadata | md | |
218 | | -| color_profile | cp | |
219 | | -| default_image | di | |
220 | | -| dpr | dpr | |
221 | | -| effect_sharpen | e-sharpen | |
222 | | -| effect_usm | e-usm | |
223 | | -| effect_contrast | e-contrast | |
224 | | -| effect_gray | e-grayscale | |
225 | | -| original | orig | |
| 187 | +| ----------------------------- | ----------------------- | |
| 188 | +| height | h | |
| 189 | +| width | w | |
| 190 | +| aspect_ratio | ar | |
| 191 | +| quality | q | |
| 192 | +| crop | c | |
| 193 | +| crop_mode | cm | |
| 194 | +| x | x | |
| 195 | +| y | y | |
| 196 | +| focus | fo | |
| 197 | +| format | f | |
| 198 | +| radius | r | |
| 199 | +| background | bg | |
| 200 | +| border | bo | |
| 201 | +| rotation | rt | |
| 202 | +| blur | bl | |
| 203 | +| named | n | |
| 204 | +| overlay_image | oi | |
| 205 | +| overlay_x | ox | |
| 206 | +| overlay_y | oy | |
| 207 | +| overlay_focus | ofo | |
| 208 | +| overlay_height | oh | |
| 209 | +| overlay_width | ow | |
| 210 | +| overlay_text | ot | |
| 211 | +| overlay_text_font_size | ots | |
| 212 | +| overlay_text_font_family | otf | |
| 213 | +| overlay_text_color | otc | |
| 214 | +| overlay_alpha | oa | |
| 215 | +| overlay_text_typography | ott | |
| 216 | +| overlay_background | obg | |
| 217 | +| overlay_image_trim | oit | |
| 218 | +| progressive | pr | |
| 219 | +| lossless | lo | |
| 220 | +| trim | t | |
| 221 | +| metadata | md | |
| 222 | +| color_profile | cp | |
| 223 | +| default_image | di | |
| 224 | +| dpr | dpr | |
| 225 | +| effect_sharpen | e-sharpen | |
| 226 | +| effect_usm | e-usm | |
| 227 | +| effect_contrast | e-contrast | |
| 228 | +| effect_gray | e-grayscale | |
| 229 | +| original | orig | |
226 | 230 |
|
227 | 231 | ## File Upload |
228 | 232 |
|
|
0 commit comments