skillfed

nokap

Capture screenshots and PDFs from web pages using headless Chrome via CDP.

nokap v0.1.0 516.7K downloads/30d#6,232 on PyPI5
Permissive license MIT License Copyright (c) 2026 Richard Iannone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) Active released

What it is and what it does

nokap is a lightweight Python library for capturing screenshots and PDFs from web pages or HTML strings using headless Chrome. It communicates directly with Chrome via the Chrome DevTools Protocol over WebSockets, eliminating the need for browser driver binaries or heavyweight automation frameworks. The library launches and manages a headless Chrome process, connects via CDP, and uses Chrome's native capture methods to render pages to PNG, JPEG, WebP, or PDF formats.

The package is designed for developers who need straightforward web-to-image or web-to-PDF conversion without the complexity of larger automation tools. It supports CSS selectors to capture specific elements, viewport control for responsive layouts, zoom scaling for retina-quality output, and rendering of HTML strings directly. Chrome or Chromium must be installed separately on the system; nokap will locate it automatically. The library is typed, actively maintained, and supports Python 3.10 through 3.13.

Use it for:

  • Generate thumbnails or previews of web pages for display in dashboards or content management systems
  • Export HTML reports or tables rendered by libraries directly to PDF or image files
  • Capture specific page elements using CSS selectors for automated documentation generation
  • Convert dynamically generated HTML from templates or data to static images without a full browser
  • Create retina-quality screenshots for design mockups or testing responsive layouts at different scales

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

nokap captures screenshots and PDFs from web pages or HTML strings using headless Chrome via the Chrome DevTools Protocol, without requiring Selenium or Playwright.

Yes, if you need simple web-to-image or web-to-PDF capture and already have Chrome or Chromium installed. The low dependency footprint, active maintenance, and permissive MIT license make it a practical choice over heavier frameworks. No known vulnerabilities. Install it if you want straightforward screenshot and PDF generation without Selenium or Playwright overhead; skip it if you need advanced browser automation or don't have Chrome available.

Install

nokap on PyPI

pip

pip install nokap

uv

uv add nokap

poetry

poetry add nokap

Installing nokap

Before you install

Low friction: pure Python wheel with only two runtime dependencies (websockets and click). Active maintenance as of June 2026. Requires Chrome or Chromium to be installed on the system separately.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install nokap

import nokap

nokap.webshot("https://example.com", "example.png")
nokap.from_html("Hello, world!", "hello.png")

Chrome or Chromium must be installed on the system; nokap will locate it automatically.

Verify before relying

  • Whether Chrome binary discovery works reliably across different system configurations and installation methods
  • Performance characteristics when capturing many pages or large documents in sequence
  • Stability and resource usage of the persistent Chrome process across long-running applications

Package facts

License MIT License Copyright (c) 2026 Richard Iannone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — websockets, click
Maintenance actively maintained — 67 days since the last release
Last repo commit
First released
Downloads 516,706/month — #6,232 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nokap-0.1.0-py3-none-any.whl

Keywords: screenshot, chrome, cdp, pdf, headless, webshot

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Multimedia :: Graphics :: Capture :: Screen CaptureTyping :: Typed

Tags

screenshot web pages headless chromepdf generation from htmlchrome devtools protocol automationcapture webpage as imageheadless browser screenshot toolhtml to png converterweb page rendering automation
web-automationscreenshot-generationpdf-export

More Screen Capture packages