Releases: uploadcare/pyuploadcare
Version 6.0.0
In this release, we introduce File Uploader v1, now with semantic versioning starting from v1.0.0.
For details on upgrading, refer to the migration guide.
Full Changelog: v5.1.0...v6.0.0
Version 5.1.0
Added
- 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.
Changed
- 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.
Fixed
- 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.
Deprecated
- 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
Full Changelog: v5.0.1...v5.1.0
Version 5.0.1
Changed
Fixed
- 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
Full Changelog: v5.0.0...v5.0.1
Version 5.0.0
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).
Breaking Changes
-
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
- Added Python 3.12 and Django 5.0 to the test matrix.
Changed
- 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
.
Version 4.3.0
Fixed
- For
AkamaiSecureUrlBuilderWithAclToken
andAkamaiSecureUrlBuilderWithUrlToken
:- Special characters that were not previously escaped are now properly handled, as detailed in issue #275.
Changed
- 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.
Deprecated
-
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
Version 4.2.2
Added
- 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
Version 4.2.1
Fixed
- 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
. #272
- In version 4.2.0, passing a Python dictionary as
Version 4.2.0
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.
Added
-
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.
Changed
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.
Fixed
- 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
Version 4.1.3
Added
- For
AudioStreamInfo
:- added
profile
field.
- added
Changed
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).
Version 4.1.2
Fixed
- Incorrect expiration time was calculated for signed uploads causing the
AuthenticationError: Expired signature
exception.