You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.es.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,28 @@ Esta plantilla está diseñada para impulsar proyectos de ciencia de datos propo
6
6
7
7
El proyecto está organizado de la siguiente manera:
8
8
9
-
-`app.py` - El script principal de Python que ejecutas para tu proyecto.
10
-
-`explore.py` - Un notebook para que puedas hacer tus exploraciones, idealmente el codigo de este notebook se migra hacia app.py para subir a produccion.
11
-
-`utils.py` - Este archivo contiene código de utilidad para operaciones como conexiones de base de datos.
12
-
-`requirements.txt` - Este archivo contiene la lista de paquetes de Python necesarios.
13
-
-`models/` - Este directorio debería contener tus clases de modelos SQLAlchemy.
14
-
-`data/` - Este directorio contiene los siguientes subdirectorios:
15
-
-`interim/` - Para datos intermedios que han sido transformados.
16
-
-`processed/` - Para los datos finales a utilizar para el modelado.
17
-
-`raw/` - Para datos brutos sin ningún procesamiento.
18
-
19
-
## Configuración
9
+
-**`src/app.py`** → Script principal de Python donde correrá tu proyecto.
10
+
-**`src/explore.ipynb`** → Notebook para exploración y pruebas. Una vez finalizada la exploración, migra el código limpio a `app.py`.
11
+
-**`src/utils.py`** → Funciones auxiliares, como conexión a bases de datos.
12
+
-**`requirements.txt`** → Lista de paquetes de Python necesarios.
13
+
-**`models/`** → Contendrá tus clases de modelos SQLAlchemy.
14
+
-**`data/`** → Almacena los datasets en diferentes etapas:
15
+
-**`data/raw/`** → Datos sin procesar.
16
+
-**`data/interim/`** → Datos transformados temporalmente.
17
+
-**`data/processed/`** → Datos listos para análisis.
18
+
19
+
20
+
## ⚡ Configuración Inicial en Codespaces (Recomendado)
21
+
22
+
No es necesario realizar ninguna configuración manual, ya que **Codespaces se configura automáticamente** con los archivos predefinidos que ha creado la academia para ti. Simplemente sigue estos pasos:
23
+
24
+
1.**Espera a que el entorno se configure automáticamente**.
25
+
- Todos los paquetes necesarios y la base de datos se instalarán por sí mismos.
26
+
- El `username` y `db_name` creados automáticamente están en el archivo **`.env`** en la raíz del proyecto.
27
+
2.**Una vez que Codespaces esté listo, puedes comenzar a trabajar inmediatamente**.
28
+
29
+
30
+
## 💻 Configuración en Local (Solo si no puedes usar Codespaces)
Crea una nueva base de datos dentro del motor Postgres personalizando y ejecutando el siguiente comando: `$ createdb -h localhost -U <username> <db_name>`
38
-
Conéctate al motor Postgres para usar tu base de datos, manipular tablas y datos: `$ psql -h localhost -U <username> <db_name>`
39
-
NOTA: Recuerda revisar la información del archivo ./.env para obtener el nombre de usuario y db_name.
48
+
Crea una nueva base de datos dentro del motor Postgres personalizando y ejecutando el siguiente comando:
49
+
50
+
```bash
51
+
$ psql -U postgres -c "DO \$\$ BEGIN
52
+
CREATE USER mi_usuario WITH PASSWORD 'mi_contraseña';
Copy file name to clipboardExpand all lines: README.md
+55-32Lines changed: 55 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,22 +6,32 @@ This boilerplate is designed to kickstart data science projects by providing a b
6
6
7
7
The project is organized as follows:
8
8
9
-
-`app.py` - The main Python script that you run for your project.
10
-
-`explore.py` - A notebook to explore data, play around, visualize, clean, etc. Ideally the notebook code should be migrated to the app.py when moving to production.
11
-
-`utils.py` - This file contains utility code for operations like database connections.
12
-
-`requirements.txt` - This file contains the list of necessary python packages.
13
-
-`models/` - This directory should contain your SQLAlchemy model classes.
14
-
-`data/` - This directory contains the following subdirectories:
15
-
-`interin/` - For intermediate data that has been transformed.
16
-
-`processed/` - For the final data to be used for modeling.
17
-
-`raw/` - For raw data without any processing.
18
-
19
-
20
-
## Setup
9
+
-**`src/app.py`** → Main Python script where your project will run.
10
+
-**`src/explore.ipynb`** → Notebook for exploration and testing. Once exploration is complete, migrate the clean code to `app.py`.
11
+
-**`src/utils.py`** → Auxiliary functions, such as database connection.
12
+
-**`requirements.txt`** → List of required Python packages.
13
+
-**`models/`** → Will contain your SQLAlchemy model classes.
14
+
-**`data/`** → Stores datasets at different stages:
No manual setup is required, as **Codespaces is automatically configured** with the predefined files created by the academy for you. Just follow these steps:
23
+
24
+
1.**Wait for the environment to configure automatically**.
25
+
- All necessary packages and the database will install themselves.
26
+
- The automatically created `username` and `db_name` are in the **`.env`** file at the root of the project.
27
+
2.**Once Codespaces is ready, you can start working immediately**.
28
+
29
+
30
+
## 💻 Local Setup (Only if you can't use Codespaces)
21
31
22
32
**Prerequisites**
23
33
24
-
Make sure you have Python 3.11+ installed on your. You will also need pip for installing the Python packages.
34
+
Make sure you have Python 3.11+ installed on your machine. You will also need pip to install the Python packages.
25
35
26
36
**Installation**
27
37
@@ -33,57 +43,70 @@ Navigate to the project directory and install the required Python packages:
33
43
pip install -r requirements.txt
34
44
```
35
45
36
-
**Create a database (if needed)**
46
+
**Create a database (if necessary)**
47
+
48
+
Create a new database within the Postgres engine by customizing and executing the following command:
37
49
38
-
Create a new database within the Postgres engine by customizing and executing the following command: `$ createdb -h localhost -U <username> <db_name>`
39
-
Connect to the Postgres engine to use your database, manipulate tables and data: `$ psql -h localhost -U <username> <db_name>`
40
-
NOTE: Remember to check the ./.env file information to get the username and db_name.
50
+
```bash
51
+
$ psql -U postgres -c "DO \$\$ BEGIN
52
+
CREATE USER my_user WITH PASSWORD 'my_password';
53
+
CREATE DATABASE my_database OWNER my_user;
54
+
END \$\$;"
55
+
```
56
+
Connect to the Postgres engine to use your database, manipulate tables, and data:
41
57
42
-
Once you are inside PSQL you will be able to create tables, make queries, insert, update or delete data and much more!
58
+
```bash
59
+
$ psql -U my_user -d my_database
60
+
```
61
+
62
+
Once inside PSQL, you can create tables, run queries, insert, update, or delete data, and much more!
43
63
44
64
**Environment Variables**
45
65
46
-
Create a .env file in the project root directory to store your environment variables, such as your database connection string:
66
+
Create a .env file in the root directory of the project to store your environment variables, such as your database connection string:
To run the application, execute the app.py script from the root of the project directory:
77
+
To run the application, execute the app.py script from the root directory of the project:
55
78
56
79
```bash
57
-
python app.py
80
+
python src/app.py
58
81
```
59
82
60
83
## Adding Models
61
84
62
-
To add SQLAlchemy model classes, create new Python script files inside the models/ directory. These classes should be defined according to your database schema.
85
+
To add SQLAlchemy model classes, create new Python script files within the models/ directory. These classes should be defined according to your database schema.
63
86
64
87
Example model definition (`models/example_model.py`):
65
88
66
89
```py
67
-
from sqlalchemy.ext.declarative import declarative_base
You can place your raw datasets in the data/raw directory, intermediate datasets in data/interim, and the processed datasets ready for analysis in data/processed.
104
+
You can place your raw datasets in the data/raw directory, intermediate datasets in data/interim, and processed datasets ready for analysis in data/processed.
82
105
83
-
To process data, you can modify the app.py script to include your data processing steps, utilizing pandas for data manipulation and analysis.
106
+
To process data, you can modify the app.py script to include your data processing steps, using pandas for data manipulation and analysis.
84
107
85
108
## Contributors
86
109
87
-
This template was built as part of the 4Geeks Academy [Data Science and Machine Learning Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning) by [Alejandro Sanchez](https://twitter.com/alesanchezr) and many other contributors. Find out more about [4Geeks Academy's BootCamp programs](https://4geeksacademy.com/us/programs) here.
110
+
This template was built as part of the [Data Science and Machine Learning Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning) by 4Geeks Academy by [Alejandro Sanchez](https://twitter.com/alesanchezr) and many other contributors. Learn more about [4Geeks Academy BootCamp programs](https://4geeksacademy.com/us/programs) here.
88
111
89
-
Other templates and resources like this can be found on the school GitHub page.
112
+
Other templates and resources like this can be found on the school's GitHub page.
0 commit comments