Skip to main content

A high-level encapsulation of jmcomic.

Project description

jmci

A high-level wrapper around jmcomic that provides a fluent search and download API plus a simple CLI.

jmci keeps the most common album search and download workflows, while hiding lower-level details of jmcomic.

Features

  • Fluent, chainable search API for albums
  • Flexible download API with folder, PDF, and ZIP export formats
  • Built-in CLI: jmci search and jmci download
  • Logging and progress output with rich formatting
  • Minimal wrapper focused on the most useful jmcomic workflows

Install

Requires Python 3.12+

pip install jmci

Or with uv:

uv add jmci

Quick Start

Python API

from jmci import Download, Search, SearchType, ExportFormat, enable_logging

# Enable rich logging
enable_logging(True)

# Search albums
results = (
    Search("keyword")
    .searching(SearchType.author)
    .pages([1, 2])
    .order_by("score")
    .filter_time("week")
    .category("doujin")
    .sub_category("chinese")
    .process()
)

for item in results:
    print(item.id, item.title)

# Download one or more albums
(
    Download([123456, 789012])
    .export_format(ExportFormat.folder | ExportFormat.pdf)
    .directory("./downloads")
    .jpg(True)
    .pictures(30)
    .process()
)

CLI

jmci search "keyword" --search-type author --order-by score --pages 1 2 --filter-time week
jmci download 123456 --directory ./downloads --export-format pdf zip --jpg
jmci download 123456 --cover

API Overview

Search

Use Search to build a search request and execute it with process().

from jmci import Search, SearchType, OrderBy, FilterTime, Category, SubCategory

results = (
    Search("keyword")
    .searching(SearchType.tag)
    .pages([1])
    .order_by(OrderBy.latest)
    .filter_time(FilterTime.all)
    .category(Category.all)
    .sub_category(SubCategory.none)
    .process()
)

Search supports:

  • searching(type) — choose SearchType (all, work, author, tag, actor)
  • pages(pages) — search pagination pages
  • keyword(keyword) — update the search keyword
  • order_by(order_by) — ordering strategy
  • filter_time(filter_time) — publication time filter
  • category(category) — main category filter
  • sub_category(sub_category) — subcategory filter
  • process() — execute the search and return results
  • process_select(converter) — convert results while processing
  • where(filter), sort(key), reverse(), join(...) — filter and transform results

SearchResult objects expose:

  • id
  • title
  • tags

Download

Use Download to download albums with configurable export options.

from jmci import Download, ExportFormat

(
    Download([123456])
    .directory("./downloads")
    .export_format(ExportFormat.folder | ExportFormat.zip)
    .jpg(True)
    .pictures(20)
    .process()
)

Download supports:

  • downloading(album_ids) — replace the album list
  • add(id), remove(id), pop(index), insert(index, id), extend(ids) — manage album IDs
  • export_format(format) — set output format
  • add_export_format(format) / remove_export_format(format) — modify format set
  • directory(directory) — output directory
  • jpg(convert_to_jpg=True) — convert pictures to JPG
  • pictures(pictures) — limit download concurrency per album
  • process() — perform full album download and export
  • process_download_cover() — download album cover images only

Supported export formats:

  • ExportFormat.folder
  • ExportFormat.pdf
  • ExportFormat.zip

Formats can be combined using bitwise OR.

Logging

jmci exposes enable_logging() to toggle rich logging output.

from jmci import enable_logging
enable_logging(True)

Documentation

Documentation is available under docs/source and can be built with Sphinx:

uv run sphinx-build -b html docs/source docs/build

Dependencies

jmci is a lightweight wrapper and depends on:

  • jmcomic
  • rich
  • typer
  • beartype
  • img2pdf

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jmci-0.1.0.1.tar.gz (35.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jmci-0.1.0.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file jmci-0.1.0.1.tar.gz.

File metadata

  • Download URL: jmci-0.1.0.1.tar.gz
  • Upload date:
  • Size: 35.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jmci-0.1.0.1.tar.gz
Algorithm Hash digest
SHA256 eac9ca7d9aef8042a8b942983a9313039d429bde3fe915bf1d2e4e0ba94b93f8
MD5 f05160471c51090073de4c89281e6f9b
BLAKE2b-256 71d2017a55c4a6cc877f06264f8b89905012c10c355fb1c6ef2e29ce6c8b9ad6

See more details on using hashes here.

File details

Details for the file jmci-0.1.0.1-py3-none-any.whl.

File metadata

  • Download URL: jmci-0.1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jmci-0.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e40187f6b0544965bf1aad58d761229c99194f7446477f32e973a486d23aad3
MD5 611e9968dd97cae6d4a7b40e6e0e6e9b
BLAKE2b-256 f306c298acb3d1438b97d1a99b10c99f39ff681d65b67d45424568d49a40bbc3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page