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

Function list_values

src/dotenv/cli.py:93–109  ·  view source on GitHub ↗

Display all the stored key/value.

(ctx: click.Context, output_format: str)

Source from the content-addressed store, hash-verified

91 "which displays name=value without quotes.",
92)
93def list_values(ctx: click.Context, output_format: str) -> None:
94 """Display all the stored key/value."""
95 file = ctx.obj["FILE"]
96
97 with stream_file(file) as stream:
98 values = dotenv_values(stream=stream)
99
100 if output_format == "json":
101 click.echo(json.dumps(values, indent=2, sort_keys=True))
102 else:
103 prefix = "export " if output_format == "export" else ""
104 for k in sorted(values):
105 v = values[k]
106 if v is not None:
107 if output_format in ("export", "shell"):
108 v = shlex.quote(v)
109 click.echo(f"{prefix}{k}={v}")
110
111
112@cli.command(name="set")

Callers

nothing calls this directly

Calls 2

stream_fileFunction · 0.85
dotenv_valuesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…