Added load_dotenv

main
Lasse Studion 2 years ago
parent cc537f3c33
commit f9fa32ca82
  1. 11
      arango_ev_class.py

@ -1,8 +1,14 @@
from arango import ArangoClient from arango import ArangoClient
from dotenv import load_dotenv
import os
# Load environment variables from .env file
load_dotenv() # Install with pip install python-dotenv
class ArangoDB: class ArangoDB:
class ArangoEVClass: class ArangoEVClass:
def __init__(self, db_name, username, password): def __init__(self, db_name):
""" """
Initializes an instance of the ArangoEVClass. Initializes an instance of the ArangoEVClass.
@ -11,8 +17,9 @@ class ArangoDB:
username (str): The username for authentication. username (str): The username for authentication.
password (str): The password for authentication. password (str): The password for authentication.
""" """
password = os.getenv("PASSWORD_ARANGO")
self.client = ArangoClient(hosts='https://arango.lasseedfast.se') self.client = ArangoClient(hosts='https://arango.lasseedfast.se')
self.db = self.client.db(db_name, username=username, password=password) self.db = self.client.db(db_name, username='dataharvest', password=password)
def all_ev_speeches(self): def all_ev_speeches(self):

Loading…
Cancel
Save