Utility to clean unused storyblok assets.
Project description
Cleanup Storyblok assets
storyblok-assets-cleanup is an utility to find and delete unused assets (images, videos, documents, etc) in the Storyblok CMS.
Features:
- Find assets without references;
- Output a summary of file to be deleted, grouped by folder;
- Perform a backup of assets before deletion;
Getting started
Requirements
- Have a Storyblok space and create a personal access token
Installation
pip3 install storyblok-assets-cleanup
Usage
usage: storyblok-assets-cleanup [-h] [--delete | --no-delete] [--backup | --no-backup]
[--cache | --no-cache]
[--continue-download-on-failure | --no-continue-download-on-failure]
[--space-id SPACE_ID] [--token TOKEN]
[--blacklisted-folder-paths BLACKLISTED_FOLDER_PATHS]
[--blacklisted-words BLACKLISTED_WORDS]
[--cache-directory CACHE_DIRECTORY]
[--backup-directory BACKUP_DIRECTORY]
storyblok-assets-cleanup an utility to delete unused assets.
options:
-h, --help show this help message and exit
--delete, --no-delete
If we should delete assets, default to false.
--backup, --no-backup
If we should backup assets (to ./assets_backup/<SPACE_ID>), defaults to
true.
--cache, --no-cache If we should use cache the assets index. Defaults to True (recommended).
--continue-download-on-failure, --no-continue-download-on-failure
If we should continue if the download of an asset fails. Defaults to true.
--space-id SPACE_ID Storyblok space ID, alternatively use the env var STORYBLOK_SPACE_ID.
--token TOKEN Storyblok personal access token, alternatively use the env var
STORYBLOK_PERSONAL_ACCESS_TOKEN.
--blacklisted-folder-paths BLACKLISTED_FOLDER_PATHS
Comma separated list of filepaths that should be ignored. Alternatively use
the env var BLACKLISTED_ASSET_FOLDER_PATHS. Default to none/empty list.
--blacklisted-words BLACKLISTED_WORDS
Comma separated list of words that should be used to ignore assets when they
are contained in its filename. Alternatively use the env var
BLACKLISTED_ASSET_FILENAME_WORDS. Default to none/empty list.
--cache-directory CACHE_DIRECTORY
Cache directory, defaults to ./cache.
--backup-directory BACKUP_DIRECTORY
Backup directory, defaults to ./assets_backup.
Development
- Ensure you have
makeinstalled. - Create a virtual environment:
make setup-venv. - Install dependencies:
make install-deps.
Then you can install (link) the repo globally with make local-install.
Before pushing changes ensure your code is properly formatted with make lint.
Auto format the code with make format.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file storyblok-assets-cleanup-0.0.1.dev6.tar.gz.
File metadata
- Download URL: storyblok-assets-cleanup-0.0.1.dev6.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70b754770390dd4edd141bf611ed6c960684016ea892c84fe80eef28dce77e49
|
|
| MD5 |
314f5976d6003734e2bd07a8088869e9
|
|
| BLAKE2b-256 |
4cff0fe3c906f55d924414b25cbe0c998115acce7f25a079da85435b267dde0e
|
File details
Details for the file storyblok_assets_cleanup-0.0.1.dev6-py3-none-any.whl.
File metadata
- Download URL: storyblok_assets_cleanup-0.0.1.dev6-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8441c27142ce3508b2a28bd62f6996097e50086e6982df259bfa4a5007cd51b
|
|
| MD5 |
ed8d935b7c04adefc68bc9e1267dfe3a
|
|
| BLAKE2b-256 |
688c9f589c127d5b2cde720bd9e216280d9d9ee916963e5fd4da8bcfb7c16a5c
|