Skip to content

Commit

Permalink
Change package name (#13)
Browse files Browse the repository at this point in the history
* Change package name
* Update readme
  • Loading branch information
jonathangreen authored Mar 6, 2024
1 parent 7675a85 commit 7a9f7bd
Show file tree
Hide file tree
Showing 38 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Palace Client Utilities
# Palace Tools 🛠️

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = ["poetry-core"]
profile = "black"

[tool.mypy]
files = ["."]
files = ["src"]
plugins = ["pydantic.mypy"]
warn_redundant_casts = true
warn_unreachable = true
Expand All @@ -21,11 +21,11 @@ module = [

[tool.poetry]
authors = ["The Palace Project <[email protected]>"]
description = "Palace Client Utilities"
description = "Palace Tools"
homepage = "https://thepalaceproject.org"
license = "Apache-2.0"
name = "palace-client-utils"
packages = [{include = "client_utils"}]
name = "palace-tools"
packages = [{include = "palace_tools", from = "src"}]
readme = "README.md"
version = "0"

Expand All @@ -49,11 +49,11 @@ mypy = "^1.8.0"
types-pytz = "^2024.1.0.20240203"

[tool.poetry.scripts]
audiobook-manifest-summary = "client_utils.cli.summarize_rwpm_audio_manifest:main"
fetch-lcp-audiobook-manifest = "client_utils.cli.download_lcp_manifest:main"
palace-terminal = "client_utils.cli.palace_terminal:main"
patron-bookshelf = "client_utils.cli.patron_bookshelf:main"
validate-audiobook-manifests = "client_utils.cli.validate_manifests:main"
audiobook-manifest-summary = "palace_tools.cli.summarize_rwpm_audio_manifest:main"
fetch-lcp-audiobook-manifest = "palace_tools.cli.download_lcp_manifest:main"
palace-terminal = "palace_tools.cli.palace_terminal:main"
patron-bookshelf = "palace_tools.cli.patron_bookshelf:main"
validate-audiobook-manifests = "palace_tools.cli.validate_manifests:main"

[tool.tomlsort]
ignore_case = true
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

import typer

from client_utils.constants import LCP_AUDIOBOOK_TYPE, LCP_LICENSE_PUBLICATION_REL
from client_utils.models.api.opds2 import match_links
from client_utils.models.api.readium_lcp_license_v1 import LCPLicenseDocument
from client_utils.utils.http.async_client import HTTPXAsyncClient
from client_utils.utils.http.auth_token import BaseAuthorizationToken, BasicAuthToken
from client_utils.utils.http.streaming import streaming_fetch_with_progress
from client_utils.utils.typer import run_typer_app_as_main
from palace_tools.constants import LCP_AUDIOBOOK_TYPE, LCP_LICENSE_PUBLICATION_REL
from palace_tools.models.api.opds2 import match_links
from palace_tools.models.api.readium_lcp_license_v1 import LCPLicenseDocument
from palace_tools.utils.http.async_client import HTTPXAsyncClient
from palace_tools.utils.http.auth_token import BaseAuthorizationToken, BasicAuthToken
from palace_tools.utils.http.streaming import streaming_fetch_with_progress
from palace_tools.utils.typer import run_typer_app_as_main

STDOUT = 1
app = typer.Typer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from textual.containers import Center, Horizontal
from textual.widgets import DataTable, Footer, Header, Label, ProgressBar

from client_utils.models.api.rwpm_audiobook import Manifest
from palace_tools.models.api.rwpm_audiobook import Manifest


def ms_to_hms(ms: int) -> str:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import typer

from client_utils.constants import DEFAULT_REGISTRY_URL
from client_utils.models.internal.bookshelf import print_bookshelf_summary
from client_utils.roles.patron import authenticate
from client_utils.utils.http.async_client import HTTPXAsyncClient
from client_utils.utils.typer import run_typer_app_as_main
from palace_tools.constants import DEFAULT_REGISTRY_URL
from palace_tools.models.internal.bookshelf import print_bookshelf_summary
from palace_tools.roles.patron import authenticate
from palace_tools.utils.http.async_client import HTTPXAsyncClient
from palace_tools.utils.typer import run_typer_app_as_main

app = typer.Typer(rich_markup_mode="rich")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import typer

from client_utils.models.internal.rwpm_audio.audiobook import Audiobook
from client_utils.utils.datetime import seconds_to_hms
from client_utils.utils.typer import run_typer_app_as_main
from palace_tools.models.internal.rwpm_audio.audiobook import Audiobook
from palace_tools.utils.datetime import seconds_to_hms
from palace_tools.utils.typer import run_typer_app_as_main

app = typer.Typer()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import typer
from pydantic import ValidationError

from client_utils.cli.summarize_rwpm_audio_manifest import text_with_time_delta
from client_utils.models.internal.rwpm_audio.audiobook import Audiobook
from client_utils.utils.datetime import seconds_to_hms
from client_utils.utils.typer import run_typer_app_as_main
from palace_tools.cli.summarize_rwpm_audio_manifest import text_with_time_delta
from palace_tools.models.internal.rwpm_audio.audiobook import Audiobook
from palace_tools.utils.datetime import seconds_to_hms
from palace_tools.utils.typer import run_typer_app_as_main

app = typer.Typer()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from collections.abc import Mapping

from client_utils.constants import PATRON_BOOKSHELF_REL, PATRON_PROFILE_REL
from client_utils.models.api.opds2 import OPDS2Link, match_links
from client_utils.models.api.util import ApiBaseModel
from palace_tools.constants import PATRON_BOOKSHELF_REL, PATRON_PROFILE_REL
from palace_tools.models.api.opds2 import OPDS2Link, match_links
from palace_tools.models.api.util import ApiBaseModel


class Labels(ApiBaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

from pydantic import Field

from client_utils.constants import (
from palace_tools.constants import (
OPDS_ACQ_OPEN_ACCESS_REL,
OPDS_ACQ_STANDARD_REL,
OPDS_REVOKE_REL,
)
from client_utils.models.api.util import ApiBaseModel
from client_utils.utils.misc import ensure_list
from palace_tools.models.api.util import ApiBaseModel
from palace_tools.utils.misc import ensure_list

"""
https://drafts.opds.io/opds-2.0.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import Field

from client_utils.models.api.opds2 import OPDS2Link
from client_utils.models.api.util import ApiBaseModel
from palace_tools.models.api.opds2 import OPDS2Link
from palace_tools.models.api.util import ApiBaseModel


class Settings(ApiBaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from collections.abc import Sequence

from client_utils.models.api.opds2 import OPDS2Link
from client_utils.models.api.util import ApiBaseModel
from palace_tools.models.api.opds2 import OPDS2Link
from palace_tools.models.api.util import ApiBaseModel


class ContentKey(ApiBaseModel):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from client_utils.models.api.opds2 import OPDS2Feed
from palace_tools.models.api.opds2 import OPDS2Feed


def print_bookshelf_summary(bookshelf: OPDS2Feed) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from collections.abc import Generator, Iterable, Sequence
from dataclasses import dataclass, field

from client_utils.models.api.rwpm_audiobook import AudioTrack, ToCEntry
from client_utils.utils.iteration import sliding_window
from palace_tools.models.api.rwpm_audiobook import AudioTrack, ToCEntry
from palace_tools.utils.iteration import sliding_window


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from mutagen.mp3 import MP3

from client_utils.models.api.rwpm_audiobook import Manifest, ToCEntry
from client_utils.models.internal.rwpm_audio.audio_segment import (
from palace_tools.models.api.rwpm_audiobook import Manifest, ToCEntry
from palace_tools.models.internal.rwpm_audio.audio_segment import (
AudioSegment,
audio_segments_for_all_toc_entries,
audio_segments_for_toc_entry,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
from dataclasses import dataclass
from enum import Enum

from client_utils.constants import (
from palace_tools.constants import (
DEFAULT_AUTH_DOC_PATH_SUFFIX,
DEFAULT_REGISTRY_URL,
OPDS_2_TYPE,
PATRON_AUTH_BASIC_TOKEN_TYPE,
PATRON_AUTH_BASIC_TYPE,
)
from client_utils.models.api.authentication_document import (
from palace_tools.models.api.authentication_document import (
AuthenticationDocument,
AuthenticationMechanism,
)
from client_utils.models.api.opds2 import OPDS2Feed, match_links
from client_utils.models.api.patron_profile import PatronProfileDocument
from client_utils.services.registry import LibraryRegistryService
from client_utils.utils.http.async_client import HTTPXAsyncClient, validate_response
from client_utils.utils.http.auth_token import (
from palace_tools.models.api.opds2 import OPDS2Feed, match_links
from palace_tools.models.api.patron_profile import PatronProfileDocument
from palace_tools.services.registry import LibraryRegistryService
from palace_tools.utils.http.async_client import HTTPXAsyncClient, validate_response
from palace_tools.utils.http.auth_token import (
AuthorizationToken,
BasicAuthToken,
OAuthToken,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from client_utils.constants import OPDS_AUTH_DOC_REL, OPDS_AUTH_DOC_TYPE
from client_utils.models.api.opds2 import match_links
from client_utils.utils.http.async_client import HTTPXAsyncClient, validate_response
from palace_tools.constants import OPDS_AUTH_DOC_REL, OPDS_AUTH_DOC_TYPE
from palace_tools.models.api.opds2 import match_links
from palace_tools.utils.http.async_client import HTTPXAsyncClient, validate_response


class LibraryRegistryService:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from httpx import AsyncClient, Response

from client_utils.constants import DEFAULT_USER_AGENT
from palace_tools.constants import DEFAULT_USER_AGENT

if sys.version_info < (3, 11):
from typing_extensions import Self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from functools import cached_property
from typing import Protocol

from client_utils.models.api.util import ApiBaseModel
from client_utils.utils.datetime import utc_now
from palace_tools.models.api.util import ApiBaseModel
from palace_tools.utils.datetime import utc_now

if sys.version_info < (3, 11):
from typing_extensions import Self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import rich.progress
from httpx import Response

from client_utils.utils.http.async_client import HTTPXAsyncClient
from palace_tools.utils.http.async_client import HTTPXAsyncClient

DEFAULT_PROGRESS_BAR_TASK_NAME = ""

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7a9f7bd

Please sign in to comment.