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          # or "anthropic"
DK_BASE_URL=https://api.openai.com/v1
DK_API_KEY=sk-...
DK_MODEL=gpt-4o

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

import dk

dk.configure(
    endpoint="openai",
    base_url="https://api.openai.com/v1",
    api_key="sk-...",
    model="qwen3-vl-",
)

Solve a single CAPTCHA

import dk

res = dk.solve("captcha.png")     # or .jpg / .jpeg
res = dk.solve("captcha_b64string")
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("captcha.png")
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.1

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.1
File Size Uploaded Provenance
darknight-0.1.1.tar.gz 41.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 91.0 kB

Release files / darknight-0.1.1.tar.gz

Download URL darknight-0.1.1.tar.gz
Size 41.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bc4c3f270d3bb02fc8742db6cee696539d56df6edc6d0fcf350abde9d2e548b0
BLAKE2b-256 checksum
How to use checksums
8aed89ae576f8fda4b01ff6e1b360e439bba6030e06c0e24c71532a8e7a0ed85
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.1-py3-none-any.whl

Download URL darknight-0.1.1-py3-none-any.whl
Size 49.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18c94ce185824b46a619af36948f7c0179e5383ba5b9d3ae1fd798740d89e48c
BLAKE2b-256 checksum
How to use checksums
2766ff062e9f5be3b82b318579a8e468215b3217246e402f80a8be222a583ecc
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.1

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