/python-dotenv

Primary LanguagePythonMIT LicenseMIT

Storing Credentials and Configuration Values Securely with a .env File in Python

This tutorial explores various approaches to handle environmental variables and credentials within your scripts. Specifically, we’ll dive into the utilization of the .env file, guiding you on how to create one and demonstrating the development of a Python script leveraging the python-dotenv package for retrieving variables stored in the .env file.

Key Takeaways:

  1. Understanding the .env File: Purpose and Pros/Cons
  • Gain insights into the purpose of a .env file and evaluate the advantages and disadvantages associated with its usage.
  1. Creating a .env File: Step-by-Step Guide
  • Learn the process of creating a .env file, a crucial step in effectively managing environmental variables in your projects.
  1. Python Scripting with python-dotenv: Retrieving Environmental Variables
  • Explore the practical application of the python-dotenv package in writing Python scripts. Understand how to efficiently retrieve and utilize environmental variables within your code.
  1. Call to Action
  • Take the next step in improving your development practices. Implement the knowledge gained to enhance security and streamline environmental variable management in your Python projects. Start leveraging .env files and python-dotenv for a more efficient coding experience.

Prerequisites:

  1. Host Environment:
  • Ensure access to a host system, preferably running Linux or macOS.

  • Install Python version 3.5.x or higher and have pip installed.

  1. Code Editor:
  • Utilize your preferred code editor for efficient script development.
  1. Access Requirements:
  • Gain access to a Cisco CSR 1000V router or use the IOS XE CSR Sandbox in the DevNet Sandbox (requires a developer.cisco.com login).

This tutorial aims to empower you with practical skills to secure and optimize your Python scripts. Let’s embark on this insightful journey!

For more information check out this link : https://medium.com/@sbarissonmez/storing-credentials-and-configuration-values-securely-with-a-env-file-in-python-7f3033885999