diff --git a/.gitignore b/.gitignore index c53b784..027582e 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,5 @@ venv.bak/ .vscode key.json -.ipynb \ No newline at end of file +.ipynb + diff --git a/db.ipynb b/db.ipynb index 0ae9a20..b11c171 100644 --- a/db.ipynb +++ b/db.ipynb @@ -21,28 +21,27 @@ }, { "cell_type": "code", - "execution_count": 21, + "metadata": {}, "outputs": [], "source": [ "from dotenv import load_dotenv\n", "import os\n", "load_dotenv()\n", - "DATABASE_URL = os.getenv('DATABASE_URL')" + + "DATABASE_URL = os.getenv('DATABASE_URL')\n", + "CREDS = os.getenv('CREDS')" ] }, { "cell_type": "code", - "execution_count": 2, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" - ] - }, - "execution_count": 2, + "metadata": {}, "output_type": "execute_result" } @@ -54,28 +53,27 @@ }, { "cell_type": "code", - "execution_count": 3, + "metadata": {}, "outputs": [], "source": [ + "\n", "if not firebase_admin._apps:\n", + " cred = credentials.Certificate(CREDS)\n", " firebase_admin.initialize_app(cred, {\n", - " 'databaseURL': 'https://fantasy-contests-default-rtdb.firebaseio.com/'\n", + " 'databaseURL': DATABASE_URL\n", " })" ] }, { "cell_type": "code", - "execution_count": 4, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" - ] - }, - "execution_count": 4, + "metadata": {}, "output_type": "execute_result" } @@ -84,23 +82,42 @@ "firebase_admin.get_app()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, { "cell_type": "code", - "execution_count": 12, + "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ + "ref = db.reference(\"/2023\")" + ] }, { "cell_type": "code", - "execution_count": 13, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ + "{'Week': 3,\n", " 'contest': 'Most LB Points',\n", " 'contest_results': [{'player1': {'game_played': 100,\n", @@ -158,6 +175,7 @@ ] }, "execution_count": 13, + "metadata": {}, "output_type": "execute_result" } @@ -168,12 +186,13 @@ }, { "cell_type": "code", - "execution_count": 15, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ + "{'-NiFkEYRMyUnxkHJxjMZ': {'Week': 4,\n", " 'contest': 'Most Kicker Points',\n", " 'contest_results': [{'player1': {'game_played': 100,\n", @@ -285,17 +304,20 @@ ] }, "execution_count": 15, + "metadata": {}, "output_type": "execute_result" } ], "source": [ + "db.reference(\"/2023\").get()" + ] }, { "cell_type": "code", - "execution_count": 19, + "metadata": {}, "outputs": [ { @@ -333,6 +355,7 @@ " ]\n", "}\n", "})" + ] } ], diff --git a/fantasy_app/espn_api_submodule/espn_api/base_league.py b/fantasy_app/espn_api_submodule/espn_api/base_league.py index b40f837..f93e7db 100644 --- a/fantasy_app/espn_api_submodule/espn_api/base_league.py +++ b/fantasy_app/espn_api_submodule/espn_api/base_league.py @@ -43,6 +43,7 @@ def _fetch_league(self, SettingsClass=BaseSettings): self.current_week = self.scoringPeriodId if self.scoringPeriodId <= data[ 'status']['finalScoringPeriod'] else data['status']['finalScoringPeriod'] self.settings = SettingsClass(data['settings']) + self.members = data.get('members', []) return data def _fetch_teams(self, data, TeamClass, pro_schedule=None):