Skip to main content

Kshana: the mark, a compass reticle marking the precise instant, beside the wordmark kshana

Kshana · क्षण · the precise instant
An open-source simulator for PNT (positioning, navigation and timing) resilience.

Release v0.39.0 176 of 388 capabilities validated against independent external oracles About 95% line coverage, gated at 85% in continuous integration Licence: AGPL-3.0-only, or a commercial licence DOI 10.5281/zenodo.20528627

Rehearse the minute GNSS goes dark: Kshana's mission console, drawn from a real run of the engine, a chained jamming, spoofing, holdover and integrity campaign over the 102 satellites of GPS, Galileo, BeiDou and GLONASS

Rehearse the minute GNSS goes dark

Kshana replays jamming, spoofing and clock holdover when GNSS (Global Navigation Satellite System) signals fail, and tells you how long a system keeps time and position inside its budget, and which clock or sensor buys the most margin. This is the Python package: the engine in a notebook or a script. Every run is reproducible bit for bit from the scenario, the seed and the engine version.

Try it first with nothing to install: Kshana Studio runs the whole engine in your browser, compiled to WebAssembly, and uploads nothing.

Evidence

176 of 388 capabilities validated against independent external oracles; 208 honestly labelled Modelled, 4 partner-owned. Each capability carries one label in a machine-checked ledger: VALIDATED (an independent external oracle agrees: real data, an independent implementation or published reference vectors), MODELLED (internally consistent, and said out loud) or PARTNER (a hardware partner owns it). Among the checks: all 666 SGP4 (Simplified General Perturbations 4) vectors of AIAA (American Institute of Aeronautics and Astronautics) 2006-6753 to 4.12 mm, and the Cowell force model to 0.08 m against Orekit 12.2.

How a capability earns its label: capability, oracle, test, ledger label. The verification status across all 388 capabilities: 176 Validated, 208 Modelled, 4 Partner-owned

Install

pip install kshana

Wheels are built on each release tag for Linux, macOS and Windows, each for x86-64 and 64-bit ARM, and one abi3 wheel per platform covers CPython 3.9 and newer. To build from source instead, use maturin: pip install maturin && maturin develop --features python.

Usage

The example is complete: it carries its own scenario, so it runs as written with nothing else on disk.

import json, kshana

# A complete scenario, not a sketch: scenarios/clock-holdover.toml without its comment
# lines. It runs 2 h, 10 min of GNSS then about 1.8 h with GNSS denied, and asks how long
# a strontium optical clock and a chip-scale atomic clock (CSAC) each hold time to within
# 20 ns. sigma_y(1s) is a clock's Allan deviation at an averaging time of one second;
# q_wf, the white-frequency-noise intensity, is its square.
toml = """
seed = 42
threshold_ns = 20.0

[time]
step_s = 10.0
duration_s = 7200.0

[gnss]
windows = [
  { t0 = 0.0,    t1 = 600.0,  state = "nominal" },
  { t0 = 600.0,  t1 = 7200.0, state = "denied" },
]

[clock_quantum]
id = "optical-sr-lattice"
provenance = "Strontium optical lattice clock, space-oriented goal sigma_y(1s)=1e-15 (Origlia/Schiller/Bongs et al., arXiv:1503.08457); q_wf=sigma_y(1s)^2; ground-demonstrator maturity, not flown; flicker/aging not modeled"
y0   = 5.0e-17
q_wf = 1.0e-30
q_rw = 0.0

[clock_classical]
id = "csac-sa45s"
provenance = "Microchip SA65 / SA.45s CSAC datasheet sigma_y(1s)=3e-10; q_wf=sigma_y(1s)^2; flicker/aging not modeled"
y0   = 5.0e-10
q_wf = 9.0e-20
q_rw = 0.0
"""

result = json.loads(kshana.run(toml))       # the full result document
print(result["quantum"]["fom"]["integrity"])

# The JSON result, the chart as SVG (Scalable Vector Graphics) and a one-line summary,
# all from one engine run:
result_json, chart_svg, summary = kshana.run_full(toml)
print(kshana.version(), summary)

Every other reference scenario is a file under scenarios/ in the repository; pass its text to kshana.run the same way. With the Rust command-line interface (CLI) installed, kshana example <name> prints each scenario bundled in the binary, and kshana example lists them.

Beyond run / run_full / version, the module exposes run_typed (a structured result object), validate_toml (lint → list of error strings), scenario_kinds (the dispatchable kinds as a Python list of dictionaries), list_kinds (the same metadata as one JSON string — kept as a string so existing callers do not break; call json.loads(kshana.list_kinds()), or use scenario_kinds() for the parsed list), and error_kind (the KshanaError tag for a rejected scenario) — see docs/PYTHON_API.md.

Every capability in the verification matrix is labelled validated (checked against an independent external oracle), modelled or partner-owned; optical-clock figures are space goals on ground hardware (no strontium optical clock has flown). Maturity is not uniform across domains — Earth PNT is validated against real data; deep-space and Mars navigation is modelled, with only its building blocks (light time, planet positions) validated against external oracles; real-mission deep-space OD (orbit determination) is on the roadmap.

Capabilities

The engine has 87 scenario kinds; kshana kinds lists them with their fields. New in 0.38.0: gnss-ssv (GNSS signals for spacecraft above, around and past the GNSS orbits) and lunar-infrastructure (lunar orbit and surface as navigation and geodetic infrastructure), both MODELLED, and holdover-test (a time-error record against the ITU-T masks).

  • Spectrum: how a jammer takes the GNSS L band, band by band.
  • Clocks and timing: holdover against a threshold, time transfer, and telecom holdover against the masks of the International Telecommunication Union's standardization sector (ITU-T).
  • Constellations around any body: coverage, dilution of precision and availability around the Earth, the Moon or Mars, and the solar system at one epoch.
  • Low-Earth-orbit navigation: signal, pass and link, navigation message, and a fused fix, stage by stage.
  • Campaigns: a chained mission, a sweep or a Monte Carlo ensemble in one scenario.
  • Reports, animation and exports: every figure with its unit and label; an animated drawing of a run; SP3 (Standard Product 3), CCSDS (Consultative Committee for Space Data Systems) orbit messages, CZML (Cesium Language), KML (Keyhole Markup Language), GeoJSON, STK (Systems Tool Kit) and SigMF (Signal Metadata Format) files.
  • Vessel GNSS trust (advisory, not type-approved navigation equipment): receiver_trust scores a receiver log described by a scenario; receiver_trust_replay scores a bounded NMEA excerpt the way the live command does; assess_vessel_log scores a vessel's NMEA log as a batch run. A 0-100 score with its reasons.
  • Evidence packs: evidence_create and evidence_verify make and check a signed technical record of a log window; evidence_keygen makes a signing key (Python only, so the private key stays out of a page or an agent conversation); evidence_attach_timestamp binds an RFC 3161 timestamp token. A record, not a legal opinion.
  • OSNMA: osnma_verify reports which satellites' Galileo navigation data an I/NAV page file or a UBX stream authenticates, given a trusted Merkle root or public keys and an optional independent reference time. It authenticates data; it is not a navigation integrity service and makes no anti-spoofing performance claim.
  • Trust telemetry: trust_telemetry renders a trust stream or result as Prometheus text, CEF or LEEF syslog lines or an OTLP payload; nothing is sent.
  • Training streams: nmea_training writes synthetic bridge NMEA and an instructor log for crew training. Text only; never for a vessel's live navigation systems; advisory, not type-approved navigation equipment.
  • Interference map: interference_map builds aggregate degraded-navigation maps from public reports; route_exposure measures how much of a route falls inside them.
  • Test bench and compliance mapping: bench_export writes a scenario's vehicle motion and events for a laboratory GNSS simulator (no signal is written); compliance_report fills the public-framework mapping from result documents and compliance_mapping returns the static tables.
  • Examples, exports, animation and routes: list_examples and get_example (the bundled scenarios), export_formats, export_scenario, export_sp3, export_omm and export_oem, animate_scenario (an animated drawing, a player or frames) and import_route (a GeoJSON route into a terrain, gravity or combined scenario).
  • GNSS IQ lab: iq_signals, iq_scene, iq_scene_broadcast, iq_acquire, iq_acq_surface, iq_info, iq_inventory, iq_sweep, iq_track, iq_loop_designs, iq_read_epochs, iq_monitor, iq_frontend, iq_test_conditions, iq_campaign, iq_campaign_report and iq_labfit for recorded and synthetic GNSS IQ.
  • Core calls: run, run_full, run_typed, validate_toml, scenario_kinds, list_kinds, error_kind and version.

Architecture

One open engine at the centre, kshana 0.39.0, with a typed dispatch over 75 kinds; around it the command line, the Rust library, Python, WebAssembly and Kshana Studio, the MCP server, the Docker image and the JetBrains plugin; below it Kshana Pro, a proprietary overlay that depends on the open engine and never forks it

The same scenario file gives the same bytes on every surface. MCP is the Model Context Protocol: kshana-mcp lets an AI (artificial intelligence) assistant run the engine.

Research

Six papers on arXiv are built on the open engine, each with the command behind it: arXiv:2606.22054 (the optimism gap of interference detectors), arXiv:2606.24210 (a conditional timing protection level), arXiv:2607.05415 (how stable a PNT resilience score is), arXiv:2607.02566 (lunar surface station observability with very-long-baseline interferometry), arXiv:2607.06212 (lunar south-polar geometry and surface beacons) and arXiv:2610.23871 (cislunar navigation as an observability problem: arc length, Gramian conditioning and the Doppler lever). See Research.

Editions

The whole engine is free under the AGPL-3.0. Kshana Pro, a proprietary overlay that depends on the open engine and never forks it, and custom studies are available under contract from Ashforde® OÜ: contact@ashforde.org. There are no prices; see docs/PRO.md.

Learn more

Licence

Free and open source under the GNU AGPL-3.0-only (the GNU Affero General Public License, version 3 only). A commercial licence is available from Ashforde® OÜ (an Estonian private limited company; OÜ = osaühing) for closed integration; see LICENSING.md. Professionally developed and maintained by Ashforde® OÜ.

Metadata

Release files for kshana 0.39.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 kshana 0.39.0
File Size Uploaded Provenance Actions
kshana-0.39.0.tar.gz 8.5 MB Without provenance Details for kshana-0.39.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kshana 0.39.0
File Actions
kshana-0.39.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for kshana-0.39.0-cp39-abi3-win_arm64.whl
kshana-0.39.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for kshana-0.39.0-cp39-abi3-win_amd64.whl
kshana-0.39.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for kshana-0.39.0-cp39-abi3-manylinux_2_28_x86_64.whl
kshana-0.39.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for kshana-0.39.0-cp39-abi3-manylinux_2_28_aarch64.whl
kshana-0.39.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for kshana-0.39.0-cp39-abi3-macosx_11_0_arm64.whl
kshana-0.39.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for kshana-0.39.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 69.5 MB

Release files / kshana-0.39.0.tar.gz

Download URL kshana-0.39.0.tar.gz
Size 8.5 MB
Tags Source
SHA-256 checksum
How to use checksums
e109e64968575f73837beab25bbc574a30bc9051f38da290b9c25ecc922aefa2
BLAKE2b-256 checksum
How to use checksums
ff628ba7964f9afc6f2d7736a5f775ad4acfa535e227c5ac1ab428dd5eee6849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-win_arm64.whl

Download URL kshana-0.39.0-cp39-abi3-win_arm64.whl
Size 9.8 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
e45ec8abc94638945d9d803ce953039301e5d9913aabba9bdf89009ab8319849
BLAKE2b-256 checksum
How to use checksums
2dee5d10fab175acbf29e35c6a0fe7cedce3ba23fa069459f0f6ffe1a729c969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-win_amd64.whl

Download URL kshana-0.39.0-cp39-abi3-win_amd64.whl
Size 10.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4dacc8c4f18b3f8465495ab954bc90db54a20e1c0f1c7c98dbc0b14992d2d4a1
BLAKE2b-256 checksum
How to use checksums
c10356987b74d07448b0dd5415681830619fa912cbeb60ad659eb91c94d3a2ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL kshana-0.39.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 10.5 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
394cd5caf8835ba84f1417ff1e9ab3ae63b03b3489c2b5ebb88938f88cface4b
BLAKE2b-256 checksum
How to use checksums
9aafa0687e345805b3e13473fc3dc92c989766c8138159fb79af653041cef092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL kshana-0.39.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 9.9 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
54024951bd9569919b8c8d4ab5fe7c6bf4c144d365813e0c0062715ab2d738eb
BLAKE2b-256 checksum
How to use checksums
3d5d2ea31bfd5a15e340b140ea252e3b6784d7be350a39608d1e7bf93dfccc38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL kshana-0.39.0-cp39-abi3-macosx_11_0_arm64.whl
Size 9.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c7ebc4134c915984e85e69b6d9b7d75bc88ed928ddef1632cb7acec9b50b19b7
BLAKE2b-256 checksum
How to use checksums
3ce15f5a7df403797cfeb6b3f9f59b92f0a45d59a4f7794769b69b079056f747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kshana-0.39.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL kshana-0.39.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 10.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c99665a3fcae31ff1554e65834b52e32ca4f89994df0890a1512d76f2eb88836
BLAKE2b-256 checksum
How to use checksums
22ceccb0a14cdf9b881505ad0924e0b10c50616461a5604f317b64658af20dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for kshana 0.39.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.39.0 This release

7 release files No provenance

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