Skip to main content

darknight (dk)

Install

pip install darknight

If your project tracks dependencies in requirements.txt:

darknight

or in pyproject.toml:

dependencies = [
    "darknight",
]

Configure

Copy the example env file and fill in your own values:

cp .env.example .env
DK_ENDPOINT=openai
DK_BASE_URL=http://YOUR.OPENAI-API-COMPATIBLE-BACKEND.com/v1
DK_API_KEY=YOUR_API_KEY
DK_MODEL=qwen3-vl-4b-instruct

Or configure programmatically instead of / on top of .env:

import dk

dk.configure(
    endpoint="openai",
    base_url="http://YOUR.OPENAI-API-COMPATIBLE-BACKEND.com/v1",
    api_key="YOUR_API_KEY",
    model="qwen3-vl-4b-instruct",
)

Solve a single CAPTCHA

import dk

res = dk.solve("/path/to/your/captcha.png")   # pass a file path in .png / .jpg / .jpeg
res = dk.solve("captcha_b64string")           # or a base64 / data-URI image string
print(res)   # eg: "Cx5b"

Solve a batch (.json dataset)

results = dk.solve("dataset.json")  

Dataset format:

[
  {"id": "001", "label": "4vNf", "b64_string": "<base64 PNG/JPEG>"}
]

RAG memory + feedback

Every dk.solve() call automatically reads from a single, universal, disk-persisted RAG store (~/.darknight/rag/rag.json) for hints from past captchas. But correctness isn't knowable at solve() time, so nothing is written until you report the real outcome:

import dk

res = dk.solve("/path/to/your/captcha.png")   # pass a file path in .png / .jpg / .jpeg
correct = submit_to_website(res)   # verification step
dk.feedback(correct)               # writes this records into the RAG store

dk.feedback() always applies to the most recent dk.solve() call. If you call dk.solve() again before giving feedback on the previous one, only captchas that received feedback will be stored.

dk.clear_rag()   # clear the RAG store

Metadata

Release files for darknight 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for darknight 0.1.4
File Size Uploaded Provenance
darknight-0.1.4.tar.gz 41.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for darknight 0.1.4
File Interpreter ABI Platform
darknight-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 91.2 kB

Release files / darknight-0.1.4.tar.gz

Download URL darknight-0.1.4.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
96eaeb187c6f72b06695158cf2ef9626d9351167f32ea547ff3fb63e8def211a
BLAKE2b-256 checksum
How to use checksums
6403a126e463b87ad187b3c7e9c30ab504902c7783291ea9be9f727c047e363f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / darknight-0.1.4-py3-none-any.whl

Download URL darknight-0.1.4-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f870b7bef15c295209e99eba83e5cf64e717d6e0652399ed1a43bd2c81787a2a
BLAKE2b-256 checksum
How to use checksums
974fceb060430ac92719d06b0d7406022113a14332acbd2cf75121ff42242590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for darknight 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page