Update app.py
Browse files
app.py
CHANGED
|
@@ -1,35 +1,45 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import os
|
| 5 |
import swisseph as swe
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
EPHE_PATH = "/app/ephemeris"
|
| 8 |
|
| 9 |
-
# 1
|
| 10 |
swe.set_ephe_path(EPHE_PATH)
|
|
|
|
| 11 |
|
| 12 |
-
#
|
|
|
|
|
|
|
| 13 |
from flatlib.chart import Chart
|
| 14 |
from flatlib.datetime import Datetime
|
| 15 |
from flatlib.geopos import GeoPos
|
| 16 |
from flatlib import const
|
| 17 |
|
| 18 |
-
#
|
| 19 |
swe.set_ephe_path(EPHE_PATH)
|
| 20 |
-
# También por si acaso SwissEph lee desde ENV
|
| 21 |
-
os.environ["SWEPH_PATH"] = EPHE_PATH
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
#
|
| 25 |
-
#
|
| 26 |
-
|
| 27 |
-
# MUY IMPORTANTE: esta carpeta debe existir en el contenedor
|
| 28 |
-
# y debe contener archivos como:
|
| 29 |
-
# seas_18.se1
|
| 30 |
-
# seas_18.se2
|
| 31 |
-
# ...
|
| 32 |
|
|
|
|
| 33 |
from urllib.parse import quote
|
| 34 |
|
| 35 |
# -------------------------
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
|
| 4 |
+
# ---------------------------
|
| 5 |
+
# 🔧 CONFIGURAR SWISSEPH
|
| 6 |
+
# ---------------------------
|
| 7 |
+
|
| 8 |
import os
|
| 9 |
import swisseph as swe
|
| 10 |
|
| 11 |
+
# Ruta donde están tus efemérides dentro del contenedor
|
| 12 |
+
# -----------------------------------------------------------
|
| 13 |
+
# CONFIGURAR RUTA DE EFEMÉRIDES PARA SWISSEPH
|
| 14 |
+
# -----------------------------------------------------------
|
| 15 |
+
# MUY IMPORTANTE: esta carpeta debe existir en el contenedor
|
| 16 |
+
# y debe contener archivos como:
|
| 17 |
+
# seas_18.se1
|
| 18 |
+
# seas_18.se2
|
| 19 |
+
# ...
|
| 20 |
EPHE_PATH = "/app/ephemeris"
|
| 21 |
|
| 22 |
+
# 1) Configurar ANTES que flatlib
|
| 23 |
swe.set_ephe_path(EPHE_PATH)
|
| 24 |
+
os.environ["SWEPH_PATH"] = EPHE_PATH
|
| 25 |
|
| 26 |
+
# ---------------------------
|
| 27 |
+
# 📦 IMPORTAR FLATLIB
|
| 28 |
+
# ---------------------------
|
| 29 |
from flatlib.chart import Chart
|
| 30 |
from flatlib.datetime import Datetime
|
| 31 |
from flatlib.geopos import GeoPos
|
| 32 |
from flatlib import const
|
| 33 |
|
| 34 |
+
# Algunos sistemas necesitan esto porque flatlib pisa la ruta:
|
| 35 |
swe.set_ephe_path(EPHE_PATH)
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
# ---------------------------
|
| 38 |
+
# 🌐 IMPORTAR FASTAPI
|
| 39 |
+
# ---------------------------
|
| 40 |
+
from fastapi import FastAPI, Query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
-----------
|
| 43 |
from urllib.parse import quote
|
| 44 |
|
| 45 |
# -------------------------
|