diff --git a/setup.py b/setup.py index dff1f90..bdb8b05 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def get_version(): long_description_content_type="text/markdown", url="https://github.com/video-db/videodb-python", packages=find_packages(exclude=["tests", "tests.*"]), - python_requires=">=3.9", + python_requires=">=3.8", install_requires=[ "requests>=2.25.1", "backoff>=2.2.1", @@ -37,6 +37,11 @@ def get_version(): classifiers=[ "Intended Audience :: Developers", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: Apache Software License", ], ) diff --git a/videodb/__init__.py b/videodb/__init__.py index 2fd4d95..f5125e4 100644 --- a/videodb/__init__.py +++ b/videodb/__init__.py @@ -23,7 +23,7 @@ logger: logging.Logger = logging.getLogger("videodb") -__version__ = "0.0.4" +__version__ = "0.0.5" __author__ = "videodb" __all__ = [ diff --git a/videodb/collection.py b/videodb/collection.py index 489a56b..e3b2324 100644 --- a/videodb/collection.py +++ b/videodb/collection.py @@ -3,6 +3,7 @@ from typing import ( Optional, Union, + List, ) from videodb._upload import ( upload, @@ -26,7 +27,7 @@ def __init__(self, _connection, id: str, name: str = None, description: str = No self.name = name self.description = description - def get_videos(self) -> list[Video]: + def get_videos(self) -> List[Video]: videos_data = self._connection.get(path=f"{ApiPath.video}") return [Video(self._connection, **video) for video in videos_data.get("videos")] @@ -44,7 +45,7 @@ def delete_video(self, video_id: str) -> None: """ return self._connection.delete(path=f"{ApiPath.video}/{video_id}") - def get_audios(self) -> list[Audio]: + def get_audios(self) -> List[Audio]: audios_data = self._connection.get(path=f"{ApiPath.audio}") return [Audio(self._connection, **audio) for audio in audios_data.get("audios")] @@ -55,7 +56,7 @@ def get_audio(self, audio_id: str) -> Audio: def delete_audio(self, audio_id: str) -> None: return self._connection.delete(path=f"{ApiPath.audio}/{audio_id}") - def get_images(self) -> list[Image]: + def get_images(self) -> List[Image]: images_data = self._connection.get(path=f"{ApiPath.image}") return [Image(self._connection, **image) for image in images_data.get("images")] @@ -69,12 +70,12 @@ def delete_image(self, image_id: str) -> None: def search( self, query: str, - type: Optional[str] = SearchType.semantic, + search_type: Optional[str] = SearchType.semantic, result_threshold: Optional[int] = None, score_threshold: Optional[int] = None, dynamic_score_percentage: Optional[int] = None, ) -> SearchResult: - search = SearchFactory(self._connection).get_search(type) + search = SearchFactory(self._connection).get_search(search_type) return search.search_inside_collection( self.id, query, diff --git a/videodb/search.py b/videodb/search.py index 49db816..a19eb0d 100644 --- a/videodb/search.py +++ b/videodb/search.py @@ -172,7 +172,7 @@ def search_inside_video( ) return SearchResult(self._connection, **search_data) - def search_inside_collection(**kwargs): + def search_inside_collection(self, **kwargs): raise NotImplementedError("Keyword search will be implemented in the future") diff --git a/videodb/video.py b/videodb/video.py index 6e8f3dc..a5e3fc0 100644 --- a/videodb/video.py +++ b/videodb/video.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Optional, List, Dict, Tuple from videodb._utils._video import play_stream from videodb._constants import ( ApiPath, @@ -67,7 +67,7 @@ def delete(self) -> None: """ self._connection.delete(path=f"{ApiPath.video}/{self.id}") - def generate_stream(self, timeline: Optional[list[tuple[int, int]]] = None) -> str: + def generate_stream(self, timeline: Optional[List[Tuple[int, int]]] = None) -> str: """Generate the stream url of the video :param list timeline: The timeline of the video to be streamed. Defaults to None. @@ -107,7 +107,7 @@ def _fetch_transcript(self, force: bool = False) -> None: self.transcript = transcript_data.get("word_timestamps", []) self.transcript_text = transcript_data.get("text", "") - def get_transcript(self, force: bool = False) -> list[dict]: + def get_transcript(self, force: bool = False) -> List[Dict]: self._fetch_transcript(force) return self.transcript