Skip to content

Commit

Permalink
Rewrite using Pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
Buried-In-Code committed Aug 30, 2024
1 parent 91a76ca commit 00448f5
Show file tree
Hide file tree
Showing 37 changed files with 1,813 additions and 2,134 deletions.
14 changes: 8 additions & 6 deletions esak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

__version__ = "1.3.2"

from esak import exceptions, session, sqlite_cache
from esak.exceptions import AuthenticationError
from esak.session import Session
from esak.sqlite_cache import SqliteCache


def api(
public_key: str | None = None,
private_key: str | None = None,
cache: sqlite_cache.SqliteCache | None = None,
) -> session.Session:
cache: SqliteCache | None = None,
) -> Session:
"""Entry function the sets login credentials for Marvel's API.
Parameters
Expand All @@ -31,9 +33,9 @@ def api(
If Marvel credentials are missing.
"""
if public_key is None:
raise exceptions.AuthenticationError("Missing public_key.")
raise AuthenticationError("Missing public_key.")

if private_key is None:
raise exceptions.AuthenticationError("Missing private_key.")
raise AuthenticationError("Missing private_key.")

return session.Session(public_key, private_key, cache=cache)
return Session(public_key, private_key, cache=cache)
158 changes: 0 additions & 158 deletions esak/character.py

This file was deleted.

Loading

0 comments on commit 00448f5

Please sign in to comment.