Skip to main content

PyPI PyPI Stats license issue resolution

Nighthawk

nighthawk-logo

Nighthawk is a Python library where Python controls flow and LLMs or coding agents reason within constrained Natural blocks.

  • Hard control (Python code): strict procedure, verification, and deterministic flow.
  • Soft reasoning (an LLM or coding agent): semantic interpretation inside small embedded "Natural blocks".

The same mechanism handles lightweight LLM judgments ("classify this sentiment") and autonomous agent executions ("refactor this module and write tests"). See Philosophy for the full design rationale.

This repository is a compact reimplementation of the core ideas of Nightjar.

Installation

Prerequisites: Python 3.13+

pip install nighthawk-python pydantic-ai-slim[openai]

For other providers, see Pydantic AI providers.

Example

import nighthawk as nh


def python_average(numbers):
    return sum(numbers) / len(numbers)


step_executor = nh.AgentStepExecutor.from_configuration(configuration=nh.StepExecutorConfiguration(model="openai-responses:gpt-5.6-luna"))

with nh.run(step_executor):

    @nh.natural_function
    def calculate_average(numbers):
        """natural
        Map each element of <numbers> to the number it represents,
        then compute <:result> by calling <python_average> with the mapped list.
        """
        return result

    calculate_average([1, "2", "three", "cuatro"])  # 2.5

See the Quickstart for setup details, credentials, and troubleshooting.

Documentation

Development & Contributing

See CONTRIBUTING.md for setup, development commands, and contribution guidelines.

References

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nighthawk_python-0.13.0.tar.gz (359.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nighthawk_python-0.13.0-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

Details for the file nighthawk_python-0.13.0.tar.gz.

File metadata

  • Download URL: nighthawk_python-0.13.0.tar.gz
  • Upload date:
  • Size: 359.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nighthawk_python-0.13.0.tar.gz
Algorithm Hash digest
SHA256 908389e1b2e15bc28ae3ce13b5af5f683a928fcc9f8b15594298b37ca9cfd9db
MD5 3130d24cea74582e24883299d47d8e70
BLAKE2b-256 c4f034e5e3e8d61a501ca7239e26f7032fc9bbd6ece7d570d7f2dbabdbc4ea85

See more details on using hashes here.

Provenance

The following attestation bundles were made for nighthawk_python-0.13.0.tar.gz:

Publisher: publish.yml on kurusugawa-computer/nighthawk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nighthawk_python-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nighthawk_python-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60c3f59b1909107a5d575eb1bd0d13940fb46d88e5221a47da87b37e38c99ff5
MD5 82226651ead17301ee1b6b22d330b8f7
BLAKE2b-256 37e780953e9b27459c4e5e502094165875b50213ee89fc0bc1cb344579c1ce7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nighthawk_python-0.13.0-py3-none-any.whl:

Publisher: publish.yml on kurusugawa-computer/nighthawk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.14.0

2 files

This release

0.13.0 This release

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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