diff --git a/ksoftapi/__init__.py b/ksoftapi/__init__.py index 7622626..8b4caa9 100644 --- a/ksoftapi/__init__.py +++ b/ksoftapi/__init__.py @@ -8,7 +8,7 @@ __author__ = 'AndyTempel' __license__ = 'GNU' __copyright__ = 'Copyright 2018-2020 AndyTempel' -__version__ = '0.3.0a' +__version__ = '0.3.1a' import logging from collections import namedtuple @@ -19,7 +19,7 @@ VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial') -version_info = VersionInfo(major=0, minor=3, micro=0, releaselevel='alpha', serial=0) +version_info = VersionInfo(major=0, minor=3, micro=1, releaselevel='alpha', serial=0) try: from logging import NullHandler diff --git a/ksoftapi/apis/images.py b/ksoftapi/apis/images.py index 2e68f8a..e35b6ad 100644 --- a/ksoftapi/apis/images.py +++ b/ksoftapi/apis/images.py @@ -120,7 +120,7 @@ async def get_image(self, snowflake: str) -> Image: ------- :class:`Image` """ - r = await self._client.http.get(f'/images/image/{snowflake}') + r = await self._client.http.get('/images/image/{}'.format(snowflake)) if r.get('code', 200) == 404: raise NoResults @@ -149,12 +149,12 @@ async def search_tags(self, search: str) -> TagCollection: async def random_nsfw(self, gifs: bool = False) -> RedditImage: """|coro| - This function gets an random nsfw image. + This function gets a random nsfw image. Parameters ---------- gifs: :class:`bool` - If gifs should be retrivied instead of images. + If gifs should be returned instead of images. Returns ------- diff --git a/ksoftapi/models.py b/ksoftapi/models.py index adf953c..fa6abd7 100644 --- a/ksoftapi/models.py +++ b/ksoftapi/models.py @@ -16,6 +16,7 @@ def __init__(self, data: dict): self.appeal_date: Optional[str] = data['appeal_date'] self.requested_by: str = data['requested_by'] self.exists: bool = data['exists'] + self.raw: dict = data class BanSimple: @@ -25,6 +26,7 @@ def __init__(self, data: dict): self.proof: str = data['proof'] self.moderator_id: str = data['moderator_id'] self.active: bool = data['is_ban_active'] + self.raw: dict = data class Image: @@ -33,6 +35,7 @@ def __init__(self, data: dict): self.snowflake: str = data['snowflake'] self.nsfw: bool = data['nsfw'] self.tag: str = data['tag'] + self.raw: dict = data class Location: @@ -44,6 +47,8 @@ def __init__(self, data: dict): self.type: List[str] = data['type'] self.map: Optional[str] = data.get('map') + self.raw: dict = data + class LyricResult: def __init__(self, data: dict): @@ -59,6 +64,9 @@ def __init__(self, data: dict): self.popularity: int = data['popularity'] self.id: str = data['id'] self.search_score: float = data['search_score'] + self.url: str = data['url'] + + self.raw: dict = data class PaginatorListing: @@ -71,6 +79,7 @@ def __init__(self, data: dict): self.next_page: Optional[int] = data['next_page'] self.previous_page: Optional[int] = data['previous_page'] self.data: List[BanInfo] = [BanInfo(ban) for ban in data['data']] + self.raw: dict = data class Recommendation: @@ -98,6 +107,8 @@ def __init__(self, data: dict): for artist in spotify_artists ] + self.raw: dict = data + class RedditImage: def __init__(self, data: dict): @@ -112,12 +123,16 @@ def __init__(self, data: dict): self.created_at: int = data.get('created_at') self.nsfw: bool = data.get('nsfw') + self.raw: dict = data + class Tag: def __init__(self, data: dict): self.name: str = data.get('name') self.nsfw: bool = data.get('nsfw') + self.raw: dict = data + def __str__(self): return self.name @@ -129,6 +144,8 @@ def __init__(self, data: dict): self.sfw_tags: List[str] = data.get('tags') self.nsfw_tags: List[str] = data.get('nsfw_tags', []) + self.raw: dict = data + def __len__(self): return len(self.models) @@ -155,3 +172,5 @@ def __init__(self, data: dict): self.title: str = data.get('title') self.nsfw: bool = data.get('nsfw') self.article_url: str = data.get('article_url') + + self.raw: dict = data diff --git a/setup.py b/setup.py index ab1b1f1..334d414 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ def get_requirements(): download_url=f'https://github.com/KSoft-Si/ksoftapi.py/archive/{version}.tar.gz', keywords=['ksoftapi'], install_requires=get_requirements(), + python_requires='>=3.6', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU General Public License (GPL)',