Elamur: **Mova** · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Groupants](https://md.groupants.elamur.ai/free/en/)

[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/tools/mathlib/)

[home](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [tools](https://md.mova.elamur.ai/free/en/docs/tools/) / mathlib — the maths library catalog and downloads

# mathlib — the maths library catalog and downloads

`mathlib` builds the catalog of open maths papers and textbooks and downloads a bounded, licence-checked selection. How the library is collected and its licence rules: [Data, libraries and licences](https://md.mova.elamur.ai/free/en/docs/repo-docs/data/#mathematics-and-science-library).

## Run

```
cargo build --release -p mathlib
```

| Command | What it does |
| --- | --- |
| `mathlib oai <out-dir> [--set S] [--prefix arXivRaw] [--from YYYY-MM-DD] [--base URL] [--delay-ms 4000] [--max-pages N]` | OAI-PMH ListRecords → `<out-dir>/pNNNNN.xml.gz` and a resumable `state.tsv` |
| `mathlib parse <out.tsv> <oai-dir>...` | arXivRaw records → catalog TSV (id, categories, licence, year, versions, sizes) |
| `mathlib sql <db> <file.sql> [key=value]... [--mode markdown]` | a SQL template (`{key}` → value) through the DuckDB CLI: load, statistics, pilot selection |
| `mathlib fetch <list.tsv> <raw-root> <manifest.jsonl> [--delay-ms 3500] [--max-bytes N] [--file-max N] [--min-free-gb 150] [--expect-pdf] [--compact-src] [--kind paper\|textbook]` | polite download of a list (url, licence) into `<raw-root>/<slug>/`; manifest in the [sources](https://md.mova.elamur.ai/free/en/docs/tools/sources/) format plus sha256 and licence per file |
| `mathlib gcs-list <bucket> <prefix> <out.tsv>` | names and sizes in a public GCS bucket (the arXiv mirror), no download |
| `mathlib books-fetch <catalog-dir> [all\|openstax\|aim\|otl]` | raw pages of open-textbook catalogs |
| `mathlib books-pdf <catalog-dir> <books.tsv>` | look for direct PDFs of books without one → `sites-pdf.tsv` |
| `mathlib books <catalog-dir> <out.tsv>` | offline catalog of open textbooks: licence, topic, level, direct PDF |

## Limits

Downloads stop below the free-space floor and keep to the delays above. Licences are taken from the catalog; the library is for learning and measurement under the rules of [Data and model licences](https://md.mova.elamur.ai/free/en/docs/licence/DATA/).

- [← previous macula](https://md.mova.elamur.ai/free/en/docs/tools/macula/)
- [next → Model registry and groupant inventory](https://md.mova.elamur.ai/free/en/docs/tools/modelcheck/)
- [↑ back to tools](https://md.mova.elamur.ai/free/en/docs/tools/)
