Skip to content

Commit

Permalink
fix bad rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Sep 7, 2023
1 parent f3e948a commit 46959b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dune_client/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import annotations

import logging.config
import os
from json import JSONDecodeError
from typing import Dict, Optional, Any

Expand All @@ -32,6 +33,15 @@ def __init__(
self.logger = logging.getLogger(__name__)
logging.basicConfig(format="%(asctime)s %(levelname)s %(name)s %(message)s")

@classmethod
def from_env(cls) -> BaseDuneClient:
"""
Constructor allowing user to instantiate a client from environment variable
without having to import dotenv or os manually
We use `DUNE_API_KEY` as the environment variable that holds the API key.
"""
return cls(os.environ["DUNE_API_KEY"])

@property
def api_version(self) -> str:
"""Returns client version string"""
Expand Down

0 comments on commit 46959b7

Please sign in to comment.