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
+33-17Lines changed: 33 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,8 @@ The usage of the SDK has been explained below
51
51
52
52
This method allows you to create a URL using the path where the image exists and the URL
53
53
endpoint(url_endpoint) you want to use to access the image. You can refer to the documentation
54
-
[here](https://docs.imagekit.io/imagekit-docs/url-endpoints) to read more about URL endpoints
55
-
in ImageKit and the section about [image origins](https://docs.imagekit.io/imagekit-docs/configure-origin) to understand
54
+
[here](https://docs.imagekit.io/integration/url-endpoints) to read more about URL endpoints
55
+
in ImageKit and the section about [image origins](https://docs.imagekit.io/integration/configure-origin) to understand
56
56
about paths with different kinds of origins.
57
57
58
58
@@ -100,7 +100,7 @@ The ```.url()``` method accepts the following parameters
100
100
| 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/|
101
101
| 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. |
102
102
| 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. |
103
-
| 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 | 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/features/image-transformations/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. |
104
104
| 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. |
105
105
| 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. |
106
106
| 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. |
The complete list of transformations supported and their usage in ImageKit can be found [here](https://docs.imagekit.io/imagekit-docs/image-transformations).
182
+
The complete list of transformations supported and their usage in ImageKit can be found [here](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations).
183
183
The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler and readable.
184
184
If a transformation is supported in ImageKit, but a name for it cannot be found in the table below, then use the
185
185
transformation code from ImageKit docs as the name when using in the ```url``` function.
@@ -232,13 +232,13 @@ transformation code from ImageKit docs as the name when using in the ```url``` f
232
232
## File Upload
233
233
234
234
The SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media library. It
235
-
accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/imagekit-docs/server-side-file-upload).
235
+
accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).
236
236
237
237
The `upload()` method requires at least the `file` and the `file_name` parameter to upload a file and returns
238
238
a callback with the `error` and `result` as arguments. You can pass other parameters supported by the
239
239
ImageKit upload API using the same parameter name as specified in the upload API documentation. For example, to
240
240
specify tags for a file at the time of upload use the tags parameter as specified in the
The SDK provides a simple interface for all the [media APIs mentioned here](https://docs.imagekit.io/imagekit-docs/media-api)
430
+
The SDK provides a simple interface for all the [media APIs mentioned here](https://docs.imagekit.io/api-reference/media-api)
431
431
to manage your files. This also returns `error` and `result`, error will be `None` if API succeeds.
432
432
433
433
**1. List & Search Files**
434
434
435
435
Accepts an object specifying the parameters to be used to list and search files. All parameters specified
436
-
in the [documentation here](https://docs.imagekit.io/imagekit-docs/list-and-search-files-api) can be passed as is with the
436
+
in the [documentation here](https://docs.imagekit.io/api-reference/media-api/list-and-search-files#list-and-search-file-api) can be passed as is with the
437
437
correct values to get the results.
438
438
439
439
```python
@@ -444,20 +444,28 @@ correct values to get the results.
444
444
)
445
445
```
446
446
**2. Get File Details**
447
-
Accepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/imagekit-docs/get-file-details-api)
447
+
Accepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-details)
448
448
449
449
```python
450
450
imagekit.get_file_details(file_id)
451
451
```
452
452
453
453
**3. Get File Metadata**
454
-
Accepts the file ID and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/imagekit-docs)
454
+
Accepts the file ID and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files)
455
455
```python
456
456
imagekit.get_metadata(file_id)
457
457
```
458
458
459
+
460
+
**3. Get File Metadata from remote url**
461
+
Accepts the remote file url and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-from-remote-url)
462
+
463
+
```python
464
+
imagekit.get_remote_url_metadata(remote_file_url)
465
+
```
466
+
459
467
**4. Update File Details**
460
-
Update parameters associated with the file as per the [API documentation here](https://docs.imagekit.io/imagekit-docs).
468
+
Update parameters associated with the file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/update-file-details).
461
469
The first argument to the `update_field_details` method is the file ID and the second argument is an object with the
Delete a file as per the [API documentation here](https://docs.imagekit.io/imagekit-docs/delete-file-api). The method accepts the file ID of the file that has to be
480
+
Delete a file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-file). The method accepts the file ID of the file that has to be
473
481
deleted.
474
482
475
483
```python
476
484
imagekit.delete_file(file_id)
477
485
```
478
486
487
+
**6. Bulk File Delete by IDs**
488
+
Delete a file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-files-bulk). The method accepts list of file IDs of files that has to be
489
+
deleted.
490
+
491
+
```python
492
+
imagekit.bulk_delete(["file_id1", "file_id2"])
493
+
```
494
+
479
495
**6. Purge Cache**
480
-
Programmatically issue a cache clear request as clear request as pet the [API documentation here](https://docs.imagekit.io/imagekit-docs/purge-cache-api).
496
+
Programmatically issue a cache clear request as clear request as pet the [API documentation here](https://docs.imagekit.io/api-reference/media-api/purge-cache).
481
497
Accepts the full URL of the file for which the cache has to be cleared.
482
498
```python
483
499
imagekit.purge_cache(full_url)
484
500
```
485
501
**7. Purge Cache Status**
486
502
487
503
Get the purge cache request status using the request ID returned when a purge cache request gets submitted as pet the
0 commit comments