-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from NationalLibraryOfNorway/feat/dotenv-conf
feat: use python-dotenv for config
- Loading branch information
Showing
4 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NB_DHLAB_BASE_URL = "https://api.nb.no/dhlab" #: REST-API URL adress to fulltext query functions | ||
NB_DHLAB_NGRAM_API = "https://api.nb.no/dhlab/nb_ngram/ngram/query" #: URL adress for API calls to ngram-databases | ||
NB_DHLAB_GALAXY_API = "https://api.nb.no/dhlab/nb_ngram_galaxies/galaxies/query" #: URL adress for word galaxy API queries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
"""Constant variables used across modules.""" | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
BASE_URL = "https://api.nb.no/dhlab" #: REST-API URL adress to fulltext query functions | ||
NGRAM_API = "https://api.nb.no/dhlab/nb_ngram/ngram/query" #: URL adress for API calls to ngram-databases | ||
GALAXY_API = "https://api.nb.no/dhlab/nb_ngram_galaxies/galaxies/query" #: URL adress for word galaxy API queries | ||
load_dotenv("dhlab.env") # take environment variables | ||
|
||
"""Constant variables used across modules, change in dhlab.env or through environment variable""" | ||
|
||
BASE_URL = os.getenv("NB_DHLAB_BASE_URL") #: REST-API URL adress to fulltext query functions | ||
NGRAM_API = os.getenv("NB_DHLAB_NGRAM_API") #: URL adress for API calls to ngram-databases | ||
GALAXY_API = os.getenv("NB_DHLAB_GALAXY_API") #: URL adress for word galaxy API queries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters