Skip to content

Faster way to query all CTAN package data #51

Description

@muzimuzhi

CTAN only provides API to query data for a single package: https://ctan.org/help/json/2.0/pkg.

This means to find all possible CTAN-to-TL package name mappings, the packages/data/scripts/generate-namemap.ts script has to query >2000 times in a cold run, making it slow (>10min). Warm run would get wrong results, because we don't know if any existing mappings would change.

I guess there is some non-public way to get such data as a whole. Maybe https://texlive.info/ already provides such way, but as of writing, this site is down.


Currently packages/data/scripts/generate-namemap.ts stores three caches under packages/data/build:

  • ctan-packages.json for list of CTAN packages names, returned by a query to https://ctan.org/help/json/2.0/packages
  • ctan-packages.jsonl for list of CTAN package data, by combining results of >2000 queries to https://ctan.org/help/json/2.0/pkg/<pkgname>
  • tlpdb.json for tlpdb

ctan-packages.jsonl is the only bottleneck.

The subdir packages/data/build is excluded from Git, due to a .gitignore in it, created by generate-namemap.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions