Skip to content

Add date-stamp to json output #615

Open

Description

@zerothi

Is your feature request related to a problem? Please describe.

When I do module av -l I get something like this:

zstd/1.5.7                                                  2025/03/03 11:28:13

with proper date stamp.
However, if i do module av -j I get:

"zstd/1.5.7": { "name": "zstd/1.5.7", "type": "modulefile", "symbols": [], "tags": [], "pathname": "/apps/dcc/etc/ModulesAlma92/modulefiles/zstd/1.5.7"},

Additionally, it might be fun to add variant information to the json output? (digression, should I open a new issue?)

Describe the solution you'd like

It would be great if the json output could also add the date-stamp.

The reason is I plan on using it to hide modules older than some set time, and this just seemed like the simplest extraction method.

Describe alternatives you've considered

Use module av -l however, the problem with this is that some of our module files are extremely long, resulting in:

petsc/3.24.0-oct-2025-gcc-14.3.0-openblas-0.3.30-non-complex-slepc-elemental-superlu2025/10/07 00:42:39

which requires manual parsing.

(side-note:
I also tried to figure out if I could manually format the output in long-mode, however, I couldn't figure out from the documentation how to set the field-widths, is it even possible?
)

Additional context

The installed version is:
Modules Release 5.3.0 (2023-05-14)

AFAIK without any odd configuration setups.

Thanks!

Activity

  1. adrien-cotte commented on Feb 23, 2026

    @adrien-cotte
    Contributor

    Hi @zerothi

    Thank you for your suggestion.
    Adding timestamp and variants to json ouput will increase the response time significantly.
    We need to stat each module file to get the mtime, and evaluate them for the variants.

    Perhaps the right answer would be an option to configure whatever we need in json output.

    Here is the list of configurations we plan to add in v5.7:
    https://modules.readthedocs.io/en/latest/design/output-configuration.html#configuration

    What do you think about something like <cmd>_json_output? (ex: avail_output and avail_json_output)

  2. zerothi commented on Feb 23, 2026

    @zerothi
    Author

    Thanks for your return.

    I think if the --output could be enabled for -json output it would be simpler, because then one can alter the output format using --output arguments. I would prefer this rather than adding new env-vars for controlling output.
    Also, in the link you provide it isn't clear to me which one lists the date-stamp.

    I can see the downside, so the default should definitely prefer swift response times, then configuration can be used where timings are not an issue. So agree there!

  3. adrien-cotte commented on Feb 23, 2026

    @adrien-cotte
    Contributor

    Yep, both could be great I think.
    Add --output support with --json, and avail_json_output config.

  4. added this to the 5.8.0 milestone on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions