Skip to content

Commit

Permalink
Merge pull request #56 from niconicolibs/develop
Browse files Browse the repository at this point in the history
release: v2.0.5
  • Loading branch information
Negima1072 authored Aug 17, 2024
2 parents 83301fa + a71c88c commit 6cdd165
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions examples/user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Example of getting user information."""

from niconico import NicoNico

client = NicoNico()

user = client.user.get_user("2")

if user is None:
print("User not found.")
else:
print(user.nickname)
print(user.description)
2 changes: 1 addition & 1 deletion niconico/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from niconico.niconico import NicoNico

__all__ = ("NicoNico",)
__version__ = "2.0.4"
__version__ = "2.0.5"
3 changes: 3 additions & 0 deletions niconico/niconico.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import requests

from niconico.exceptions import LoginFailureError
from niconico.user import UserClient
from niconico.video import VideoClient


Expand All @@ -16,12 +17,14 @@ class NicoNico:
premium: bool

video: VideoClient
user: UserClient

def __init__(self) -> None:
"""Initialize the class."""
self.session = requests.Session()
self.logined = False
self.video = VideoClient(self)
self.user = UserClient(self)

def get(self, url: str) -> requests.Response:
"""Send a GET request to a URL.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "niconico.py"
version = "2.0.4"
version = "2.0.5"
description = "API wrapper for NicoNico services"
authors = ["Negima1072 <ngm1072@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 6cdd165

Please sign in to comment.