Define environment key-value pairs that can be referenced from within your Napkin function. These values get encrypted automatically when stored. Environment variables provide a more secure, configurable way to store sensitive information needed by your function, like API keys.
To add an environment variable, go to Settings ⚙, then the “Environment Variables” tab. To use environment variables in Python, use the built-in
os.environ object. For example, you can print all environment variables in your function:
import os
print(os.environ)
Improvements: Python Modules
- You can now install any external Python module, including from GitHub using the url prefix “git+” (e.g. git+https://github.com/tweepy/tweepy.git).
- Uninstalling modules now completely uninstalls and re-allocates module storage space.