sloria / environs

simplified environment variable parsing
MIT License
1.21k stars 85 forks source link

Update documentation for env.url() to show how to add non-default URLs #324

Closed ddennerline3 closed 9 months ago

ddennerline3 commented 9 months ago

The URL below produces a validation error. I couldn't find any documentation that showed allow a redis scheme. After analyzing and stepping through the code, I realized there was way to allow non-default schemes.

env.url("REDIS_URL", "redis://redis:6379") <<< fails

env.url("REDIS_URL", "redis://redis:6379", schemes=["redis"], require_tld=False) <<< acceptable

Can the documentation be updated please to show how non-default schemes are possible please?

I believe there are some other URL overrides also.

    def __init__(
        self,
        *,
        relative: bool = False,
        absolute: bool = True,
        schemes: types.StrSequenceOrSet | None = None,
        require_tld: bool = True,
        **kwargs,
    ):