Skip to content

Commit

Permalink
Add python version logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvSrikanth committed Oct 15, 2024
1 parent a22c4ee commit 63bd294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion weco/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from httpx import HTTPStatusError
from PIL import Image

from .constants import MAX_IMAGE_SIZE_MB, MAX_IMAGE_UPLOADS, MAX_TEXT_LENGTH, SUPPORTED_IMAGE_EXTENSIONS
from .constants import MAX_IMAGE_SIZE_MB, MAX_IMAGE_UPLOADS, MAX_TEXT_LENGTH, SUPPORTED_IMAGE_EXTENSIONS, __version__ as package_version
from .utils import (
get_image_size,
is_base64_image,
Expand Down Expand Up @@ -65,6 +65,7 @@ def __init__(self, api_key: Union[str, None] = None, timeout: Optional[float] =
def _headers(self) -> Dict[str, str]:
"""Constructs the headers for the API requests."""
return {
"Source": f"py-{package_version}",
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json",
}
Expand Down
3 changes: 2 additions & 1 deletion weco/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__version__ = "0.1.11" # DO NOT EDIT (this is the package version)
MAX_TEXT_LENGTH = 1e6 # 1 million characters
MAX_IMAGE_UPLOADS = 10 # 10 images
MAX_IMAGE_SIZE_MB = 10 # 10 MB
SUPPORTED_IMAGE_EXTENSIONS = ["png", "jpeg", "jpg", "webp", "gif"]
SUPPORTED_IMAGE_EXTENSIONS = ["png", "jpeg", "jpg", "webp", "gif"]

0 comments on commit 63bd294

Please sign in to comment.