FeatureRegistries.jl is a Julia package to create registries of a package’s features, letting package users discover and use them more easily. FeatureRegistries.jl lets you create tables that list package features so that

  • users can explore and discover features,
  • users can search features through a consistent interface; and
  • developers of third-party packages can transparently add functionality


Package users

Package users of packages can use registries through:

  • find/filter/findfirst to subset the list of features based on filters,
  • info(registry) to get more information on a specific registry,
  • registry[id] to inspect an entry in a registry,
  • load(registry) to access a feature

See also how to use registries.

Package developers

Developers can create registries using Registry and Field, push!(registry).

struct Field(T, name; kwargs...)

A field defines what data will be stored in one column of a Registry.

Keyword arguments

  • description::String = "": More information on the field contents and how they can be used. May contain Markdown formatting.
  • optional = false: Whether a registry entry can be entered without alue in this field.
  • default = missing: The default value used if optional === true. If a non-missing value is passed, the value of optional is ignored and the field is treated as optional.
  • defaultfn = (row, key) -> default: Function to compute dynamically compute a default value from an entry. If passed, the value of default is ignored.


A simple Field with entries of type String:

Field(String, "My Field")
Registry(fields; kwargs...)

Create a feature registry with columns of Fields.

Keyword arguments

  • name::String: A descriptive name.
  • fields::NamedTuple:
  • description::String = "": Description text for the registry. Shown when info(registry) is called.
  • loadfn = identity: Function to apply over a row when load is called. For example, calling load(registry["id"]) will call loadfn.
struct RegistryEntry(row, registry)

An entry in a feature registry registry with values row. Returned when indexing into a FeatureRegistry, i.e. registry[id].


Create a Registry of mathematical functions for testing purposes.



using FeatureRegistries
registry = FeatureRegistries.exampleregistry()
find(registry, [; col = filter, ...])

Find entries in a registry that match a set of filters given as keyword arguments. The keyword name must correspond to a field in registry, while the value is a filter that is checked against each field value.

See how to use registries for examples.


Show information about a registry, specifically its name, description and fields.



using FeatureRegistries: exampleregistry, info
registry = exampleregistry()

Load a feature represented by a registry entry. The behavior depends on the Registry.

FeatureRegistries.runtests(pattern...; kwargs...)

Equivalent to ReTest.retest(FeatureRegistries, pattern...; kwargs...). This function is defined automatically in any module containing a @testset, possibly nested within submodules.


Ensure that a string is shown with double quotes.

```julia-repl julia> string_format("hi") ""hi""