-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from masterWeber/feature/films-premieres
Добавлен график кинопремьер
- Loading branch information
Showing
7 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from datetime import datetime | ||
from dataclasses import dataclass, field | ||
from typing import List | ||
|
||
from kinopoisk_unofficial.model.country import Country | ||
from kinopoisk_unofficial.model.genre import Genre | ||
|
||
|
||
@dataclass | ||
class PremiereFilm: | ||
kinopoisk_id: int | ||
name_ru: str | ||
name_en: str | ||
year: int | ||
poster_url: str | ||
poster_url_preview: str | ||
duration: int | ||
premiereRu: datetime | ||
countries: List[Country] = field(default_factory=list) | ||
genres: List[Genre] = field(default_factory=list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from kinopoisk_unofficial.client.http_method import HttpMethod | ||
from kinopoisk_unofficial.contract.request import Request | ||
from kinopoisk_unofficial.model.dictonary.month import Month | ||
from kinopoisk_unofficial.response.films.premiere_response import PremiereResponse | ||
|
||
|
||
class PremiereRequest(Request): | ||
METHOD: HttpMethod = HttpMethod.GET | ||
PATH: str = '/api/v2.2/films/premieres' | ||
RESPONSE: type = PremiereResponse | ||
|
||
__year: int | ||
__month: Month | ||
|
||
def __init__(self, year: int, month: Month) -> None: | ||
self.__year = year | ||
self.__month = month | ||
|
||
@property | ||
def year(self) -> int: | ||
return self.__year | ||
|
||
@property | ||
def month(self) -> Month: | ||
return self.__month | ||
|
||
def path(self) -> str: | ||
return self._build_url(self.PATH, { | ||
'year': self.year, | ||
'month': self.month.value | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from dataclasses import dataclass, field | ||
from typing import List | ||
|
||
from kinopoisk_unofficial.contract.response import Response | ||
from kinopoisk_unofficial.model.premiere_film import PremiereFilm | ||
|
||
|
||
@dataclass(frozen=True) | ||
class PremiereResponse(Response): | ||
total: int | ||
items: List[PremiereFilm] = field(default_factory=list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
setuptools.setup( | ||
name="kinopoisk-api-unofficial-client", | ||
version="1.0.2", | ||
version="1.1.0", | ||
author="Master Weber", | ||
author_email="[email protected]", | ||
description="API Client for the unofficial Kinopoisk api", | ||
|