109 lines
2.1 KiB
Plaintext
109 lines
2.1 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"id": "ab869d03-ed90-4c48-affe-02eb74938022",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"/home/changcl/apps/jupyter/notebook\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"import os\n",
|
|
"print(os.getcwd())"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "10f377d9-24ec-4d64-8dd5-2cfbe14a0245",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# /home/changcl/apps/jupyter\n",
|
|
"# uv add python-dotenv\n",
|
|
"from dotenv import load_dotenv"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "149cbe5b-8365-47c1-a88b-9726865ef16a",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"load_dotenv()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "64fe12a2-a517-4336-adfc-4965531b19d9",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"database_url = os.getenv(\"DATABASE_URL\")\n",
|
|
"api_key = os.getenv(\"API_KEY\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"id": "9fb9cbb7-e13e-44f9-84c7-9124a1274ede",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Database URL: postgresql://user:password@host:port/database\n",
|
|
"API Key: your_secret_api_key\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print(f\"Database URL: {database_url}\")\n",
|
|
"print(f\"API Key: {api_key}\")"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.12.11"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|