From cb0b6132ef46417465f89d0f6db39b09c9d61e39 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:53:41 +0530 Subject: [PATCH 1/7] feat: python downgrade --- setup.py | 2 +- videodb/__init__.py | 2 +- videodb/collection.py | 4 ++-- videodb/search.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index dff1f90..1a13f14 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.1", install_requires=[ "requests>=2.25.1", "backoff>=2.2.1", diff --git a/videodb/__init__.py b/videodb/__init__.py index 2fd4d95..ae167d0 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.4.post" __author__ = "videodb" __all__ = [ diff --git a/videodb/collection.py b/videodb/collection.py index 489a56b..8d765ae 100644 --- a/videodb/collection.py +++ b/videodb/collection.py @@ -69,12 +69,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") From e78054cda8c7feb28c7cd5f11ff30aa9258c2fe3 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:08:45 +0530 Subject: [PATCH 2/7] feat: add pypi classifiers --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 1a13f14..eb76bae 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,11 @@ def get_version(): classifiers=[ "Intended Audience :: Developers", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8.1", "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", ], ) From 0abf3de8a49913b0a7d7e4df723b5ce69133cccd Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:13:54 +0530 Subject: [PATCH 3/7] fix: python version --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index eb76bae..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.8.1", + python_requires=">=3.8", install_requires=[ "requests>=2.25.1", "backoff>=2.2.1", @@ -37,7 +37,7 @@ def get_version(): classifiers=[ "Intended Audience :: Developers", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8.1", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From a9acd20d0b4c3d19e08694f4040a1c7f298e4b98 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:50:49 +0530 Subject: [PATCH 4/7] feat: update to 0.0.5a1 --- videodb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/videodb/__init__.py b/videodb/__init__.py index ae167d0..54abd12 100644 --- a/videodb/__init__.py +++ b/videodb/__init__.py @@ -23,7 +23,7 @@ logger: logging.Logger = logging.getLogger("videodb") -__version__ = "0.0.4.post" +__version__ = "0.0.5a1" __author__ = "videodb" __all__ = [ From 3c1cd37660af10f16120d649fd7259543c7d99b5 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:41:39 +0530 Subject: [PATCH 5/7] fix: type error --- videodb/__init__.py | 2 +- videodb/collection.py | 8 +++++--- videodb/video.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/videodb/__init__.py b/videodb/__init__.py index 54abd12..3999161 100644 --- a/videodb/__init__.py +++ b/videodb/__init__.py @@ -23,7 +23,7 @@ logger: logging.Logger = logging.getLogger("videodb") -__version__ = "0.0.5a1" +__version__ = "0.0.5a2" __author__ = "videodb" __all__ = [ diff --git a/videodb/collection.py b/videodb/collection.py index 8d765ae..9d4f9d7 100644 --- a/videodb/collection.py +++ b/videodb/collection.py @@ -3,6 +3,8 @@ from typing import ( Optional, Union, + List, + Dict ) from videodb._upload import ( upload, @@ -26,7 +28,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 +46,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 +57,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")] 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 From c804ca01e5357999649e678c62a159df9858f368 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:39:17 +0530 Subject: [PATCH 6/7] build: version upgrade --- videodb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/videodb/__init__.py b/videodb/__init__.py index 3999161..f5125e4 100644 --- a/videodb/__init__.py +++ b/videodb/__init__.py @@ -23,7 +23,7 @@ logger: logging.Logger = logging.getLogger("videodb") -__version__ = "0.0.5a2" +__version__ = "0.0.5" __author__ = "videodb" __all__ = [ From ae873b375218cbb6455035a0856f24cd99bae559 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:45:29 +0530 Subject: [PATCH 7/7] fix: linter --- videodb/collection.py | 1 - 1 file changed, 1 deletion(-) diff --git a/videodb/collection.py b/videodb/collection.py index 9d4f9d7..e3b2324 100644 --- a/videodb/collection.py +++ b/videodb/collection.py @@ -4,7 +4,6 @@ Optional, Union, List, - Dict ) from videodb._upload import ( upload,