API reference¶
Auto-generated reference for every public symbol in the Nyora library
(import nyora). Each section renders the live docstrings of a module. For
narrative usage, see the library guide.
Package overview¶
The top-level nyora package re-exports the primary client, the helper REST
clients, the OTA manager, the embedded server, the model dataclasses, and the
exception hierarchy. Each re-exported symbol is documented in full under its
canonical module section below.
Nyora Python SDK — the importable nyora library.
Nyora is a self-contained manga sources SDK. The default client
(nyora.direct.Nyora, re-exported here as Nyora) embeds the
JavaScript parser bundle inside a QuickJS context via
nyora.runtime.ParserRuntime, so it needs no Node and no JVM
helper: HTTP is handled by httpx and HTML parsing by selectolax. The
parser bundle and source catalog are kept current through
nyora.ota.OtaManager (over-the-air updates).
This module is the public surface of the SDK. It re-exports the primary
client, the helper-backed REST clients, the over-the-air manager, the embedded
nyora.server.NyoraServer, the typed nyora.models dataclasses,
and the SDK exception hierarchy.
The importable nyora library and the separately shipped nyora-cli tool
(which launches the terminal UI) are distinct: this package documents the SDK.
Example
>>> import nyora
>>> with nyora.Nyora() as client:
... source = client.sources.find("mangadex")
... page = client.manga.popular(source.id)
... first = page.entries[0]
... details = client.manga.details(source.id, first.url, title=first.title)
nyora.direct¶
The default, self-contained client and its in-process services.
Self-contained Nyora client that does not require the JVM helper.
This module provides the default Nyora SDK entry point. Nyora drives an
embedded nyora.runtime.ParserRuntime (the JavaScript parser bundle
running inside QuickJS) and exposes two service objects:
DirectSourcesService— list and look up bundled sources.DirectMangaService— browse popular/latest, search, and fetch manga details and chapter pages.
Unlike nyora.client (which talks to an external helper over REST), this
path is fully in-process: no Node, no JVM. Over-the-air updates of the parser
bundle and source catalog are managed through the attached
nyora.ota.OtaManager (self.ota).
- class nyora.direct.Nyora(*, timeout=60.0)[source]¶
Bases:
objectDefault no-helper Nyora SDK client.
Drives an embedded
nyora.runtime.ParserRuntime(the JavaScript parser bundle inside QuickJS) entirely in-process, so it requires neither a Node runtime nor the JVM helper. The parser bundle and source catalog are kept current through the attachednyora.ota.OtaManager(self.ota).- Variables:
ota – Over-the-air manager for the parser bundle and source catalog.
sources –
DirectSourcesServicefor listing and finding sources.manga –
DirectMangaServicefor browsing, search, and details.
Example
>>> with Nyora() as client: ... source = client.sources.find("mangadex") ... page = client.manga.popular(source.id) ... entry = page.entries[0] ... details = client.manga.details(source.id, entry.url, title=entry.title)
- Parameters:
timeout (
float)
Initialize the client and its embedded parser runtime.
- Parameters:
timeout (
float) – Per-call timeout in seconds for parser runtime operations.
- update(*, force=False)[source]¶
Fetch the latest OTA parser bundle and reload the runtime.
- Parameters:
force (
bool) – Re-download and reload even if the installed version is already current.- Return type:
- Returns:
The
OtaUpdateResultdescribing the applied update (updatedisFalsewhen already up to date).
- classmethod helper(base_url=None, *, timeout=60.0)[source]¶
Attach to an already-running external Nyora helper over REST.
- Parameters:
- Return type:
- Returns:
A connected
nyora.client.Nyorahelper client.
- classmethod managed_helper(jar_path, *, timeout=60.0, launch_timeout=20.0)[source]¶
Launch and attach to a helper process from a JVM jar.
- Parameters:
- Return type:
- Returns:
A
nyora.client.Nyoraclient bound to the managed process.
- class nyora.direct.DirectSourcesService(runtime)[source]¶
Bases:
objectList and look up the sources bundled with the parser runtime.
- Parameters:
runtime (
ParserRuntime)
Bind the service to a parser runtime.
- Parameters:
runtime (
ParserRuntime) – The embedded runtime providing the bundled source catalog.
- class nyora.direct.DirectMangaService(runtime)[source]¶
Bases:
objectBrowse, search, and read manga directly through the parser runtime.
- Parameters:
runtime (
ParserRuntime)
Bind the service to a parser runtime.
- Parameters:
runtime (
ParserRuntime) – The embedded runtime used to invoke parser methods.
- popular(source_id, page=1)[source]¶
Fetch a page of popular manga from a source.
- Parameters:
- Return type:
- Returns:
A
SearchPageof entries.
- latest(source_id, page=1)[source]¶
Fetch a page of the latest updated manga from a source.
- Parameters:
- Return type:
- Returns:
A
SearchPageof entries.
- search(source_id, query, page=1)[source]¶
Search a source for manga matching a query.
- Parameters:
- Return type:
- Returns:
A
SearchPageof matching entries.
- details(source_id, manga_url, *, title='')[source]¶
Fetch full metadata and the chapter list for one manga.
- Parameters:
- Return type:
- Returns:
A
MangaDetailswith the manga and its chapters.
nyora.client¶
The helper-backed REST clients (Nyora, AsyncNyora).
Nyora helper HTTP clients.
This module provides the helper-backed REST clients used when an external Nyora
helper process (the JVM helper, or an embedded nyora.server.NyoraServer)
is available. Unlike nyora.direct.Nyora, these clients do not embed a
parser runtime; they speak the camelCase helper REST contract over HTTP via
httpx.
It exposes:
Nyora— synchronous client with the full set of service objects (sources, manga, library, downloads, backup, system).AsyncNyora— lightweight async client for read-style requests.
The helper base URL is discovered from an explicit argument, the
NYORA_BASE_URL environment variable, or the helper port file written by a
running Nyora app. A helper jar can also be launched and managed via
Nyora.managed().
- class nyora.client.Nyora(base_url=None, *, timeout=60.0, helper=None)[source]¶
Bases:
objectSynchronous Nyora SDK client backed by a helper REST API.
Wraps an
httpx.Clientagainst a discovered or managed helper and exposes the full set of service objects. Use as a context manager to release the HTTP connection (and stop a managed helper) on exit.- Variables:
base_url – The resolved helper base URL.
sources –
SourcesService.manga –
MangaService.library –
LibraryService.downloads –
DownloadsService.backup –
BackupService.system –
SystemService.
Example
>>> with Nyora.attach() as client: ... for source in client.sources.list(): ... print(source.id, source.name)
Connect to a helper and construct the service objects.
- Parameters:
- Raises:
HelperNotFoundError – If no helper can be discovered.
- classmethod managed(jar_path=None, *, java='java', timeout=60.0, launch_timeout=20.0)[source]¶
Launch a helper jar and return a client bound to it.
The launched process is owned by the returned client and is stopped on
close().- Parameters:
jar_path (
str|PathLike[str] |None) – Path to the helper jar. WhenNoneit is read from theNYORA_HELPER_JARenvironment variable.java (
str) – Thejavaexecutable to invoke.timeout (
float) – Per-request HTTP timeout in seconds for the client.launch_timeout (
float) – Seconds to wait for the helper to report healthy.
- Return type:
Self- Returns:
A client connected to the managed helper.
- Raises:
HelperNotFoundError – If the jar path is missing or does not exist.
HelperLaunchError – If the helper fails to start within the timeout.
- post(path, *, params=None, json=None, content=None)[source]¶
Issue a
POSTrequest against the helper.- Parameters:
- Return type:
- Returns:
Parsed JSON, or the response text for non-JSON bodies.
- Raises:
NyoraHTTPError – If the helper returns a 4xx/5xx response.
- class nyora.client.AsyncNyora(base_url=None, *, timeout=60.0)[source]¶
Bases:
objectAsynchronous Nyora helper client for read-style requests.
A lightweight
httpx.AsyncClientwrapper exposingget()against a discovered or explicit helper base URL. Use as an async context manager to release the connection on exit.- Variables:
base_url – The resolved helper base URL.
Example
>>> async with AsyncNyora.attach() as client: ... payload = await client.get("/sources")
Connect to a helper.
- Parameters:
- Raises:
HelperNotFoundError – If no helper can be discovered.
- classmethod attach(base_url=None, *, timeout=60.0)[source]¶
Attach to an already-running helper.
- Parameters:
- Return type:
- Returns:
A connected async client.
nyora.models¶
Typed dataclasses returned throughout the SDK.
Typed data models for the Nyora SDK.
Lightweight, slotted dataclasses that mirror the JSON returned by the Nyora
parser runtime and helper REST API. Every model exposes a tolerant
from_json classmethod that accepts the raw camelCase payloads and coerces
field types defensively, so missing or malformed fields fall back to sensible
defaults rather than raising. These types are returned throughout
nyora.direct.Nyora, nyora.client.Nyora, and the service
objects.
- class nyora.models.MangaPage(url, headers=<factory>)[source]¶
Bases:
objectA single readable image page of a chapter.
- Variables:
url – The image URL.
headers – Request headers required to fetch the image (e.g.
Referer).
- Parameters:
- class nyora.models.MangaChapter(id, title, number=0.0, volume=0, url='', scanlator=None, upload_date=0, branch=None, pages=<factory>, index=0)[source]¶
Bases:
objectA chapter belonging to a manga.
- Variables:
id – Stable chapter identifier.
title – Display title.
number – Chapter number (may be fractional).
volume – Volume number, or
0if unknown.url – Source-relative or absolute chapter URL.
scanlator – Scanlation group, if known.
upload_date – Upload timestamp in epoch milliseconds.
branch – Scanlation branch/translation name, if any.
pages – Resolved pages, when already loaded.
index – Position within the chapter list.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
MangaChapterfrom a raw payload.- Parameters:
data (
Any) – A chapter object from the parser or helper.- Return type:
- Returns:
The parsed chapter.
- class nyora.models.Manga(id, title, alt_titles=<factory>, url='', public_url='', rating=-1.0, is_nsfw=False, content_rating=None, cover_url='', large_cover_url=None, state=None, authors=<factory>, source=<factory>, source_id='', description='', tags=<factory>, chapters=<factory>, unread=0, progress=0.0)[source]¶
Bases:
objectA manga entry as returned in listings and details.
- Variables:
id – Stable manga identifier.
title – Primary title.
alt_titles – Alternative titles.
url – Source-relative or absolute manga URL.
public_url – Public web URL for the manga, if distinct.
rating – Normalized rating, or
-1.0when unknown.is_nsfw – Whether the entry is flagged adult/NSFW.
content_rating – Source-provided content rating, if any.
cover_url – Cover thumbnail URL.
large_cover_url – High-resolution cover URL, if available.
state – Publication state (e.g. ongoing/finished), if known.
authors – Author names.
source – Raw source metadata as a dict.
source_id – Identifier of the owning source.
description – Synopsis text.
tags – Genre/tag dicts.
chapters – Chapters, when already loaded.
unread – Unread chapter count, for library entries.
progress – Read progress fraction, for library entries.
- Parameters:
- chapters: list[MangaChapter]¶
- class nyora.models.Source(id, name, lang='', base_url='', engine='', content_type='', is_installed=False, is_pinned=False, is_nsfw=False, is_obsolete=False, icon_url='', version='', notes='', can_uninstall=True)[source]¶
Bases:
objectA content source (site) the SDK can read from.
- Variables:
id – Stable source identifier.
name – Human-readable source name.
lang – Primary content language/locale code.
base_url – The source’s base site URL.
engine – Parser engine (e.g.
"JavaScript").content_type – Content type (e.g.
"Manga").is_installed – Whether the source is installed/available.
is_pinned – Whether the user pinned the source.
is_nsfw – Whether the source is flagged adult/NSFW.
is_obsolete – Whether the source is deprecated.
icon_url – Source icon URL.
version – Source/parser version string.
notes – Free-form notes.
can_uninstall – Whether the source may be uninstalled.
- Parameters:
- class nyora.models.SourceFilter(name, type_name, values=<factory>)[source]¶
Bases:
objectA search filter advertised by a source.
- Variables:
name – Filter name.
type_name – Filter widget/type (e.g. select, toggle).
values – Allowed values for the filter.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
SourceFilterfrom a raw payload.- Parameters:
data (
Any) – A filter object from the helper.- Return type:
- Returns:
The parsed filter.
- class nyora.models.SearchPage(entries, has_next_page=False)[source]¶
Bases:
objectOne page of manga results from browse or search.
- Variables:
entries – The manga on this page.
has_next_page – Whether a further page is likely available.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
SearchPagefrom a raw payload.- Parameters:
data (
Any) – A page object withentriesandhasNextPage.- Return type:
- Returns:
The parsed page.
- class nyora.models.MangaDetails(manga, chapters)[source]¶
Bases:
objectFull metadata for one manga together with its chapter list.
- Variables:
manga – The manga metadata.
chapters – The manga’s chapters.
- Parameters:
manga (
Manga)chapters (
list[MangaChapter])
- chapters: list[MangaChapter]¶
- classmethod from_json(data)[source]¶
Build a
MangaDetailsfrom a raw payload.- Parameters:
data (
Any) – An object withmangaandchapters.- Return type:
- Returns:
The parsed details.
- class nyora.models.HistoryEntry(manga, chapter_id='', page=0, percent=0.0, updated_at=0)[source]¶
Bases:
objectA reading-history record for a manga.
- Variables:
manga – The manga that was read.
chapter_id – The last-read chapter identifier.
page – The last-read page index.
percent – Read progress fraction within the chapter.
updated_at – Last-update timestamp in epoch milliseconds.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
HistoryEntryfrom a raw payload.- Parameters:
data (
Any) – A history object from the helper.- Return type:
- Returns:
The parsed entry.
- class nyora.models.Category(id, title, manga_count=0)[source]¶
Bases:
objectA user-defined library category.
- Variables:
id – Category identifier.
title – Display title.
manga_count – Number of manga in the category.
- Parameters:
- class nyora.models.Download(id, source_id, manga_title, chapter_title, chapter_url, status, total_pages=0, completed_pages=0, failed_pages=0, file_path=None, error=None)[source]¶
Bases:
objectA chapter download task and its progress.
- Variables:
id – Download task identifier.
source_id – Identifier of the owning source.
manga_title – Title of the manga being downloaded.
chapter_title – Title of the chapter being downloaded.
chapter_url – URL of the chapter being downloaded.
status – Task status string.
total_pages – Total number of pages to download.
completed_pages – Pages downloaded so far.
failed_pages – Pages that failed to download.
file_path – Output path once complete, if available.
error – Error message when the task failed, if any.
- Parameters:
- class nyora.models.DownloadSettings(max_concurrent_downloads=3, format='AUTO')[source]¶
Bases:
objectDownload subsystem settings.
- Variables:
max_concurrent_downloads – Maximum simultaneous downloads.
format – Output format (e.g.
"AUTO").
- Parameters:
- classmethod from_json(data)[source]¶
Build
DownloadSettingsfrom a raw payload.Accepts either a bare settings object or one nested under
settings.- Parameters:
data (
Any) – A settings object from the helper.- Return type:
- Returns:
The parsed settings.
- class nyora.models.MangaPrefs(manga_id, reader_mode='', brightness=0.0, contrast=1.0, saturation=1.0, hue=0.0, palette='', present=False)[source]¶
Bases:
objectPer-manga reader preferences.
- Variables:
manga_id – Identifier of the manga these preferences apply to.
reader_mode – Reader layout/mode.
brightness – Brightness adjustment.
contrast – Contrast multiplier.
saturation – Saturation multiplier.
hue – Hue rotation.
palette – Named color palette.
present – Whether stored preferences exist for this manga.
- Parameters:
- classmethod from_json(data)[source]¶
Build
MangaPrefsfrom a raw payload.- Parameters:
data (
Any) – A preferences object from the helper.- Return type:
- Returns:
The parsed preferences.
- class nyora.models.GlobalSearchGroup(source_id, source_name, entries, error=None)[source]¶
Bases:
objectResults from one source within a cross-source global search.
- Variables:
source_id – Identifier of the source that produced these results.
source_name – Display name of the source.
entries – Matching manga from this source.
error – Error message if this source’s search failed, else
None.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
GlobalSearchGroupfrom a raw payload.- Parameters:
data (
Any) – A group object from the helper.- Return type:
- Returns:
The parsed group.
- class nyora.models.Stats(total_chapters=0, distinct_manga=0, favourites_count=0, longest_streak_days=0, top_sources=<factory>)[source]¶
Bases:
objectAggregate reading statistics.
- Variables:
total_chapters – Total chapters read.
distinct_manga – Number of distinct manga read.
favourites_count – Number of favourited manga.
longest_streak_days – Longest consecutive reading streak in days.
top_sources – Per-source usage breakdown dicts.
- Parameters:
- class nyora.models.BackupImportResult(ok, imported_favourites=0, imported_history=0)[source]¶
Bases:
objectOutcome of importing a backup archive.
- Variables:
ok – Whether the import succeeded.
imported_favourites – Number of favourites imported.
imported_history – Number of history records imported.
- Parameters:
- classmethod from_json(data)[source]¶
Build a
BackupImportResultfrom a raw payload.- Parameters:
data (
Any) – A result object from the helper.- Return type:
- Returns:
The parsed result.
nyora.ota¶
Over-the-air parser-bundle and source-catalog management.
Over-the-air parser feed management for Nyora Python.
This module keeps the JavaScript parser bundle and source catalog current
without a package release. OtaManager fetches a signed manifest from
the public OTA feed, verifies each artifact by SHA-256, and writes the bundle,
catalog, and manifest atomically into a per-user cache directory. When nothing
is cached, reads transparently fall back to the assets shipped inside the
package, so the SDK works fully offline on first run.
- class nyora.ota.OtaUpdateResult(updated, version, bundle_path, sources_path)[source]¶
Bases:
objectOutcome of an OTA update attempt.
- Variables:
updated –
Trueif new artifacts were downloaded and written;Falseif the cache was already current.version – The manifest version now installed in the cache.
bundle_path – Filesystem path to the cached parser bundle.
sources_path – Filesystem path to the cached source catalog.
- Parameters:
- class nyora.ota.OtaManager(cache_dir=None, *, timeout=30.0)[source]¶
Bases:
objectManages the over-the-air parser bundle and source catalog.
Coordinates fetching the OTA manifest, downloading and SHA-256-verifying the parser bundle and source catalog, and caching them atomically per user. Reads fall back to the bundled package assets when the cache is empty.
Example
>>> ota = OtaManager() >>> available, installed, latest = ota.is_update_available() >>> if available: ... result = ota.update() ... print("updated to", result.version)
Initialize the manager.
- Parameters:
- fetch_manifest()[source]¶
Download and parse the remote OTA manifest.
- Return type:
- Returns:
The manifest as a dict (containing
versionand per-artifacturl/sha256entries).- Raises:
NyoraError – If the manifest cannot be fetched, is invalid JSON, or is not a JSON object.
- is_update_available()[source]¶
Check whether the remote feed offers a newer version.
Network or manifest errors are treated as “no update available” rather than propagating, so this is safe to call opportunistically.
- update(*, force=False)[source]¶
Download and cache the latest parser bundle and source catalog.
The remote manifest is fetched, each artifact is downloaded and verified against its SHA-256, and all files are written atomically. When the cache is already current and
forceisFalse, nothing is downloaded.- Parameters:
force (
bool) – Re-download and overwrite even when already up to date.- Return type:
- Returns:
An
OtaUpdateResultdescribing what was applied.- Raises:
NyoraError – If the manifest or an artifact cannot be fetched, or if an artifact fails SHA-256 verification.
nyora.server¶
The stdlib HTTP server exposing the helper-compatible REST contract.
- class nyora.server.NyoraServer(host='127.0.0.1', port=0, *, runtime=None, write_port_file=True, timeout=60.0)[source]¶
Bases:
objectServe the camelCase helper REST contract over an embedded runtime.
Exposes the Nyora helper REST API backed by a
ParserRuntime, so any Nyora client (includingnyora.client.Nyora) can talk to the Python SDK as if it were the JVM helper.Example
>>> server = NyoraServer() >>> base_url = server.start() # background thread, returns immediately >>> # ... attach a client to base_url ... >>> server.stop()
- Parameters:
Initialize the server.
- Parameters:
host (
str) – Interface to bind. Defaults to loopback.port (
int) – Port to bind, or0to pick a free ephemeral port.runtime (
ParserRuntime|None) – An existingParserRuntimeto serve. WhenNone, a new one is created and owned (closed onstop()).write_port_file (
bool) – Whether to write the bound port to the standard helper port file so other apps can discover this server.timeout (
float) – Per-call timeout in seconds for an owned runtime.
- property base_url: str¶
The base URL the server is bound to.
- Returns:
The
http://host:portbase URL.- Raises:
NyoraError – If the server has not been started yet.
- start()[source]¶
Start serving in a background daemon thread.
Idempotent: calling it again while running returns the existing URL.
- Return type:
- Returns:
The base URL the server is bound to.
- serve_forever()[source]¶
Serve requests in the calling thread until interrupted.
Blocks until the server is shut down (e.g. by
KeyboardInterrupt), then stops and cleans up.- Return type:
- stop()[source]¶
Shut down the server and release its resources.
Closes the listening socket, joins the background thread, and closes an owned runtime. Safe to call when not running.
- Return type:
- dispatch(path, query)[source]¶
Route one request to the appropriate handler.
- Parameters:
- Return type:
- Returns:
A
(status_code, json_body)tuple.- Raises:
_BadRequest – If a required query parameter is missing or invalid.
LookupError – If a referenced source does not exist.
NyoraError – If the underlying runtime call fails.
nyora.runtime¶
The embedded QuickJS parser runtime that backs the direct client and the server.
Embedded JavaScript parser runtime for Nyora Python.
This module hosts ParserRuntime, the no-helper execution engine that
runs Nyora’s bundled JavaScript parsers (parsers.bundle.js) inside a
QuickJS context. The JavaScript side
exposes a global NyoraParsers object whose parsers call back into Python for
the things QuickJS cannot do on its own:
HTTP requests are served by
httpx(__py_http_get/__py_http_post).HTML parsing and DOM traversal are served by
selectolax(__py_parse_htmland the__py_query_*/__py_*node accessors).
The runtime is deliberately tolerant: HTTP errors return the response body (or
an empty string on transport failure) instead of raising, and every DOM callback
returns a safe default rather than raising into JavaScript. Combined with the
browser/Node polyfills installed by _runtime_prelude(), this keeps the
embedded parsers running for the widest possible range of real-world sources.
- exception nyora.runtime.ParserRuntimeError[source]¶
Bases:
NyoraErrorRaised when the embedded parser runtime fails.
- class nyora.runtime.ParserRuntime(*, timeout=60.0, ota=None)[source]¶
Bases:
objectRun Nyora’s bundled JavaScript parsers inside an embedded QuickJS engine.
A single instance owns one
httpx.Client, one QuickJS context, and the Python-side DOM node registry that backs the JavaScriptPyNodewrapper. The context is built from the JavaScript prelude (_runtime_prelude()) followed by the OTA-managed parser bundle.- Parameters:
timeout (
float) – Per-request HTTP timeout, in seconds, for the shared client.ota (
OtaManager|None) – OptionalOtaManager. When omitted a default manager is created, which transparently uses the bundled assets and the user cache.
- reload()[source]¶
Rebuild the QuickJS context from the (possibly updated) bundle.
Re-reads the parser bundle via the
OtaManagerand recreates the JavaScript context and DOM registry from scratch. Call this after an OTA update so the new parsers take effect.- Return type:
- call(source_id, method, args)[source]¶
Invoke one parser method and return its decoded JSON result.
- Parameters:
- Return type:
- Returns:
The parser result, JSON-decoded into native Python objects.
- Raises:
ParserRuntimeError – If the parser is missing, the method is unknown, the parser reports an error, or the embedded engine fails.
nyora.errors¶
The SDK exception hierarchy.
Nyora SDK exceptions.
Defines the exception hierarchy raised across the SDK. NyoraError is
the common base; helper discovery, helper launch, and helper HTTP failures each
have a dedicated subclass so callers can catch them selectively.
- exception nyora.errors.HelperNotFoundError[source]¶
Bases:
NyoraErrorRaised when no running helper can be discovered.
- exception nyora.errors.HelperLaunchError[source]¶
Bases:
NyoraErrorRaised when a managed helper process fails to start.
- exception nyora.errors.NyoraHTTPError(status_code, message, *, body='')[source]¶
Bases:
NyoraErrorRaised when the helper returns a non-successful HTTP response.
- Variables:
status_code – The HTTP status code returned by the helper.
body – The raw response body, when available.
- Parameters:
Initialize the error.
nyora.config¶
Helper-discovery configuration: environment variables and the port file.
Configuration helpers for local Nyora helper discovery.
Defines the environment-variable names the SDK honors and resolves the
platform-specific path of the helper port file. These helpers let
nyora.client and nyora.helper locate a running Nyora helper
without explicit configuration.
- Environment variables:
NYORA_BASE_URL: Explicit helper base URL, overriding port-file discovery. NYORA_HELPER_PORT_FILE: Override path for the helper port file. NYORA_HELPER_JAR: Path to a helper jar for managed launches.
- nyora.config.default_port_file()[source]¶
Return the path of the helper port file for this platform.
Honors
NYORA_HELPER_PORT_FILEwhen set; otherwise uses the platform-conventional application-data location (macOS Application Support, Windows%APPDATA%, or the XDG config dir on Linux).- Return type:
- Returns:
The resolved port-file path (which may not yet exist).
- nyora.config.read_base_url_from_port_file(port_file=None)[source]¶
Derive a helper base URL from a port file, if present.
- Parameters:
port_file (
Path|None) – Path to read. Defaults todefault_port_file().- Return type:
- Returns:
http://127.0.0.1:<port>when the file exists and holds a port, elseNone.
Services¶
The service objects attached to the helper client (nyora.client.Nyora).
nyora.services.sources¶
Source catalog operations.
- class nyora.services.sources.SourcesService(client)[source]¶
Bases:
objectBrowse, manage, and inspect the helper’s content sources.
Attached to a client as
client.sources.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- filters(source_id)[source]¶
List the search filters a source advertises.
- Parameters:
source_id (
str) – Identifier of the source to query.- Return type:
- Returns:
The source’s
SourceFilterdefinitions.
nyora.services.manga¶
Manga browse, search, reader, and metadata operations.
- class nyora.services.manga.MangaService(client)[source]¶
Bases:
objectBrowse, search, read, and configure manga via the helper.
Attached to a client as
client.manga.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- popular(source_id, page=1)[source]¶
Fetch a page of popular manga from a source.
- Parameters:
- Return type:
- Returns:
A
SearchPageof entries.
- latest(source_id, page=1)[source]¶
Fetch a page of the latest updated manga from a source.
- Parameters:
- Return type:
- Returns:
A
SearchPageof entries.
- search(source_id, query, page=1, *, filters=None)[source]¶
Search a source for manga matching a query.
- Parameters:
- Return type:
- Returns:
A
SearchPageof matching entries.
- global_search(query, *, limit_per_source=8)[source]¶
Search every installed source at once.
- Parameters:
- Return type:
- Returns:
One
GlobalSearchGroupper source.
- details(source_id, manga_url, *, manga_id=None)[source]¶
Fetch full metadata and chapters for one manga.
- Parameters:
- Return type:
- Returns:
A
MangaDetails.
- pages(source_id, chapter_url, *, branch=None)[source]¶
Resolve the readable image pages of a chapter.
- prefs(manga_id)[source]¶
Fetch the stored reader preferences for a manga.
- Parameters:
manga_id (
str) – Identifier of the manga.- Return type:
- Returns:
The manga’s
MangaPrefs.
nyora.services.library¶
Library, history, favourites, bookmarks, and categories.
- class nyora.services.library.LibraryService(client)[source]¶
Bases:
objectManage reading history, favourites, bookmarks, and categories.
Attached to a client as
client.library.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- history(limit=100)[source]¶
Return recent reading history.
- Parameters:
limit (
int) – Maximum number of entries to return.- Return type:
- Returns:
The most recent
HistoryEntryrecords.
- record_history(*, manga_id, chapter_id, page, percent)[source]¶
Record reading progress for a chapter.
- remove_history(manga_id, chapter_id=None)[source]¶
Remove history for a manga, optionally narrowed to one chapter.
nyora.services.downloads¶
Download operations.
- class nyora.services.downloads.DownloadsService(client)[source]¶
Bases:
objectStart, enqueue, monitor, and configure chapter downloads.
Attached to a client as
client.downloads.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- start(*, source_id, manga_url, chapter_url, manga_title='', chapter_title='')[source]¶
Start downloading a single chapter.
- Parameters:
- Return type:
- Returns:
The created
Downloadtask.
- enqueue(*, source_id, manga_url, chapters, manga_title='')[source]¶
Enqueue multiple chapters for download.
- settings()[source]¶
Return the current download settings.
- Return type:
- Returns:
The
DownloadSettings.
- save_settings(*, max_concurrent=None, format=None)[source]¶
Update download settings.
- Parameters:
- Return type:
- Returns:
The updated
DownloadSettings.
nyora.services.backup¶
Includes BackupService, SyncService, LocalService, TrackerService, and
SystemService.
Backup, sync, local file, tracker, and system operations.
Defines several helper-backed services: BackupService (export/import),
SyncService (Supabase cloud sync), LocalService (local file
scanning), TrackerService (AniList tracking), and
SystemService (stats, settings, OTA) which composes the sync, local,
and tracker services. SystemService is attached to a client as
client.system; the rest are reachable as client.system.sync etc.
- class nyora.services.backup.BackupService(client)[source]¶
Bases:
objectExport and import the helper’s library backup.
Attached to a client as
client.backup.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- export()[source]¶
Export the full backup archive.
- Return type:
- Returns:
The backup payload as returned by the helper.
- import_(backup_json)[source]¶
Import a previously exported backup.
- Parameters:
backup_json (
str|bytes) – The backup payload as JSON text or bytes.- Return type:
- Returns:
A
BackupImportResultsummarizing the import.
- class nyora.services.backup.SyncService(client)[source]¶
Bases:
objectSupabase-backed cloud sync operations.
Reachable as
client.system.sync.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- class nyora.services.backup.LocalService(client)[source]¶
Bases:
objectScan and read locally stored manga files.
Reachable as
client.system.local.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- class nyora.services.backup.TrackerService(client)[source]¶
Bases:
objectProgress-tracking integrations (AniList).
Reachable as
client.system.tracker.- Parameters:
client (
Nyora)
Bind the service to a helper client.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.
- class nyora.services.backup.SystemService(client)[source]¶
Bases:
objectSystem-level operations: stats, settings, OTA, and sub-services.
Attached to a client as
client.system. ComposesSyncService(.sync),LocalService(.local), andTrackerService(.tracker).- Variables:
sync – Cloud-sync operations.
local – Local-file operations.
tracker – Progress-tracking operations.
- Parameters:
client (
Nyora)
Bind the service to a helper client and build sub-services.
- Parameters:
client (
Nyora) – The owningnyora.client.Nyorainstance.