MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / get

Function get

src/dotenv/cli.py:111–122  ·  view source on GitHub ↗

Retrieve the value for the given key.

(ctx: click.Context, key: Any)

Source from the content-addressed store, hash-verified

109@click.pass_context
110@click.argument('key', required=True)
111def get(ctx: click.Context, key: Any) -> None:
112 """Retrieve the value for the given key."""
113 file = ctx.obj['FILE']
114
115 with stream_file(file) as stream:
116 values = dotenv_values(stream=stream)
117
118 stored_value = values.get(key)
119 if stored_value:
120 click.echo(stored_value)
121 else:
122 exit(1)
123
124
125@cli.command()

Callers

nothing calls this directly

Calls 3

stream_fileFunction · 0.85
dotenv_valuesFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected