inferred_env_varcan now infer additional parameter data from theEnvannotation metadata.SchemaEnvVarscan now be initialized withargs=...to use all keyword arguments withEnvannotations as arguments.
- Fixed type annotations for
LookupParser.case_insensitive
- added
AbsoluteNameto create env vars with names that never have a prefix
- fixed code snippets around documentation
envolvedno longer supports python 3.7
FindIterCollectionParserwith_prefixcan now override many of an env-var's parameters
CollectionParser'sopenerandcloserarguments now correctly handle matches that would be split by the delimiterCollectionParser'scloserargument now correctly handles overlapping matchesCollectionParser'scloserargument is now faster when using non-regex matchesCollectionParser.pair_wise_delimitedwill now be more memory efficient when using a mappingvalue_type
- fixed some documentation typos
- this is the last release to support python 3.7
BoolParseris now a subclass ofLookupParser
- environment sys-hooks can now handle invalid arguments gracefully
- update formatter to ruff 0.3.0
- unittests now automatically run on all supported platforms
- using sluth for documentation
- single-environment variable can now be given additional arguments, that are passed to the parser.
- env-var defaults can now be wrapped in a
Factoryto allow for a default Factory.
- type annotation correctness is no longer supported for python 3.7
- Fixed some typos in the documentation
- The children of envvars that are excluded from the description are now also excluded.
- new argument
strip_itemsforCollectionParser. - new arguments
strip_keysandstrip_valuesforCollectionParser.pairwise_delimited. missing,as_default,no_patch, anddiscardconsts are now available in theenvolvednamespace.- envvar descriptions can now also be a sequence of strings to denote multiple paragraphs.
- many new options for describing env vars
- inferred env vars can now be used for parameters that don't have a type hint, so long as the default and type are provided.
- the default
case_sensitivevalue forinferred_env_vars is nowFalseinstead ofTrue. - envvars create with
with_prefixare now correctly added to the description - calling
describe_env_varswithout any envvars defined no longer raises an error
- changed documentation theme with furo
- usage of the
basevarandinfer_env_varmodules is deprecated - usage of the
envvarfunction to create inferred envvars is deprecated
- changed type of
argsto be an invariantMappinginstead of adict
- fixed type hint for auto-typed env vars.
- Single env vars can now accept pydantic models and type adapters, they will be parsed as jsons.
- added
py.typedfile to the package. - added
inferred_env_varto the rootenvolvednamespace. - schema env vars can now have keyword arguments passed to their
getmethod, to add values to the schema. - new parse:
LookupParser, as a faster alternative toMatchParser(that does not support regex matches).
- the special parser of
Enums is nowLookupParserinstead ofMatchParser.
exclude_from_descriptionnow ignores inferred env vars.
inferred_env_varto explicitly infer the type, name and default value of an env var.pos_argsto allow for positional arguments in a schema.discarddefault value for schema args, which discards an argument from the schema if the value is missing.MatchParserto return values from discrete matches. This is now the default parser for Mappings and Enums.Optionals can now be used as parsers- added official support for python 3.11 and 3.12
- auto-typed env vars are deprecated, use
infer_env_varinstead.
- fixed possible race condition when reloading the environment parser, causing multiple reloads.
- significantly improved performance for case-insensitive env var repeat retrieval.
- use ruff + black for formatting
This release is a complete overhaul of the project. Refer to the documentation for details.
- Partial Schema error is no longer triggered from default members
- Env Vars no longer default to case sensitive if not uppercase.
- Env vars can now be supplied with
prefix_capture, causing them to become a prefix env var. - all env vars can now be supplied with the optional
descriptionkeyword argument. describe_env_varsto make a best-effort attempt to describe all the environment variables defined.raise_for_partialparameter for schema vars, to not accept partially filled schemas, regardless of default value.
- The caching mechanism from basic vars has been removed
env_parser.reload- the parser is now self-updating!MappingEnvVar- useSchema(dict, ...)instead- The same envvar cannot be used twice in the same schema anymore
- The environment parsing is now self-updating, no more need to manually reload the environment when testing.
- When manifesting
EnvVars, additional keyword arguments can be provided. - When creating a schema, you can now omit the factory type to just use a
SimpleNamespace. - Validators can now be used inside a schema class.
- Validators can now be static methods.
- EnvVar children can now overwrite template parameters.
- EnvVar template can be without a name.
BoolParser's parameters now all have default values.
- Inner variables without a default value would act as though given a default value.
- If the variadic annotation of
__new__and__init__would disagree, we would have__new__'s win out, this has been corrected. EnvVaris now safe to use both as a parent and as a manifest- EnvVar validators now correctly transition to children
- added examples page
- removed recordclasses dependency
- initial release