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          # any OpenAI-API-compatible endpoint
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",                                        # any OpenAI-API-compatible endpoint
    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.3

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.3
File Size Uploaded Provenance
darknight-0.1.3.tar.gz 41.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 91.3 kB

Release files / darknight-0.1.3.tar.gz

Download URL darknight-0.1.3.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9864dc57204c5f66928615b2577af17a11e638b7410e1faf8cbe5534c0f4b7b1
BLAKE2b-256 checksum
How to use checksums
1acb4c533ea684f27b5b97f6b1323cea47bf5019dbe964c3d5d49979a2ef98bb
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.3-py3-none-any.whl

Download URL darknight-0.1.3-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94ff2a30693629db43914a81d4137643fec674d34807914c7abc327d14168bd4
BLAKE2b-256 checksum
How to use checksums
3c03f675a2ed9fbdb1b3a159da48356204b296663a48a012322594cb73928aec
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.3

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