mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00

Some checks are pending
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
35 lines
943 B
Python
35 lines
943 B
Python
__package__ = 'abx_plugin_readwise_extractor'
|
|
__id__ = 'abx_plugin_readwise_extractor'
|
|
__label__ = 'Readwise API'
|
|
__version__ = '2024.10.27'
|
|
__author__ = 'ArchiveBox'
|
|
__homepage__ = 'https://github.com/ArchiveBox/ArchiveBox/tree/dev/archivebox/plugins_extractor/readwise'
|
|
__dependencies__ = []
|
|
|
|
import abx
|
|
|
|
from typing import Dict
|
|
from pathlib import Path
|
|
|
|
from pydantic import Field
|
|
|
|
from abx_spec_config.base_configset import BaseConfigSet
|
|
|
|
SOURCES_DIR = abx.pm.hook.get_CONFIG().SOURCES_DIR
|
|
|
|
|
|
class ReadwiseConfig(BaseConfigSet):
|
|
READWISE_DB_PATH: Path = Field(default=SOURCES_DIR / "readwise_reader_api.db")
|
|
READWISE_READER_TOKENS: Dict[str, str] = Field(default=lambda: {}) # {<username>: <access_token>, ...}
|
|
|
|
|
|
@abx.hookimpl
|
|
def get_CONFIG():
|
|
return {
|
|
__id__: ReadwiseConfig()
|
|
}
|
|
|
|
@abx.hookimpl
|
|
def ready():
|
|
READWISE_CONFIG = abx.pm.hook.get_CONFIG()[__id__]
|
|
READWISE_CONFIG.validate()
|