MCPcopy Index your code
hub / github.com/theskumar/python-dotenv / get

Function get

src/dotenv/cli.py:137–148  ·  view source on GitHub ↗

Retrieve the value for the given key.

(ctx: click.Context, key: Any)

Source from the content-addressed store, hash-verified

135@click.pass_context
136@click.argument("key", required=True)
137def get(ctx: click.Context, key: Any) -> None:
138 """Retrieve the value for the given key."""
139 file = ctx.obj["FILE"]
140
141 with stream_file(file) as stream:
142 values = dotenv_values(stream=stream)
143
144 stored_value = values.get(key)
145 if stored_value:
146 click.echo(stored_value)
147 else:
148 sys.exit(1)
149
150
151@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