casper-astro-tools 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- casper_astro_tools-0.1.0/.github/workflows/ci.yml +38 -0
- casper_astro_tools-0.1.0/.gitignore +9 -0
- casper_astro_tools-0.1.0/.gitlab-ci.yml +48 -0
- casper_astro_tools-0.1.0/CHANGELOG.md +18 -0
- casper_astro_tools-0.1.0/CITATION.cff +43 -0
- casper_astro_tools-0.1.0/CONTRIBUTING.md +7 -0
- casper_astro_tools-0.1.0/LICENSE +198 -0
- casper_astro_tools-0.1.0/MANIFEST.in +9 -0
- casper_astro_tools-0.1.0/NOTICE +38 -0
- casper_astro_tools-0.1.0/PKG-INFO +154 -0
- casper_astro_tools-0.1.0/README.md +124 -0
- casper_astro_tools-0.1.0/SECURITY.md +15 -0
- casper_astro_tools-0.1.0/bench/README.md +91 -0
- casper_astro_tools-0.1.0/bench/make_tasks.py +521 -0
- casper_astro_tools-0.1.0/bench/results/gpt-oss-120b_offline_2026-10-30.json +1490 -0
- casper_astro_tools-0.1.0/bench/results/ministral-3-14b_offline_2026-10-30.json +1519 -0
- casper_astro_tools-0.1.0/bench/results/oracle_offline_v0.1.json +1366 -0
- casper_astro_tools-0.1.0/docs/ACKNOWLEDGEMENTS.md +62 -0
- casper_astro_tools-0.1.0/docs/DATA_AND_TERMS.md +9 -0
- casper_astro_tools-0.1.0/docs/DESIGN.md +33 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_citations.md +155 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_get_paper.md +90 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_libraries.md +64 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_library.md +126 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_object_literature.md +151 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_references.md +156 -0
- casper_astro_tools-0.1.0/docs/catalogue/ads_search.md +161 -0
- casper_astro_tools-0.1.0/docs/catalogue/archive_list.md +138 -0
- casper_astro_tools-0.1.0/docs/catalogue/archive_search.md +153 -0
- casper_astro_tools-0.1.0/docs/catalogue/arxiv_get_paper.md +87 -0
- casper_astro_tools-0.1.0/docs/catalogue/arxiv_recent.md +140 -0
- casper_astro_tools-0.1.0/docs/catalogue/arxiv_search.md +124 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_angular_separation.md +72 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_barycentric_correction.md +97 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_best_nights.md +166 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_convert_coordinates.md +89 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_convert_time.md +83 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_convert_units.md +69 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_cosmology.md +124 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_extinction_law.md +93 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_fov_check.md +107 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_list_sites.md +111 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_magnitude_flux.md +78 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_night_info.md +117 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_propagate_proper_motion.md +91 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_redshift_convert.md +68 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_services_status.md +39 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_sidereal_time.md +83 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_spectral_lines.md +168 -0
- casper_astro_tools-0.1.0/docs/catalogue/astro_target_visibility.md +179 -0
- casper_astro_tools-0.1.0/docs/catalogue/cds_crossmatch.md +145 -0
- casper_astro_tools-0.1.0/docs/catalogue/gaia_adql.md +80 -0
- casper_astro_tools-0.1.0/docs/catalogue/gaia_cone.md +169 -0
- casper_astro_tools-0.1.0/docs/catalogue/gaia_source.md +112 -0
- casper_astro_tools-0.1.0/docs/catalogue/hips_list.md +76 -0
- casper_astro_tools-0.1.0/docs/catalogue/image_cutout.md +88 -0
- casper_astro_tools-0.1.0/docs/catalogue/index.md +64 -0
- casper_astro_tools-0.1.0/docs/catalogue/ned_object.md +77 -0
- casper_astro_tools-0.1.0/docs/catalogue/resolve_name.md +77 -0
- casper_astro_tools-0.1.0/docs/catalogue/simbad_cone.md +144 -0
- casper_astro_tools-0.1.0/docs/catalogue/simbad_object.md +161 -0
- casper_astro_tools-0.1.0/docs/catalogue/vizier_columns.md +150 -0
- casper_astro_tools-0.1.0/docs/catalogue/vizier_cone.md +95 -0
- casper_astro_tools-0.1.0/docs/catalogue/vizier_find_catalogues.md +96 -0
- casper_astro_tools-0.1.0/docs/catalogue/vo_registry_search.md +79 -0
- casper_astro_tools-0.1.0/docs/catalogue/vo_tap_query.md +99 -0
- casper_astro_tools-0.1.0/docs/catalogue/vo_tap_tables.md +119 -0
- casper_astro_tools-0.1.0/docs/tools.json +2547 -0
- casper_astro_tools-0.1.0/examples/CASE_STUDY.md +77 -0
- casper_astro_tools-0.1.0/examples/case_study.py +122 -0
- casper_astro_tools-0.1.0/pyproject.toml +62 -0
- casper_astro_tools-0.1.0/setup.cfg +4 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/__init__.py +16 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/__main__.py +3 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/_offline.py +28 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/ads.py +242 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/agent.py +195 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/api.py +62 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/core.py +567 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/safety.py +392 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/services.py +142 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/specs.py +138 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/tables.py +152 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/archives/upstream.py +116 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/arxiv.py +174 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/bench.py +359 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/cli.py +156 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/common.py +138 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/coords.py +195 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/data/bench/astrotoolbench_live.jsonl +9 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/data/bench/astrotoolbench_offline.jsonl +74 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/data/fixtures/archives_2026-10-22.json +183 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/data/fixtures/live_2026-10-30.json +102 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/lines.py +97 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/lit_common.py +78 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/observing.py +375 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/physics.py +290 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/py.typed +0 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/registry.py +307 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/runtime.py +84 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/server.py +58 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/sites.py +49 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/testing.py +165 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools/timescales.py +123 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/PKG-INFO +154 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/SOURCES.txt +125 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/dependency_links.txt +1 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/entry_points.txt +2 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/requires.txt +9 -0
- casper_astro_tools-0.1.0/src/casper_astro_tools.egg-info/top_level.txt +1 -0
- casper_astro_tools-0.1.0/tests/conftest.py +26 -0
- casper_astro_tools-0.1.0/tests/fixtures/ads_search_ok.json +87 -0
- casper_astro_tools-0.1.0/tests/fixtures/arxiv_bomb.xml +4 -0
- casper_astro_tools-0.1.0/tests/fixtures/arxiv_error_feed.xml +6 -0
- casper_astro_tools-0.1.0/tests/fixtures/arxiv_feed.xml +32 -0
- casper_astro_tools-0.1.0/tests/test_archives.py +538 -0
- casper_astro_tools-0.1.0/tests/test_bench.py +196 -0
- casper_astro_tools-0.1.0/tests/test_case_study.py +54 -0
- casper_astro_tools-0.1.0/tests/test_catalogue.py +71 -0
- casper_astro_tools-0.1.0/tests/test_fixture_marks.py +71 -0
- casper_astro_tools-0.1.0/tests/test_hygiene.py +109 -0
- casper_astro_tools-0.1.0/tests/test_registry.py +94 -0
- casper_astro_tools-0.1.0/tests/test_runtime_api_cli.py +94 -0
- casper_astro_tools-0.1.0/tests/test_server.py +77 -0
- casper_astro_tools-0.1.0/tests/test_tools.py +671 -0
- casper_astro_tools-0.1.0/tools/gen_catalogue.py +160 -0
- casper_astro_tools-0.1.0/tools/record_fixtures.py +58 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# NOT ACTIVE until this directory is at the root of the public repository. Prepared 2026-10-30.
|
|
2
|
+
name: ci
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
strategy:
|
|
8
|
+
matrix:
|
|
9
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: ${{ matrix.python-version }}
|
|
15
|
+
- run: python -m pip install --upgrade pip && pip install -e ".[test]"
|
|
16
|
+
- run: pytest
|
|
17
|
+
- run: python tools/gen_catalogue.py --check && python bench/make_tasks.py --check
|
|
18
|
+
- run: casper-astro-tools bench oracle
|
|
19
|
+
secret-scan:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with: { python-version: "3.12" }
|
|
25
|
+
- run: pip install detect-secrets==1.5.0
|
|
26
|
+
- run: |
|
|
27
|
+
detect-secrets scan --exclude-files 'src/casper_astro_tools/data/fixtures/.*' > /tmp/secrets.json
|
|
28
|
+
python -c "import json,sys; d=json.load(open('/tmp/secrets.json')); n=sum(len(v) for v in d['results'].values()); print('findings:', n); sys.exit(1 if n else 0)"
|
|
29
|
+
build:
|
|
30
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: actions/setup-python@v5
|
|
35
|
+
with: { python-version: "3.12" }
|
|
36
|
+
- run: pip install build && python -m build
|
|
37
|
+
- uses: actions/upload-artifact@v4
|
|
38
|
+
with: { name: dist, path: dist/ }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# NOT ACTIVE until this file is at the root of the public repository. Prepared 2026-10-30; the owner activates it by publishing the repository (see the hosting repository's OWNER_ACTIONS).
|
|
2
|
+
stages: [test, build]
|
|
3
|
+
|
|
4
|
+
default:
|
|
5
|
+
image: python:3.12-slim
|
|
6
|
+
before_script:
|
|
7
|
+
- python -m pip install --upgrade pip
|
|
8
|
+
- pip install -e ".[test]"
|
|
9
|
+
|
|
10
|
+
test:
|
|
11
|
+
stage: test
|
|
12
|
+
parallel:
|
|
13
|
+
matrix:
|
|
14
|
+
- PYVER: ["3.10", "3.11", "3.12"]
|
|
15
|
+
image: python:$PYVER-slim
|
|
16
|
+
script:
|
|
17
|
+
- pytest
|
|
18
|
+
|
|
19
|
+
generated-files-are-current:
|
|
20
|
+
stage: test
|
|
21
|
+
script:
|
|
22
|
+
- python tools/gen_catalogue.py --check
|
|
23
|
+
- python bench/make_tasks.py --check
|
|
24
|
+
|
|
25
|
+
secret-scan:
|
|
26
|
+
stage: test
|
|
27
|
+
script:
|
|
28
|
+
- pip install detect-secrets==1.5.0
|
|
29
|
+
- detect-secrets scan --exclude-files 'src/casper_astro_tools/data/fixtures/.*' > /tmp/secrets.json
|
|
30
|
+
- python -c "import json,sys; d=json.load(open('/tmp/secrets.json')); n=sum(len(v) for v in d['results'].values()); print('findings:', n); sys.exit(1 if n else 0)"
|
|
31
|
+
|
|
32
|
+
oracle-baseline:
|
|
33
|
+
stage: test
|
|
34
|
+
script:
|
|
35
|
+
- casper-astro-tools bench oracle --out oracle.json
|
|
36
|
+
artifacts:
|
|
37
|
+
paths: [oracle.json]
|
|
38
|
+
expire_in: 30 days
|
|
39
|
+
|
|
40
|
+
wheel:
|
|
41
|
+
stage: build
|
|
42
|
+
script:
|
|
43
|
+
- pip install build
|
|
44
|
+
- python -m build
|
|
45
|
+
artifacts:
|
|
46
|
+
paths: [dist/]
|
|
47
|
+
rules:
|
|
48
|
+
- if: $CI_COMMIT_TAG
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (unreleased; prepared 2026-10-30)
|
|
4
|
+
|
|
5
|
+
First public-ready version. Named CASPER Astro Tools to keep it with CASPER; copyright holder CAMCEAD, Institute of Astronomy, University of Cambridge (2026), Apache-2.0; seven authors recorded in CITATION.cff and pyproject.toml.
|
|
6
|
+
|
|
7
|
+
* 46 read-only tools: 17 offline calculators, 10 literature tools (NASA ADS, arXiv), 19 archive tools (CDS, NED, Gaia, VO TAP, archive searches).
|
|
8
|
+
* Python API (`call`, `acall`, `list_tools`), the `casper-astro-tools` command (`list`, `describe`, `call`, `serve`, `doctor`, `bench`) and an MCP server over stdio and Streamable HTTP.
|
|
9
|
+
* Generated tool catalogue (`docs/catalogue`, `docs/tools.json`) with example calls and outputs; a test fails when it drifts from the code.
|
|
10
|
+
* Offline mode: recorded answers of the public services under `src/casper_astro_tools/data/fixtures` replay without a network (tests, catalogue, case study, benchmark).
|
|
11
|
+
* Case study (`examples/CASE_STUDY.md`, `examples/case_study.py`) with a model-agnostic tool-calling loop (`casper_astro_tools.agent`).
|
|
12
|
+
* CASPER AstroToolBench v0.1: 73 offline tasks (25 single-tool, 24 multi-tool, 24 tool-selection among distractors), 8 live tasks kept separate, a scoring harness for any OpenAI-compatible endpoint, any MCP server or an answers file, and the deterministic oracle baseline.
|
|
13
|
+
|
|
14
|
+
Differences from the tool servers this code was adapted from: no authentication or per-person policy layer (a hosting platform adds those); `astro_fov_check` takes an explicit `radius_deg` instead of instrument presets; the link-only archive entries were dropped; every user-visible string was made neutral; environment variables are `CASPER_ASTRO_TOOLS_*` and `ADS_API_TOKEN`.
|
|
15
|
+
|
|
16
|
+
Fixed while preparing: the command line turned an arXiv identifier such as `2509.23426` into a number (arguments are now read according to the tool schema).
|
|
17
|
+
|
|
18
|
+
Acknowledgements and recordings (2026-10-31): `docs/ACKNOWLEDGEMENTS.md`, NOTICE and README carry the acknowledgement and terms of the services; the recorded fixtures are shortened to excerpts (abstracts to 500 characters, pictures to their first bytes, error pages cut) and marked with `_meta` (services, date); `tests/test_fixture_marks.py` enforces the mark. Nothing was published before this version, so the names (distribution `casper-astro-tools`, import `casper_astro_tools`, command `casper-astro-tools`, variables `CASPER_ASTRO_TOOLS_*`) have no compatibility aliases.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use CASPER Astro Tools or CASPER AstroToolBench, please cite it as below. The DOI is added when the release is archived."
|
|
3
|
+
title: "CASPER Astro Tools: open astronomy tools for AI agents and scripts"
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
date-released: "2026-10-30" # set to the real release date when tagging
|
|
6
|
+
license: Apache-2.0
|
|
7
|
+
type: software
|
|
8
|
+
# ORCID iDs can be added to each author as orcid: "https://orcid.org/0000-0000-0000-0000"
|
|
9
|
+
authors:
|
|
10
|
+
- family-names: "Molaeinezhad" # first and corresponding author
|
|
11
|
+
given-names: "Alireza"
|
|
12
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
13
|
+
- family-names: "Walton"
|
|
14
|
+
given-names: "Nicholas"
|
|
15
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
16
|
+
- family-names: "Riello"
|
|
17
|
+
given-names: "Marco"
|
|
18
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
19
|
+
- family-names: "González Solares"
|
|
20
|
+
given-names: "Eduardo"
|
|
21
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
22
|
+
- family-names: "Smith"
|
|
23
|
+
given-names: "Leigh"
|
|
24
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
25
|
+
- family-names: "D'Ago"
|
|
26
|
+
given-names: "Giuseppe"
|
|
27
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
28
|
+
- family-names: "Homan"
|
|
29
|
+
given-names: "David"
|
|
30
|
+
affiliation: "Institute of Astronomy, University of Cambridge"
|
|
31
|
+
# doi: "10.5281/zenodo.XXXXXXX" # add after the archive (Zenodo) record exists
|
|
32
|
+
repository-code: "https://gitlab.developers.cam.ac.uk/astronomy/camcead/casper-astro-tools"
|
|
33
|
+
keywords: [astronomy, MCP, tool use, benchmark, LLM agents, CASPER]
|
|
34
|
+
abstract: "A standalone, read-only toolkit of 46 astronomy tools (literature, public archives, offline calculators) exposed as a Python API, a command line and a Model Context Protocol server, with a generated tool catalogue and a seed benchmark (CASPER AstroToolBench) for tool-using language models. It is the open, public part of CASPER, the assistant platform of CAMCEAD at the Institute of Astronomy, University of Cambridge."
|
|
35
|
+
references:
|
|
36
|
+
- type: article
|
|
37
|
+
authors:
|
|
38
|
+
- family-names: "Gao"
|
|
39
|
+
given-names: "Shanghua"
|
|
40
|
+
- name: "et al. (11 authors on arXiv; complete the list from the record before publishing)"
|
|
41
|
+
title: "ToolUniverse: An open platform for democratizing AI scientists"
|
|
42
|
+
year: 2025
|
|
43
|
+
notes: "arXiv:2509.23426 (title and first author as returned by the arXiv API on 2026-10-30). Cited as related work."
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
* `pip install -e .[test]` and `pytest` (no network needed).
|
|
4
|
+
* A tool is added in one place, `src/casper_astro_tools/registry.py` (calculators and literature) or `src/casper_astro_tools/archives/specs.py` plus `archives/core.py` (archives). Give it a description with an example, an input schema with descriptions, examples that run, and a test against a known value or a recording.
|
|
5
|
+
* Run `python tools/gen_catalogue.py` after any change to a tool; commit the regenerated `docs/`. Run `python bench/make_tasks.py` if you change a benchmark task.
|
|
6
|
+
* New archive hosts go into `archives/services.py` only (https, port 443). New recordings: `python tools/record_fixtures.py` and review the diff (public data only, no credentials; the recorder cuts and marks the file, and `tests/test_fixture_marks.py` fails for a fixture without its mark of service and date).
|
|
7
|
+
* The package is part of CASPER by name but must stay free of the host's operational detail (project names, hosts, paths, accounts, secrets): `tests/test_hygiene.py` enforces it.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
include LICENSE NOTICE README.md CHANGELOG.md CITATION.cff SECURITY.md CONTRIBUTING.md .gitignore .gitlab-ci.yml
|
|
2
|
+
recursive-include docs *
|
|
3
|
+
recursive-include examples *
|
|
4
|
+
recursive-include bench *
|
|
5
|
+
recursive-include tools *.py
|
|
6
|
+
recursive-include tests *.py *.json *.xml
|
|
7
|
+
recursive-include .github *.yml
|
|
8
|
+
prune **/__pycache__
|
|
9
|
+
global-exclude *.pyc
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
CASPER Astro Tools
|
|
2
|
+
Copyright 2026 CAMCEAD, Institute of Astronomy, University of Cambridge
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
CASPER Astro Tools is the open, public part of CASPER, the assistant platform of CAMCEAD at the
|
|
7
|
+
Institute of Astronomy, University of Cambridge. It contains code adapted from astronomy tool servers
|
|
8
|
+
developed at the Institute of Astronomy, released here under the Apache License 2.0.
|
|
9
|
+
|
|
10
|
+
Third-party services and data
|
|
11
|
+
-----------------------------
|
|
12
|
+
The package is a client of public services: NASA ADS, arXiv, CDS (SIMBAD, VizieR, Sesame, X-Match,
|
|
13
|
+
hips2fits), NED, IRSA, ESA Gaia, MAST, ESO, HEASARC, CADC, ALMA, SDSS, NOIRLab Astro Data Lab and the
|
|
14
|
+
IVOA registry. Their data and terms are theirs. If you publish results obtained through this package,
|
|
15
|
+
acknowledge the services you used as each of them asks; the acknowledgement sentences, citations and
|
|
16
|
+
the terms are in docs/ACKNOWLEDGEMENTS.md and docs/DATA_AND_TERMS.md. In short:
|
|
17
|
+
|
|
18
|
+
* This research has made use of the SIMBAD database, operated at CDS, Strasbourg, France.
|
|
19
|
+
* This research has made use of the VizieR catalogue access tool, CDS, Strasbourg, France
|
|
20
|
+
(DOI: 10.26093/cds/vizier).
|
|
21
|
+
* This research has made use of the NASA/IPAC Extragalactic Database (NED), which is funded by the
|
|
22
|
+
National Aeronautics and Space Administration and operated by the California Institute of Technology.
|
|
23
|
+
* This work has made use of data from the European Space Agency (ESA) mission Gaia
|
|
24
|
+
(https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and Analysis Consortium
|
|
25
|
+
(DPAC, https://www.cosmos.esa.int/web/gaia/dpac/consortium).
|
|
26
|
+
* This research has made use of NASA's Astrophysics Data System Bibliographic Services.
|
|
27
|
+
* This research made use of Astropy (http://www.astropy.org), a community-developed core Python
|
|
28
|
+
package for Astronomy (Astropy Collaboration, 2013, 2018, 2022).
|
|
29
|
+
* arXiv, Sesame, X-Match, hips2fits and the Virtual Observatory: see docs/ACKNOWLEDGEMENTS.md
|
|
30
|
+
(reviewed and accepted by the authors on 2026-11-01; where a service publishes different wording, use the service's).
|
|
31
|
+
|
|
32
|
+
Recorded excerpts
|
|
33
|
+
-----------------
|
|
34
|
+
The files under src/casper_astro_tools/data/fixtures are short excerpts of answers of the public
|
|
35
|
+
services, recorded read-only on the date written in each file's "_meta" mark and kept for tests,
|
|
36
|
+
documentation and offline replay. The content belongs to the services. NASA ADS content is NOT
|
|
37
|
+
redistributed: the ADS examples are invented stand-ins labelled "[synthetic]". The files under
|
|
38
|
+
tests/fixtures are hand-written, synthetic and marked as such.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: casper-astro-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open astronomy tools for AI agents and scripts: NASA ADS and arXiv, SIMBAD/NED/VizieR/Gaia and VO archives, and offline coordinate, time, unit, cosmology and observing calculators, as a Python library, a command line and an MCP server.
|
|
5
|
+
Author: Alireza Molaeinezhad, Nicholas Walton, Marco Riello, Eduardo González Solares, Leigh Smith, Giuseppe D'Ago, David Homan
|
|
6
|
+
Maintainer: Alireza Molaeinezhad
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://gitlab.developers.cam.ac.uk/astronomy/camcead/casper-astro-tools
|
|
9
|
+
Project-URL: Repository, https://gitlab.developers.cam.ac.uk/astronomy/camcead/casper-astro-tools
|
|
10
|
+
Project-URL: Issues, https://gitlab.developers.cam.ac.uk/astronomy/camcead/casper-astro-tools/-/issues
|
|
11
|
+
Keywords: CASPER,astronomy,mcp,model-context-protocol,llm-tools,astropy,ads,arxiv,virtual-observatory,benchmark
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
License-File: NOTICE
|
|
21
|
+
Requires-Dist: astropy<9,>=7.0
|
|
22
|
+
Requires-Dist: numpy>=1.26
|
|
23
|
+
Requires-Dist: scipy>=1.11
|
|
24
|
+
Requires-Dist: httpx<1,>=0.27
|
|
25
|
+
Requires-Dist: defusedxml>=0.7.1
|
|
26
|
+
Requires-Dist: mcp<3,>=2.3
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# CASPER Astro Tools (`casper-astro-tools`)
|
|
32
|
+
|
|
33
|
+
**Open astronomy tools for AI agents and scripts.** The open, public part of CASPER, the assistant platform of CAMCEAD at the Institute of Astronomy, University of Cambridge.
|
|
34
|
+
|
|
35
|
+
46 read-only tools behind one calling protocol, usable as a Python library, a command line and a [Model Context Protocol](https://modelcontextprotocol.io) server (stdio and Streamable HTTP), with any model that can call functions:
|
|
36
|
+
|
|
37
|
+
| group | tools | needs |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| **Offline calculators** (17) | coordinate frames, proper motion, separation; time scales, sidereal time, barycentric corrections; units, magnitudes and fluxes, redshift and distance in a chosen cosmology, extinction law, spectral lines; observing sites, night timeline, target visibility and airmass, best nights, field-of-view membership | nothing, no network |
|
|
40
|
+
| **Literature** (10) | NASA ADS (search, one paper, references, citations, an object's literature, libraries) and arXiv (search, recent, one paper), with provenance on every result | arXiv: nothing. ADS: your own token in `ADS_API_TOKEN` |
|
|
41
|
+
| **Public archives** (19) | name resolution (CDS Sesame), SIMBAD, NED, VizieR, CDS cross-match, Gaia DR3, any Virtual Observatory TAP service and the VO registry, a table-driven search of SDSS, Pan-STARRS, Legacy Surveys, DESI, MAST, ESO, IRSA, HEASARC, CADC and ALMA, sky cut-out links | nothing; the public services must be reachable |
|
|
42
|
+
|
|
43
|
+
The [tool catalogue](docs/catalogue/index.md) has one page per tool (description, input schema, example call, example output); [`docs/tools.json`](docs/tools.json) is the same in machine-readable form. Both are generated from the code and a test fails if they drift.
|
|
44
|
+
|
|
45
|
+
Also in this repository: a [worked case study](examples/CASE_STUDY.md) (plan a night at La Palma, check proper motions, find the key papers; runs offline), and **CASPER AstroToolBench**, a seed benchmark of 73 offline tasks with checkable answers for models that use these tools ([bench/README.md](bench/README.md)).
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install casper-astro-tools # from PyPI once released; until then: pip install .
|
|
51
|
+
casper-astro-tools doctor # checks the installation (no network)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Python 3.10 or newer (tested on 3.11). Dependencies: astropy, numpy, scipy, httpx, defusedxml, mcp.
|
|
55
|
+
|
|
56
|
+
## Use it
|
|
57
|
+
|
|
58
|
+
**Python**
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import casper_astro_tools as at
|
|
62
|
+
|
|
63
|
+
at.call("astro_convert_coordinates", lon="18h36m56.3364s", lat="+38:47:01.291", to_frame="galactic")["output"]["l_deg"] # 67.448...
|
|
64
|
+
at.call("astro_cosmology", redshifts=[0.5])["results"][0]["luminosity_distance_mpc"] # Planck18
|
|
65
|
+
at.call("gaia_source", source_id="4472832130942575872") # needs the network
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Every call returns a dict: `{"ok": true, ...}` or `{"ok": false, "error": "<code>", "message": "..."}`. Inside a running event loop use `await at.acall(...)`.
|
|
69
|
+
|
|
70
|
+
**Command line**
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
casper-astro-tools list # the tools
|
|
74
|
+
casper-astro-tools describe astro_night_info # schema and examples of one tool
|
|
75
|
+
casper-astro-tools call astro_night_info date=2026-11-12 site=wht
|
|
76
|
+
casper-astro-tools call resolve_name name="M 51" --offline # answer from the bundled recordings, no network
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**MCP server** (Claude Desktop, Claude Code, any MCP client)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
casper-astro-tools serve # stdio
|
|
83
|
+
casper-astro-tools serve --http --port 8765 # Streamable HTTP at http://127.0.0.1:8765/mcp
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{ "mcpServers": { "casper-astro-tools": { "command": "casper-astro-tools", "args": ["serve"], "env": { "ADS_API_TOKEN": "your-ads-token" } } } }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Every tool is annotated read-only; the literature and archive tools are marked "open world" (they contact a public service), the calculators are not.
|
|
91
|
+
|
|
92
|
+
## Settings (environment variables, all optional)
|
|
93
|
+
|
|
94
|
+
| variable | meaning |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `ADS_API_TOKEN` or `ADS_API_TOKEN_FILE` | your NASA ADS token ([create one](https://ui.adsabs.harvard.edu/user/settings/token)). Without it the ADS tools answer `ads_not_configured`; arXiv and the archives work. The token is never an argument, a result, a log line or an error. |
|
|
97
|
+
| `CASPER_ASTRO_TOOLS_CONTACT` | an e-mail address or URL added to the User-Agent sent to the public services (good manners for ADS, arXiv and the archives) |
|
|
98
|
+
| `CASPER_ASTRO_TOOLS_GROUPS` | which groups to offer: `calculators,literature,archives` (default all). `calculators` gives a server that never touches the network. |
|
|
99
|
+
| `CASPER_ASTRO_TOOLS_NETWORK=0` | refuse every tool that would contact a public service |
|
|
100
|
+
| `CASPER_ASTRO_TOOLS_ARCHIVE_RATE` | archive calls allowed per ten minutes (default 60) |
|
|
101
|
+
|
|
102
|
+
## What it does to be safe to give to a model
|
|
103
|
+
|
|
104
|
+
* **Read-only.** No tool writes, uploads, runs code or changes anything anywhere. ADQL queries must be a single `SELECT` (no comments, no semicolon, no write or sleep words outside quotes); `TOP` and `MAXREC` are forced to the row cap (500).
|
|
105
|
+
* **Allow-listed hosts.** The archive tools only contact hosts listed in `src/casper_astro_tools/archives/services.py` (https, port 443, no IP literals, every resolved address must be public; redirects are followed by hand and re-checked). A host found by a registry search is accepted for one hour in that process; no environment variable widens the list.
|
|
106
|
+
* **Bounded.** Row, byte, time and size caps on every call; arXiv is queued to one request per three seconds; ADS to 60 calls a minute.
|
|
107
|
+
* **Untrusted data is labelled.** Archive and literature results carry their provenance (service, address, query, time) and a notice that the content is third-party data, not instructions.
|
|
108
|
+
* **Offline by construction.** The calculators force astropy offline: nothing is downloaded, ever.
|
|
109
|
+
|
|
110
|
+
The HTTP server has **no login**: it binds to localhost. Put your own authenticating proxy in front before exposing it. See [SECURITY.md](SECURITY.md).
|
|
111
|
+
|
|
112
|
+
## Known limitations
|
|
113
|
+
|
|
114
|
+
* The hours-above-altitude figures count a 5-minute grid including both ends of the window, so they can exceed the true duration by one grid step (0.08 h).
|
|
115
|
+
* No dust map: `astro_extinction_law` takes E(B-V) from you. Cosmology distances ignore radiation (a 0.02 % effect at z = 0.5) and `absolute_magnitude_no_k_correction` has no K-correction by name.
|
|
116
|
+
* The Earth-orientation table is the one inside astropy; it is never refreshed over the network.
|
|
117
|
+
* Archive answers change when the archives do. The recordings under `src/casper_astro_tools/data/fixtures` are snapshots (archives 2026-10-22, arXiv and Gaia 2026-10-30), kept for tests and for the offline mode; the CDS services were unreachable from the recording host on 2026-10-30, so their snapshot is the older one.
|
|
118
|
+
* No ADS answer is recorded (ADS needs a personal token): the ADS examples in the catalogue come from an invented stand-in and say so on the page.
|
|
119
|
+
|
|
120
|
+
## Tests, regenerating the docs
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pip install -e .[test]
|
|
124
|
+
pytest # no network; about 40 s
|
|
125
|
+
python tools/gen_catalogue.py # regenerate docs/catalogue and docs/tools.json (the test suite fails if you forget)
|
|
126
|
+
python bench/make_tasks.py # regenerate the benchmark task files
|
|
127
|
+
python tools/record_fixtures.py out.json # re-record the public-service answers (network; read-only)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Authors, citing, licence
|
|
131
|
+
|
|
132
|
+
Authors (all at the Institute of Astronomy, University of Cambridge; the first is the corresponding author): Alireza Molaeinezhad, Nicholas Walton, Marco Riello, Eduardo González Solares, Leigh Smith, Giuseppe D'Ago, David Homan.
|
|
133
|
+
|
|
134
|
+
Copyright 2026 CAMCEAD, Institute of Astronomy, University of Cambridge. Apache-2.0 ([LICENSE](LICENSE), [NOTICE](NOTICE)). Please cite via [CITATION.cff](CITATION.cff) (GitHub and GitLab render it as "Cite this repository"); until a software DOI exists, cite as:
|
|
135
|
+
|
|
136
|
+
> Molaeinezhad, A., Walton, N., Riello, M., González Solares, E., Smith, L., D'Ago, G., Homan, D. (2026). *CASPER Astro Tools: open astronomy tools for AI agents and scripts* (version 0.1.0) [Computer software]. Institute of Astronomy, University of Cambridge.
|
|
137
|
+
|
|
138
|
+
Security reports: see [SECURITY.md](SECURITY.md).
|
|
139
|
+
|
|
140
|
+
Related work: [ToolUniverse](https://arxiv.org/abs/2509.23426) (an open platform of biomedical tools behind one protocol). This package is a small, astronomy-specific, read-only counterpart; see [docs/DESIGN.md](docs/DESIGN.md) for how the two differ.
|
|
141
|
+
|
|
142
|
+
## Acknowledgements
|
|
143
|
+
|
|
144
|
+
This package is a client of public services and of open software. If you publish results obtained with it, please acknowledge what you used; the full sentences, citations and terms are in [docs/ACKNOWLEDGEMENTS.md](docs/ACKNOWLEDGEMENTS.md) (reviewed and accepted by the authors on 2026-11-01; where a service publishes different wording, use the service's). In short:
|
|
145
|
+
|
|
146
|
+
* *This research has made use of the SIMBAD database, operated at CDS, Strasbourg, France.* (Wenger et al. 2000, A&AS 143, 9)
|
|
147
|
+
* *This research has made use of the VizieR catalogue access tool, CDS, Strasbourg, France (DOI: 10.26093/cds/vizier).* (Ochsenbein et al. 2000, A&AS 143, 23)
|
|
148
|
+
* *This research has made use of the NASA/IPAC Extragalactic Database (NED), which is funded by the National Aeronautics and Space Administration and operated by the California Institute of Technology.*
|
|
149
|
+
* *This work has made use of data from the European Space Agency (ESA) mission Gaia (https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and Analysis Consortium (DPAC, https://www.cosmos.esa.int/web/gaia/dpac/consortium).* (Gaia Collaboration 2016, 2023)
|
|
150
|
+
* *This research has made use of NASA's Astrophysics Data System Bibliographic Services.* ADS content is not redistributed by this package; the ADS examples are labelled stand-ins.
|
|
151
|
+
* *This research made use of Astropy (http://www.astropy.org), a community-developed core Python package for Astronomy (Astropy Collaboration, 2013, 2018, 2022).*
|
|
152
|
+
* arXiv: the API terms (one request per three seconds) are followed by the client; the arXiv metadata excerpts are shipped under arXiv's CC0 statement for metadata. Sesame, the CDS cross-match, hips2fits and the Virtual Observatory: see the acknowledgements page.
|
|
153
|
+
|
|
154
|
+
The short recorded excerpts of public answers under `src/casper_astro_tools/data/fixtures` each carry a mark naming the service and the date; see [NOTICE](NOTICE).
|