- Create backend/services/image_storage.py with 4 core functions:
- sanitize_filename(): remove unsafe chars, limit to 255 chars, convert to lowercase
- get_unique_filename(): handle collisions with UUID suffix (format: {name}_{uuid8}_{variant}.jpg)
- ensure_image_directories(): create /images/ root and category subdirs on startup
- save_image(): save bytes to /images/{category}/{filename}, returns relative path
- Create comprehensive test suite (22 tests) covering all functionality
- Integrate ensure_image_directories() into FastAPI startup event
- Directory structure: /images/{category}/{filename}
- Collision handling: auto-suffix with UUID if filename exists
- All tests passing, pathlib.Path for safe operations
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
Metadata-Version: 2.4
|
|
Name: tenacity
|
|
Version: 9.1.4
|
|
Summary: Retry code until it succeeds
|
|
Home-page: https://github.com/jd/tenacity
|
|
Author: Julien Danjou
|
|
Author-email: julien@danjou.info
|
|
License: Apache 2.0
|
|
Classifier: Intended Audience :: Developers
|
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
Classifier: Programming Language :: Python
|
|
Classifier: Programming Language :: Python :: 3
|
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
Classifier: Programming Language :: Python :: 3.10
|
|
Classifier: Programming Language :: Python :: 3.11
|
|
Classifier: Programming Language :: Python :: 3.12
|
|
Classifier: Programming Language :: Python :: 3.13
|
|
Classifier: Programming Language :: Python :: 3.14
|
|
Classifier: Topic :: Utilities
|
|
Requires-Python: >=3.10
|
|
License-File: LICENSE
|
|
Provides-Extra: doc
|
|
Requires-Dist: reno; extra == "doc"
|
|
Requires-Dist: sphinx; extra == "doc"
|
|
Provides-Extra: test
|
|
Requires-Dist: pytest; extra == "test"
|
|
Requires-Dist: tornado>=4.5; extra == "test"
|
|
Requires-Dist: typeguard; extra == "test"
|
|
Dynamic: license-file
|
|
|
|
Tenacity is a general-purpose retrying library to simplify the task of adding retry behavior to just about anything.
|