ExtraMojo is a collection of things that aren’t available in the standard library.
Changes
This release makes ExtraMojo compatible with Mojo 25.1, and brings a bunch of new features (see links for docs and examples):
- BufferedReader / BufferedWriter - classic buffered file IO
- DelimReader / DelimWriter - Reader/Writer for CSVs/TSVs
- OptParser - A simple cli arg parser loosely based on argparser (long opts only)
- ReservoirSampler - subsample from a stream of uknown size (more stats related functionality coming)
Docs and examples can be found here: ExtraMojo
Docs created with the excellent modo tool.
Install and Usage
Add https://repo.prefix.dev/modular-community
to your project channels:
# mojoproject.toml or pixi.toml
[project]
channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/modular-community"]
description = "Add a short description here"
name = "my-mojo-project"
platforms = ["osx-arm64"]
version = "0.1.0"
[tasks]
[dependencies]
max = ">=25.1.0,<26"
then run:
magic add ExtraMojo