Skip to main content

darknight (dk)

Install

  1. Unzip the folder:
unzip darknight-pkg.zip
  1. Install it by local path:
pip install /path/to/darknight-pkg
# or editable
pip install -e /path/to/darknight-pkg

If project tracks dependencies in requirements.txt:

-e /path/to/darknight-pkg

or in pyproject.toml:

dependencies = [
    "darknight @ file:///path/to/darknight-pkg",
]

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.0

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

Built distribution (wheel)

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

Total release size: 91.2 kB

Release files / darknight-0.1.0.tar.gz

Download URL darknight-0.1.0.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
45451a9a6fe2bb205017500f443fbe93096348db324d23b3104d851517ae5ae9
BLAKE2b-256 checksum
How to use checksums
97332ee0e823c6b67101f66b5bf576655eb35a859a2f9249f19439293b226843
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.0-py3-none-any.whl

Download URL darknight-0.1.0-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f208530d7e81b02f31f5ff74cab1e3a97a043413a603aff0a4e967affeadb13
BLAKE2b-256 checksum
How to use checksums
7cb376f9ca86392bc5dcd7038dc95d1268954a362e7f7809498f5c840849514d
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.0

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