feat(phase1): add image storage utilities
- 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
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,97 @@
|
||||
Metadata-Version: 2.3
|
||||
Name: anthropic
|
||||
Version: 0.96.0
|
||||
Summary: The official Python library for the anthropic API
|
||||
Project-URL: Homepage, https://github.com/anthropics/anthropic-sdk-python
|
||||
Project-URL: Repository, https://github.com/anthropics/anthropic-sdk-python
|
||||
Author-email: Anthropic <support@anthropic.com>
|
||||
License: MIT
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: MacOS
|
||||
Classifier: Operating System :: Microsoft :: Windows
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Operating System :: POSIX
|
||||
Classifier: Operating System :: POSIX :: Linux
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
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 :: Software Development :: Libraries :: Python Modules
|
||||
Classifier: Typing :: Typed
|
||||
Requires-Python: >=3.9
|
||||
Requires-Dist: anyio<5,>=3.5.0
|
||||
Requires-Dist: distro<2,>=1.7.0
|
||||
Requires-Dist: docstring-parser<1,>=0.15
|
||||
Requires-Dist: httpx<1,>=0.25.0
|
||||
Requires-Dist: jiter<1,>=0.4.0
|
||||
Requires-Dist: pydantic<3,>=1.9.0
|
||||
Requires-Dist: sniffio
|
||||
Requires-Dist: typing-extensions<5,>=4.14
|
||||
Provides-Extra: aiohttp
|
||||
Requires-Dist: aiohttp; extra == 'aiohttp'
|
||||
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
||||
Provides-Extra: aws
|
||||
Requires-Dist: boto3>=1.28.57; extra == 'aws'
|
||||
Requires-Dist: botocore>=1.31.57; extra == 'aws'
|
||||
Provides-Extra: bedrock
|
||||
Requires-Dist: boto3>=1.28.57; extra == 'bedrock'
|
||||
Requires-Dist: botocore>=1.31.57; extra == 'bedrock'
|
||||
Provides-Extra: mcp
|
||||
Requires-Dist: mcp>=1.0; (python_version >= '3.10') and extra == 'mcp'
|
||||
Provides-Extra: vertex
|
||||
Requires-Dist: google-auth[requests]<3,>=2; extra == 'vertex'
|
||||
Description-Content-Type: text/markdown
|
||||
|
||||
# Claude SDK for Python
|
||||
|
||||
[](https://pypi.org/project/anthropic/)
|
||||
|
||||
The Claude SDK for Python provides access to the [Claude API](https://docs.anthropic.com/en/api/) from Python applications.
|
||||
|
||||
## Documentation
|
||||
|
||||
Full documentation is available at **[platform.claude.com/docs/en/api/sdks/python](https://platform.claude.com/docs/en/api/sdks/python)**.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
pip install anthropic
|
||||
```
|
||||
|
||||
## Getting started
|
||||
|
||||
```python
|
||||
import os
|
||||
from anthropic import Anthropic
|
||||
|
||||
client = Anthropic(
|
||||
api_key=os.environ.get("ANTHROPIC_API_KEY"), # This is the default and can be omitted
|
||||
)
|
||||
|
||||
message = client.messages.create(
|
||||
max_tokens=1024,
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hello, Claude",
|
||||
}
|
||||
],
|
||||
model="claude-opus-4-6",
|
||||
)
|
||||
print(message.content)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
Python 3.9+
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](https://github.com/anthropics/anthropic-sdk-python/tree/main/./CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License. See the [LICENSE](https://github.com/anthropics/anthropic-sdk-python/tree/main/LICENSE) file for details.
|
||||
1513
venv/lib/python3.12/site-packages/anthropic-0.96.0.dist-info/RECORD
Normal file
1513
venv/lib/python3.12/site-packages/anthropic-0.96.0.dist-info/RECORD
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.26.3
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
@@ -0,0 +1,8 @@
|
||||
Copyright 2023 Anthropic, PBC.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Reference in New Issue
Block a user