And the root-level secrets are also accessible as environment variables:
import os
st.write(
    "Has environment variables been set:",
    os.environ["db_username"] == st.secrets["db_username"],
)
```
You can access st.secrets via attribute notation (e.g. st.secrets.key), in addition to key notation (e.g. st.secrets["key"])—like st.session_state.
You can even use TOML sections to compactly pass multiple secrets as a single attribute.
Consider the following secrets:
toml
[db_credentials]
username = "my_username"
password = "my_password"
Rather than passing each secret as attributes in a function, you can more compactly pass the section to achieve the same result. See the notional code below which uses the secrets above:
```python
Verbose version
my_db.connect(username=st.secrets.db_credentials.username, password=st.secrets.db_credentials.password)
