All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
6.0.0 - 2024-09-19
- File Uploader have been updated to v1
5.1.0 - 2024-04-09
- For
File
:detect_faces()
method to detect faces in images.
- For
ImageTransformation
:text()
method to allow adding text overlays to images.rect()
method to allow adding solid color overlays to images.strip_meta()
method to control the presence of EXIF metadata in the resulting image.border_radius()
method to add rounded corners.zoom_objects()
method to zoom in on objects.rasterize()
method to rasterize SVG images.detect_faces()
method, which provides face detection in images. WhileImageTransformation.detect_faces()
ensures consistency within theImageTransformation
API, you are more likely to useFile.detect_faces()
to obtain face detection results.
- Blocks have been updated to v0.36.0
- For
ImageTransformation
:- The
overlay()
andoverlay_self()
methods now treatoverlay_width
andoverlay_height
parameters as optional. - Unified
gif2video()
,gif2video_format()
, andgif2video_quality()
methods into a singlegif2video()
method. Theformat
andquality
parameters can now be accepted directly in thegif2video()
method.
- The
- Black dev dependency has been updated to 24.3.0.
- Django forms: Any modifications made in an image editor are now correctly restored when editing the same image again. Previously, the editor state was not restored, and the original image was displayed instead. via uploadcare/blocks#615.
- For
ImageTransformation
:- Deprecated the separate
gif2video_format
andgif2video_quality
methods. Please use theformat
andquality
parameters directly in thegif2video
method for setting these properties.
- Deprecated the separate
5.0.1 - 2024-03-02
- The SSL context is now cached by default, resulting in significant performance improvements when initializing the
Uploadcare
class frequently. #279 - Removed the warning for the usage of the deprecated
pydantic.utils.deep_update
#283
5.0.0 - 2023-12-28
In version 5.0, we introduce a new file uploader, which is now the default for Django projects. If you prefer to continue using the old jQuery-based widget, you can enable it by setting the use_legacy_widget
option in your configuration:
UPLOADCARE = {
...,
"use_legacy_widget": True,
"legacy_widget": {
"version": "3.x",
}
}
Additionally, please take note that some settings have been renamed in this update (see the next section).
-
Python 3.6 and 3.7 are no longer supported.
-
Django 1.11, 2.0, and 2.1 are no longer supported.
-
Pydantic has been updated to Version 2. Projects dependent on Pydantic Version 1 may encounter errors due to incompatibility between Versions 1 and 2.
-
Removed
tox.ini
. The recommended method for running tests locally is now through act with Docker. -
For Django settings (
UPLOADCARE = {...}
):widget_*
settings were renamed and moved:UPLOADCARE["widget_version"]
toUPLOADCARE["legacy_widget"]["version"]
UPLOADCARE["widget_build"]
toUPLOADCARE["legacy_widget"]["build"]
UPLOADCARE["widget_variant"]
toUPLOADCARE["legacy_widget"]["build"]
(this is not a typo: formerwidget_build
andwidget_variant
settings were equialent)UPLOADCARE["widget_url"]
toUPLOADCARE["legacy_widget"]["override_js_url"]
and works regardless ofuse_hosted_assets
value.
-
For
pyuploadcare.dj.conf
:- Individual variables were moved into one dict called
config
. If you've accessed these settings frompyuploadcare.dj.conf
module in your code, please migrate:pub_key
toconfig["pub_key"]
secret
toconfig["secret"]
cdn_base
toconfig["cdn_base"]
upload_base_url
toconfig["upload_base_url"]
use_hosted_assets
toconfig["use_hosted_assets"]
widget_version
toconfig["legacy_widget"]["version"]
widget_build
toconfig["legacy_widget"]["build"]
uploadcare_js
toget_legacy_widget_js_url()
- Gone from
pyuploadcare.dj.conf
:widget_filename
hosted_url
local_url
- Individual variables were moved into one dict called
-
For
pyuploadcare.dj.forms
:FileWidget
renamed toLegacyFileWidget
.FileWidget
is an all-new implementation now.- By default,
FileWidget
is used. To useLegacyFileWidget
, please setUPLOADCARE["use_legacy_widget"]
toTrue
- Added Python 3.12 and Django 5.0 to the test matrix.
- Updated dependencies:
httpx
,pydantic
,pytz
,typing-extensions
. - Updated development dependencies:
mypy
,pytest
,black
,isort
,flake8
,flake8-print
,vcrpy
,yarl
,coverage
,pytest-cov
,sphinx
,sphinx-argparse
,types-*
. Replacedpytest-freezegun
withpytest-freezer
.
4.3.0 - 2023-12-24
- For
AkamaiSecureUrlBuilderWithAclToken
andAkamaiSecureUrlBuilderWithUrlToken
:- Special characters that were not previously escaped are now properly handled, as detailed in issue #275.
- For
AkamaiSecureUrlBuilderWithAclToken
andAkamaiSecureUrlBuilderWithUrlToken
:- Both classes have been made more consistent and now accept a full URL, URL path, or just the UUID of a file – whichever is more convenient for you.
-
For
FileGroup
:- Added a deprecation warning when accessing
datetime_stored
property, as it has been deprecated in the REST API. This field does not exist in REST API v0.7.x.
- Added a deprecation warning when accessing
-
For
GroupsAPI
:- Added a deprecation warning when calling
store
method, as it has been deprecated in the REST API. This API endpoint does not exist in REST API v0.7.x.
- Added a deprecation warning when calling
4.2.2 - 2023-11-20
- For
File
:- AWS Rekognition Moderation results are now accessible via
File.info["appdata"]["aws_rekognition_detect_moderation_labels"]
.
- AWS Rekognition Moderation results are now accessible via
4.2.1 - 2023-11-17
- For
AddonsAPI
:- In version 4.2.0, passing a Python dictionary as
params
to theexecute
method would cause anAttributeError
. Now, you can use either anAddonExecutionParams
instance or adict
.
- In version 4.2.0, passing a Python dictionary as
4.2.0 - 2023-11-16
Summary of this update:
- Added support for the
save_in_group
parameter in multipage conversion (#258); - Implemented the AWS Rekognition Moderation addon API (#260);
- Added
signed_uploads
setting for Django projects (#262); - Secure URL generation improvements (#263 & #264);
- Various bug fixes.
There are no breaking changes in this release.
-
For
Uploadcare
:- Added a type for the
event
parameter of thecreate_webhook
andupdate_webhook
methods. - Added the
generate_upload_signature
method. This shortcut could be useful for signed uploads from your website's frontend, where the signature needs to be passed outside of your website's Python part (e.g., for the uploading widget). - Added
generate_secure_url_token
method. Similar togenerate_secure_url
, it returns only a token, not the full URL. - Added an optional
wildcard
parameter to thegenerate_secure_url
method.
- Added a type for the
-
For
File
:- Added the
save_in_group
parameter to theconvert
andconvert_document
methods. It defaults toFalse
. When set toTrue
, multi-page documents will additionally be saved as a file group. - Added the
get_converted_document_group
method. It returns aFileGroup
instance for converted multi-page documents.
- Added the
-
For
DocumentConvertAPI
:- Added the
retrieve
method, which corresponds to theGET /convert/document/:uuid/
API endpoint.
- Added the
-
For
AddonsAPI
/AddonLabels
:- Added support for the Unsafe content detection addon (
AddonLabels.AWS_MODERATION_LABELS
).
- Added support for the Unsafe content detection addon (
-
For Django integration:
- Added the
signed_uploads
setting for Django projects. When enabled, this setting exposes the generated signature to the uploading widget.
- Added the
-
For
AkamaiSecureUrlBuilderWithAclToken
:- Added
get_token
method. - Added an optional
wildcard
parameter to thebuild
method.
- Added
-
Introduced
AkamaiSecureUrlBuilderWithUrlToken
class.
AkamaiSecureUrlBuilder
has been renamed toAkamaiSecureUrlBuilderWithAclToken
. It is still available under the old name and works as before, but it will issue a deprecation warning when used.
- For
AddonsAPI
/AddonExecutionParams
:- Fixed an issue where calling
execute
andstatus
withAddonLabels
's attributes (such asAddonLabels.REMOVE_BG
) for theaddon_name
would result in a 404 Not Found error. - Fixed
ValidationError
when constructingAddonClamAVExecutionParams
orAddonRemoveBGExecutionParams
with omitted optional parameters.
- Fixed an issue where calling
4.1.3 - 2023-10-05
- For
AudioStreamInfo
:- added
profile
field.
- added
pyuploadcare
now officially supports Python 3.12 (please notice that if you're using Django, that doesn't support Python 3.12 as of yet).
4.1.2 - 2023-09-08
- Incorrect expiration time was calculated for signed uploads causing the
AuthenticationError: Expired signature
exception.
4.1.1 - 2023-09-04
- Resolved a
ValidationError
that occurred when requesting file information for specific video files.
4.1.0 - 2023-07-18
- For
Uploadcare
andUploadAPI
:upload_from_url
andupload_from_url_sync
can now accept two new optional parameters:check_duplicates
andsave_duplicates
. These correspond tocheck_URL_duplicates
andsave_URL_duplicates
for/from_url/
upload API endpoint respectively.
- For
FileGroup
:- The
delete
method now includes an optionaldelete_files
argument, which indicates whether the files within the specified group should also be deleted.
- The
- Bumped
httpx
dependency for py37+. - Bumped
yarl
dev dependency for py37+. - Bumped
coverage
dev dependency for py37+. - Tests are now run against Python 3.11 as well. The minimum supported version of Python remains 3.6.
- Tests are now run against Django 4.0, 4.1 and 4.2 as well. The minimum supported version of Django remains 1.11.
4.0.0 - 2022-12-26
Now uses REST API v0.7.
- For
File.info
:- File information doesn't return
image_info
andvideo_info
fields anymore, they were moved into fieldcontent_info
that includes mime-type, image (dimensions, format, etc), video information (duration, format, bitrate, etc), audio information, etc. - Removed
rekognition_info
in favor ofappdata
.
- File information doesn't return
- For
file_list
method ofFileList
:- Removed the option of sorting the file list by file size.
- For
File
:- Removed method
copy
in favor oflocal_copy
andremote_copy
methods. - Files to upload must be opened in a binary mode.
- Removed method
- For
File.info
:- Field
metadata
that includes arbitrary metadata associated with a file. - Field
appdata
that includes dictionary of application names and data associated with these applications.
- Field
- Add Uploadcare API interfaces for
Uploadcare
:MetadataAPI
AddonsAPI
- Added an option to delete a Group.
- Limit for batch operation is set to 100 (doc).
- Iterating over long collections in batch operation.
- Akamai signed URL generation.
3.2.0 - 2022-12-19
- Freezed
httpx
dependency for py37+ (=0.23.0
) to prevent breaking changes in processing files opened in the text mode.
- Akamai signed URL generation.
3.1.0 - 2022-10-24
- Bumped
httpx
dependency for py37+. - Add
follow_redirects
argument for Client request method. - Using
allow_redirects
argument is allowed, but will cause a deprecating warning. - Bumped
black
dependency.
3.0.1 - 2022-10-06
- Bumped
pytz
dependency. - Bumped
typing-extensions
for py37+.
3.0.0 - 2021-11-01
- Multipart uploads.
- Document and video conversions.
- Authenticated URL generator.
- Image transformation path builder.
- Webhook operations.
- Getting project information.
- Low-level API.
Uploadcare
client.
- Dropped support for Python 3.5.
- Dropped support for Python 2.*.
- Allowed uploading from URL in
File.upload
method. - Resource attributes can be accessed now as properties, not methods.
Uploadcare
client should be initialized to access API.- Moved from Travis to Github Actions.
2.7.0 - 2020-05-03
- Support for signed uploads.
- Dropped support for Python 3.4.
- Update bundled widget to version
3.6.1
. See widget changelog.
- Tests.
2.6.0 - 2018-11-29
- Improved error logging.
- Update bundled widget to version
3.6.1
. See widget changelog.
FileWidget.render()
now works in Django 2.1.- Obsolete widget setting
data-upload-base-url
replaced withdata-url-base
- Update bundled widget to version
3.3.0
. See widget changelog. - Update links to the Uploadcare site
- Expand data format in 'User-Agent' request header.
- Change data format in 'User-Agent' request header.
- Update default widget version to
3.x
- Update bundled widget to version
3.2.3
. See widget changelog.
- Add support for Django versions 1.11 and ~2.0
- Miscellaneous updates (version, year in a license file, tox configuration and etc.)
- Drop official support for obsolete Python and Django versions.
Chances are that everything still works. If you have to use those,
modify
tox.ini
, run tests and use at your own risk ;) Or, you may use older versions of the library.
- Add
file.create_local_copy
andfile.create_remote_copy
methods. - Add new
make_public
andpattern
parameters to file.create_remote_copy method. - Add new
store
parameter to file.create_local_copy methods. - Update CDN link to the widget.
- Use wildcard
2.x
to always get the latest patch or minor version of widget version2
. See widget changelog. - Update bundled widget to version
2.10.3
. See widget changelog.
- Support auto storing in upload requests
- Updated widget to version 2.10.0 (see widget changelog).
- Drop support for Python 3.2
- Simplify and reduce test matrix in
.travis.yml
- Fixed issue with missing
ucare_cli
package.
- Added support for version 0.5 of REST API.
- Updated widget to version 2.8.1 (see widget changelog).
- Added the
ucare list_groups
command. - Removed deprecated entities.
NB: There are backward incompatible changes. For detailed information about the upgrade process see update to version 2.0.
- Fixed ZeroDivision error when trying to sync files with no size
- Added support of Django 1.9
- Removed indication of Unicode strings from output of
ucare
- Fixed a group representation for
ucare create_group
command - Fixed error with
ucare sync
when trying to processing of not image files
- Added storage operations
- Added request_limit to ucare_cli
- Expanded User-Agent
- Added sync command to ucare_cli
- Autogenerated documentation for ucare_cli
- update widget to 2.5.5 (see widget changelog)
- Default CDN base to https://ucarecdn.com
- Allow changing CDN base via Django settings
- update widget to 2.5.0 (see widget changelog)
- API version was updated up to 0.4.
- update widget to 2.4.0 (see widget changelog)
- update widget to 2.3.1 (see widget changelog)
- update widget to 1.5.5 (see widget changelog)
- improve synchronous upload API
- fix encoding issues with pip3
- update widget to 1.5.4 (see widget changelog)
- add AUTHORS.txt
- add synchronous upload from URL method to
File
- UploadcareExceptions are
__repr__
'ed properly - update widget to 1.5.3 (see widget changelog)
- fix "source" composition for copy requests
- let configure default throttle retry count via
conf.retry_throttled
- handle responses for HEAD and OPTION requests
- update widget to 1.4.6
- compatibility with Django 1.7
- update widget to 1.4.0
- handle rest api throttling
- update widget to 1.2.3
- fixed compatibility with six library version 1.7.0 and above
- fixed setup script
- update widget to 1.0.1
- fixed logging when response contains unicode chars
- update widget to 0.17.1
- add File.copy()
- add data attribute to UploadcareException
- update widget to 0.13.2
- update pyuploadcare.dj.models.ImageField crop validation
https://ucarecdn.com/
URL was returned to serve widget's assets.
- CDN URL has been changed to
http://www.ucarecdn.com/
. Previous URLhttps://ucarecdn.com/
is depricated. - Widget was updated up to 0.10.1.
- Widget was updated up to 0.10.
- Default API version was updated up to 0.3.
- Django settings were merged into UPLOADCARE dictionary.
- Performance was improved by reusing requests' session.
UnicodeDecodeError
was fixed. This bug appears when
request's method
param is
unicode and requests.request()
got files
argument, e.g.:
>>> requests.request(u'post', u'http://httpbin.org/post',
... files={u'file': open('README.rst', 'rb')})
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 ...
-
Widget was updated up to 0.8.1.2.
-
It was invoking
File.store()
,FileGroup.store()
methods on every model instance saving, e.g.:photo.title = 'new title' photo.save()
Now it happens while saving by form, namely by calling
your_model_form.is_valid()
. There is other thing that can trigger storing -- callingphoto.full_clean()
directly.
- Python 3.2, 3.3 support were added.
- File Group creating was added.
- Methods per API field for File, FileGroup were added.
- Deprecated things were deleted. This version is not backward compatible. For detailed information see https://pyuploadcare.readthedocs.org/en/v0.19/deprecated.html
- Multiupload support was added.
argparse
was added intosetup.py
requirements.- Documentation was added and published on https://pyuploadcare.readthedocs.org
- Widget was updated up to 0.6.9.1.
ImageField
was added. It provides uploading only image files. Moreover, you can activate manual crop, e.g.ImageField(manual_crop='2:3')
.- More appropriate exceptions were added.
- Tests were separated from library and were restructured.
- Widget was updated up to 0.6.7.
- Issue of
FileField
'sblank
,null
attributes was fixed.
- Replace accept header for old api version
- Fix unicode issue on field render
- Add new widget to pyuploadcare.dj
- Remove old widget
- Use https for all requests
- Add cdn_base to Ucare.__init__
- Get rid of api v.0.1 support
- Add File.ensure_on_s3 and File.ensure_on_cdn helpers
- Add File properties is_on_s3, is_removed, is_stored
- Fix url construction
- Add and correct waiting to upload and upload_from_url
- Add console log handler to ucare
- Add wait argument to ucare store and delete commands
- Fix ucare arg handling
- Add bunch of arguments to ucare upload and upload_via_url commands
- Fix UploadedFile.wait()
- Fix file storing for old API
- Replaced Authentication header with Authorization
- Log warnings found in HTTP headers
- Replace old resizer with new CDN
- Add verify_api_ssl, verify_upload_ssl options
- Add custom HTTP headers to API and upload API requests
- Added __version__
- Added 'User-Agent' request header
- Added 'Accept' request header
- Added ucare config file parsing
- Added pyuploadcare/tests.py
- Replaced upload API
- Replaced File.keep with File.store, File.keep is deprecated
- File.store uses new PUT request
- Added timeouts to File.store, File.delete
- Added upload and upload_from_url to ucare
- Added tests during setup
- Replaced httplib with requests, support https (certificates for api requests are verified)
- Added api_version arg to UploadCare, default is 0.2
- Added ucare cli utility
- Added PYUPLOADCARE_UPLOAD_BASE_URL setting
- Added PYUPLOADCARE_WIDGET_URL
- Updated widget assets to version 0.0.1
- Made properties out of following pyuploadcare.file.File's methods:
- api_uri()
- url()
- filename()
- Changed pyuploadcare.UploadCareException.__init__