├── .gitignore ├── FEniCS-201501-pythonmadrid-juanlu001 ├── custom.css ├── fem.png ├── header.png ├── poisson.png ├── elements.png ├── pybofractal.png ├── ufl-ffc-ufc.png ├── fenics_banner.png ├── fenics_project.png ├── pyladies_square.png ├── fenics_project_updated.png ├── Jackie-Chan-Meme-Template.jpg └── README.md ├── IPython-201501-pythonmadrid-kikocorreoso ├── nbextensions │ └── talk │ │ ├── talk.css │ │ └── talk.js ├── ddg_magics_ext.py ├── README.md ├── 01-Instalando_y_usando_extensiones_sencillas_sin_crear_un_setup(dot)py.ipynb ├── 03-Extensiones_JS.ipynb └── 02-Manipulando_con_js.ipynb ├── PythonCientifico-201411-PyConEs-CachemePybonacci ├── taylor-exp.gif ├── pycones2014.png ├── pyladies_big.png ├── pyladies_square.png ├── nombres_recien_nacidos.xlsx ├── README.md ├── temperaturas.dat ├── 03-Intro-SciPy.ipynb └── 03-Scipy-ejercicio-ODEs-ebola.ipynb ├── Pandas-201405-pythonmadrid-kikocorreoso ├── nombres_recien_nacidos.xlsx └── README.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints/ 2 | *.pyo 3 | *.pyc 4 | -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/custom.css: -------------------------------------------------------------------------------- 1 | .reveal section img { margin: 2em auto; } 2 | 3 | -------------------------------------------------------------------------------- /IPython-201501-pythonmadrid-kikocorreoso/nbextensions/talk/talk.css: -------------------------------------------------------------------------------- 1 | textarea { 2 | width: auto; 3 | } -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/fem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/fem.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/header.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/poisson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/poisson.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/elements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/elements.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/pybofractal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/pybofractal.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/ufl-ffc-ufc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/ufl-ffc-ufc.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/fenics_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/fenics_banner.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/fenics_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/fenics_project.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/pyladies_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/pyladies_square.png -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/fenics_project_updated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/fenics_project_updated.png -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/taylor-exp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/PythonCientifico-201411-PyConEs-CachemePybonacci/taylor-exp.gif -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/Jackie-Chan-Meme-Template.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/FEniCS-201501-pythonmadrid-juanlu001/Jackie-Chan-Meme-Template.jpg -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/pycones2014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/PythonCientifico-201411-PyConEs-CachemePybonacci/pycones2014.png -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/pyladies_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/PythonCientifico-201411-PyConEs-CachemePybonacci/pyladies_big.png -------------------------------------------------------------------------------- /Pandas-201405-pythonmadrid-kikocorreoso/nombres_recien_nacidos.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/Pandas-201405-pythonmadrid-kikocorreoso/nombres_recien_nacidos.xlsx -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/pyladies_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/PythonCientifico-201411-PyConEs-CachemePybonacci/pyladies_square.png -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/nombres_recien_nacidos.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Python-en-ciencia/Python-cientifico/HEAD/PythonCientifico-201411-PyConEs-CachemePybonacci/nombres_recien_nacidos.xlsx -------------------------------------------------------------------------------- /IPython-201501-pythonmadrid-kikocorreoso/ddg_magics_ext.py: -------------------------------------------------------------------------------- 1 | from IPython.display import IFrame 2 | from IPython.core.magic import register_line_magic 3 | 4 | @register_line_magic 5 | def ddg(arg): 6 | phrase = arg.replace(' ', '+') 7 | url = "https://duckduckgo.com/?&q={0}".format(phrase) 8 | print(url) 9 | return IFrame(url, "100%", 400) -------------------------------------------------------------------------------- /IPython-201501-pythonmadrid-kikocorreoso/README.md: -------------------------------------------------------------------------------- 1 | Charla de [Kiko](https://github.com/kikocorreoso) sobre ¿cómo crear extensiones de IPython? en Python Madrid (enero 2015). 2 | 3 | Enlaces a los notebooks desde [aquí](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/tree/master/IPython-201501-pythonmadrid-kikocorreoso/). 4 | 5 | Una charla más extensa sobre el notebook la podéis encontrar [aquí](https://github.com/kikocorreoso/PyConES14_talk-Hacking_the_Notebook). 6 | -------------------------------------------------------------------------------- /Pandas-201405-pythonmadrid-kikocorreoso/README.md: -------------------------------------------------------------------------------- 1 | Charla - tutorial sobre Pandas por @kikocorreoso 2 | ================================================ 3 | 4 | Esta charla se presentó en el grupo [@python_madrid](https://twitter.com/python_madrid) en mayo de 2014. 5 | 6 | La charla muestra parte de la funcionalidad más importante de Pandas. 7 | 8 | Para poder usar los datos de muestra deberás tener el notebook y los datos en la misma carpeta. 9 | 10 | Puedes ver el contenido del notebook en el [siguiente enlace](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/Pandas-201405-pythonmadrid-kikocorreoso/Pandas_PyMAD_201405.ipynb). 11 | -------------------------------------------------------------------------------- /FEniCS-201501-pythonmadrid-juanlu001/README.md: -------------------------------------------------------------------------------- 1 | Charla de [Juanlu](https://github.com/Juanlu001) en el Python Madrid de enero de 2015. 2 | 3 | La presentación la podéis ver [aquí](http://slideviewer.herokuapp.com/github/Python-en-ciencia/Python-cientifico/blob/master/FEniCS-201501-pythonmadrid-juanlu001/Resolviendo%20ecuaciones%20diferenciales%20con%20FEniCS.ipynb#/) (las ecuaciones en latex no se ven bien). 4 | 5 | Si lo queréis ver en formato notebook estático lo podéis ver [aquí](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/FEniCS-201501-pythonmadrid-juanlu001/Resolviendo%20ecuaciones%20diferenciales%20con%20FEniCS.ipynb) (aquí sí se ven bien las ecuaciones). 6 | 7 | Podés ver también un post [publicado en pybonacci sobre FEniCS](http://pybonacci.org/2015/01/20/fenics-resolucion-de-ecuaciones-diferenciales-en-python/). 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Python-cientifico 2 | ================= 3 | 4 | Repositorio que reune diferentes presentaciones, tutoriales y cursos en español sobre el uso de Python en ciencia. 5 | 6 | La idea general es que incluyas la información de tu curso, presentación, tutorial,..., en este repositorio para que haya un repositorio central que poder usar cuando alguien piense generar nuevo material (DRY). 7 | 8 | ¿Cómo colaborar? 9 | ================ 10 | 11 | Para poder incluir nueva información debes: 12 | 13 | * Hacer un fork de este repositorio. 14 | * En tu copia incluir el material nuevo en una nueva carpeta llamada de forma descriptiva (temática-fecha-metadatoslibres, e.g., pandas-201409-pythonmadrid). 15 | * En la carpeta con el material incluir un README explicando el material incluido. Si son notebooks de IPython, en el README se pueden incluir vistas estáticas a los notebooks usando [http://nbviewer.ipython.org/](http://nbviewer.ipython.org/). 16 | * En la carpeta con el material o en el README incluir la licencia que quieres aplicar a tu material. 17 | * Hacer un Pull Request a este repositorio. 18 | 19 | Motivación de este repositorio 20 | ============================== 21 | 22 | Intentar centralizar, de alguna forma, toda esa información que está diseminada por muchos sitios y que, a menudo, cuesta bastante esfuerzo encontrar y reunir. 23 | 24 | Normas básicas 25 | ============== 26 | 27 | El material que incluyas debe haber sido generado por ti o debe tener una licencia que permita hacer lo que estamos haciendo. 28 | 29 | Si, por la razón que sea, quieres eliminar material incluido previamente, abre una [issue](https://github.com/Python-en-ciencia/Python-cientifico/issues) y nos encargaremos de ello. 30 | 31 | Licencia 32 | ======== 33 | 34 | Cada carpeta incluirá su propia licencia. En caso de que no se incluya licencia se aplicará licencia MIT a esa carpeta. 35 | -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/README.md: -------------------------------------------------------------------------------- 1 | Charla - Taller sobre Python científico en la PyConES 2014 por CAChemE y Pybonacci 2 | ================================================================================== 3 | 4 | Esta charla-taller se presentó en la [PyConES 2014](http://2014.es.pycon.org/) en noviembre de 2014. 5 | 6 | La charla-taller muestra parte de las bibliotecas más importantes del ecosistema científico Python. 7 | 8 | * 01 | [Introducción a Python científico: NumPy, matplotlib e IPython Notebook](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/PythonCientifico-201411-PyConEs-CachemePybonacci/01_IPython-NumPy-matplotlib.ipynb) 9 | * 02 | [SymPy](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/PythonCientifico-201411-PyConEs-CachemePybonacci/02-Introduccion-SymPy.ipynb) 10 | * 03 | [Introducción a SciPy](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/PythonCientifico-201411-PyConEs-CachemePybonacci/03-Intro-SciPy.ipynb): Ejercicio de EDOs [(modelo epidemiológico SEIR del virus del Ébola)](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/PythonCientifico-201411-PyConEs-CachemePybonacci/03-Scipy-ejercicio-ODEs-ebola.ipynb) 11 | * 04 | [Pandas](http://nbviewer.ipython.org/github/Python-en-ciencia/Python-cientifico/blob/master/PythonCientifico-201411-PyConEs-CachemePybonacci/Pandas_PyConES_201411.ipynb) 12 | * 05 | [Enseñando Python científico: lecciones aprendidas](http://www.slideshare.net/CAChemE/python-en-ingenieria-lecciones-aprendidas) 13 | 14 | La mayor parte de contenido de este Taller proviene del [Curso de AeroPython](https://github.com/AeroPython/Curso_AeroPython) de [Pybonacci](http://pybonacci.og) y del [Curso de online de introducción a Python para científicos e ingenieros](http://cacheme.org/curso-online-python-cientifico-ingenieros/) (con las clases grabadas en [vídeo](https://www.youtube.com/playlist?list=PLGBbVX_WvN7bMwYe7wWV5TZt1a58jTggB)). 15 | 16 | [![Curso de online de introducción a Python para científicos e ingenieros](http://img.youtube.com/vi/ox09Jko1ErM/0.jpg)](http://www.youtube.com/watch?v=ox09Jko1ErM&list=PLGBbVX_WvN7bMwYe7wWV5TZt1a58jTggB) 17 | 18 | 19 | Otras referencias importantes que demuestran el potencial de Python en el ámbito científico-ingenieril son: 20 | 21 | * [Practical Numerical Methods in Python](https://github.com/numerical-mooc/numerical-mooc#practical-numerical-methods-in-python) - Lorena Barba et al. 22 | * [Aerodynamics-Hydrodynamics with Python](https://github.com/barbagroup/AeroPython) - Lorena Barba 23 | * [12 Steps to Navier Stokes](https://github.com/barbagroup/CFDPython) - Lorena Barba 24 | * [Scientific computing projects](http://jrjohansson.github.io/) - J.R. Johannson 25 | * [Quantitative Economics](http://quant-econ.net/py/index.html) - Thomas J. Sargent & John Stachurski 26 | * [A Success Story in Using Python in a Graduate Chemical Engineering Course](https://www.youtube.com/watch?v=IsSMs-4GlT8) - John Kitchin 27 | * [Tutorial de Python para ciencias e ingenierías](https://github.com/mgaitan/curso-python-cientifico#tutorial-de-python-para-ciencias-e-ingenier%C3%ADas) - Martín Gaitán 28 | * [Diez consejos para un mejor software (de) científico(s)](https://github.com/mgaitan/10consejos) - Martín Gaitán 29 | 30 | 31 | Tal y como apuntamos en nuestra charla, también recomendamos las [lecciones de Software-Carpentry](http://software-carpentry.org/lessons.html) para los más novatos. 32 | 33 | -------------------------------------------------------------------------------- /PythonCientifico-201411-PyConEs-CachemePybonacci/temperaturas.dat: -------------------------------------------------------------------------------- 1 | 44 -33 2 | 6 -56 3 | 0 -44 4 | 28 -11 5 | 56 0 6 | 78 11 7 | 72 28 8 | 89 17 9 | 94 39 10 | 83 44 11 | 78 28 12 | 83 56 13 | 100 61 14 | 133 33 15 | 33 17 16 | 28 0 17 | 61 17 18 | 17 -39 19 | 106 -11 20 | 117 -11 21 | 0 -33 22 | -28 -106 23 | -67 -117 24 | -56 -111 25 | -44 -106 26 | -28 -94 27 | 11 -72 28 | 22 -17 29 | 94 22 30 | 150 39 31 | 161 -11 32 | -6 -44 33 | -17 -72 34 | -11 -44 35 | -11 -50 36 | 0 -22 37 | 39 -17 38 | 0 -33 39 | 11 -28 40 | 0 -61 41 | 22 -78 42 | 72 11 43 | 67 22 44 | 67 6 45 | 78 6 46 | 128 28 47 | 50 -6 48 | 0 -78 49 | 17 -83 50 | 94 6 51 | 33 -39 52 | 11 -44 53 | 33 -39 54 | 56 22 55 | 83 11 56 | 72 0 57 | 67 17 58 | 83 22 59 | 106 39 60 | 72 22 61 | 44 -6 62 | 44 -17 63 | 56 -28 64 | 94 -6 65 | 56 33 66 | 33 6 67 | 56 -6 68 | 128 17 69 | 100 22 70 | 122 44 71 | 139 61 72 | 111 33 73 | 50 -17 74 | 83 -11 75 | 50 0 76 | 33 -17 77 | 17 -22 78 | 61 6 79 | 72 0 80 | 44 -11 81 | 50 -22 82 | 78 0 83 | 83 6 84 | 44 22 85 | 117 28 86 | 117 22 87 | 106 28 88 | 128 44 89 | 150 44 90 | 122 67 91 | 167 28 92 | 61 6 93 | 78 6 94 | 117 6 95 | 178 50 96 | 111 17 97 | 128 44 98 | 228 106 99 | 278 106 100 | 233 128 101 | 156 83 102 | 83 50 103 | 144 50 104 | 139 78 105 | 150 67 106 | 172 83 107 | 217 128 108 | 150 106 109 | 217 128 110 | 156 61 111 | 128 28 112 | 128 50 113 | 117 50 114 | 206 67 115 | 189 78 116 | 194 100 117 | 217 89 118 | 206 106 119 | 139 111 120 | 200 106 121 | 206 83 122 | 222 94 123 | 189 94 124 | 206 89 125 | 178 78 126 | 206 78 127 | 233 111 128 | 172 128 129 | 200 122 130 | 261 150 131 | 211 161 132 | 211 106 133 | 144 72 134 | 161 56 135 | 206 111 136 | 261 167 137 | 222 144 138 | 183 133 139 | 150 128 140 | 261 144 141 | 300 200 142 | 256 150 143 | 267 178 144 | 183 72 145 | 122 72 146 | 189 89 147 | 228 106 148 | 200 133 149 | 278 144 150 | 322 222 151 | 322 239 152 | 322 228 153 | 311 206 154 | 256 189 155 | 239 139 156 | 233 144 157 | 211 150 158 | 172 150 159 | 250 139 160 | 267 172 161 | 211 167 162 | 267 178 163 | 244 183 164 | 206 128 165 | 222 117 166 | 267 161 167 | 267 183 168 | 289 206 169 | 289 178 170 | 250 150 171 | 267 167 172 | 278 178 173 | 289 183 174 | 311 211 175 | 333 233 176 | 328 228 177 | 294 233 178 | 300 228 179 | 294 228 180 | 283 217 181 | 300 228 182 | 250 222 183 | 278 222 184 | 283 228 185 | 306 239 186 | 322 244 187 | 333 256 188 | 333 256 189 | 317 228 190 | 311 233 191 | 294 239 192 | 289 244 193 | 250 200 194 | 272 194 195 | 322 233 196 | 344 256 197 | 344 250 198 | 361 261 199 | 367 272 200 | 356 283 201 | 339 272 202 | 317 244 203 | 300 239 204 | 306 228 205 | 283 200 206 | 200 178 207 | 283 183 208 | 278 211 209 | 256 211 210 | 294 206 211 | 283 194 212 | 283 194 213 | 244 189 214 | 283 194 215 | 256 200 216 | 267 189 217 | 256 167 218 | 278 178 219 | 267 211 220 | 272 211 221 | 294 233 222 | 283 211 223 | 272 183 224 | 278 211 225 | 250 200 226 | 233 161 227 | 256 150 228 | 278 178 229 | 289 178 230 | 244 200 231 | 261 189 232 | 311 200 233 | 322 222 234 | 256 217 235 | 278 217 236 | 267 183 237 | 283 178 238 | 289 200 239 | 306 217 240 | 300 217 241 | 267 217 242 | 294 211 243 | 300 228 244 | 289 239 245 | 278 233 246 | 278 200 247 | 278 183 248 | 267 178 249 | 222 139 250 | 267 150 251 | 283 178 252 | 228 139 253 | 306 200 254 | 356 250 255 | 306 211 256 | 250 150 257 | 194 122 258 | 228 106 259 | 228 133 260 | 183 100 261 | 222 106 262 | 256 128 263 | 261 156 264 | 250 161 265 | 206 122 266 | 189 100 267 | 228 83 268 | 228 111 269 | 217 144 270 | 206 139 271 | 228 133 272 | 222 139 273 | 239 133 274 | 278 150 275 | 283 178 276 | 256 172 277 | 300 189 278 | 244 178 279 | 211 183 280 | 244 156 281 | 194 122 282 | 167 117 283 | 183 122 284 | 200 156 285 | 222 156 286 | 183 133 287 | 189 111 288 | 222 117 289 | 194 133 290 | 228 161 291 | 200 128 292 | 178 111 293 | 172 100 294 | 189 100 295 | 194 106 296 | 128 72 297 | 122 50 298 | 117 44 299 | 128 50 300 | 144 78 301 | 161 61 302 | 133 67 303 | 156 83 304 | 189 117 305 | 211 150 306 | 200 128 307 | 128 28 308 | 78 17 309 | 128 50 310 | 161 94 311 | 178 67 312 | 100 44 313 | 100 33 314 | 161 67 315 | 117 61 316 | 111 -5 317 | 39 -16 318 | 111 6 319 | 139 67 320 | 156 72 321 | 156 106 322 | 183 106 323 | 106 22 324 | 67 0 325 | 111 17 326 | 139 106 327 | 122 -5 328 | -10 -49 329 | 17 -49 330 | 83 6 331 | 167 17 332 | 17 -10 333 | 39 -16 334 | 39 -38 335 | 94 22 336 | 94 50 337 | 117 33 338 | 111 50 339 | 156 89 340 | 167 28 341 | 50 0 342 | 6 -16 343 | 39 -5 344 | 28 -10 345 | 6 -27 346 | -10 -49 347 | 17 -49 348 | 11 -55 349 | 44 -10 350 | 6 -38 351 | 0 -43 352 | 28 -49 353 | 83 -10 354 | 117 50 355 | 183 106 356 | 217 161 357 | 178 56 358 | 56 -32 359 | -5 -71 360 | 22 -10 361 | 44 -5 362 | 128 22 363 | 89 50 364 | 72 -49 365 | 0 -60 366 | 6 -43 367 | -------------------------------------------------------------------------------- /IPython-201501-pythonmadrid-kikocorreoso/01-Instalando_y_usando_extensiones_sencillas_sin_crear_un_setup(dot)py.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": { 3 | "name": "", 4 | "signature": "sha256:ad529ddcba7262346a69c3b6819ab6b953002c7893dac2a3ae02c27891ae18c3" 5 | }, 6 | "nbformat": 3, 7 | "nbformat_minor": 0, 8 | "worksheets": [ 9 | { 10 | "cells": [ 11 | { 12 | "cell_type": "markdown", 13 | "metadata": {}, 14 | "source": [ 15 | "
\n", 16 | "

(Esto es una continuaci\u00f3n de lo que pod\u00e9is encontrar en [este otro notebook](http://nbviewer.ipython.org/github/kikocorreoso/PyConES14_talk-Hacking_the_Notebook/blob/master/notebooks/03-Creating_your_own_magic_functions.ipynb))

\n", 17 | "
" 18 | ] 19 | }, 20 | { 21 | "cell_type": "markdown", 22 | "metadata": {}, 23 | "source": [ 24 | "Como vimos en el anterior notebook, crear una nueva funci\u00f3n m\u00e1gica simple es relativamente sencillo. Vamos a convertirla en una extensi\u00f3n. Para ello vamos a usar el ejemplo de `%ddg` vista en el notebook enlazado m\u00e1s arriba." 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "collapsed": false, 30 | "input": [ 31 | "%%writefile ./ddg_magics_ext.py\n", 32 | "from IPython.display import IFrame\n", 33 | "from IPython.core.magic import register_line_magic\n", 34 | "\n", 35 | "@register_line_magic\n", 36 | "def ddg(arg):\n", 37 | " phrase = arg.replace(' ', '+')\n", 38 | " url = \"https://duckduckgo.com/?&q={0}\".format(phrase)\n", 39 | " print(url)\n", 40 | " return IFrame(url, \"100%\", 400)" 41 | ], 42 | "language": "python", 43 | "metadata": {}, 44 | "outputs": [ 45 | { 46 | "output_type": "stream", 47 | "stream": "stdout", 48 | "text": [ 49 | "Writing ./ddg_magics_ext.py\n" 50 | ] 51 | } 52 | ], 53 | "prompt_number": 2 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "metadata": {}, 58 | "source": [ 59 | "Ahora tenemos disponible una extensi\u00f3n, que no es m\u00e1s que un fichero Python que podemos instalar de la siguiente forma:" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "collapsed": false, 65 | "input": [ 66 | "%install_ext ddg_magics_ext.py" 67 | ], 68 | "language": "python", 69 | "metadata": {}, 70 | "outputs": [ 71 | { 72 | "output_type": "stream", 73 | "stream": "stdout", 74 | "text": [ 75 | "Installed ddg_magics_ext.py. To use it, type:\n", 76 | " %load_ext ddg_magics_ext\n" 77 | ] 78 | } 79 | ], 80 | "prompt_number": 3 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "A partir de este momento estar\u00e1 siempre disponible para el perfil de usuario que estamos usando." 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "Cuando iniciamos nueva sesi\u00f3n con el mismo perfil podemos cargar la extensi\u00f3n usando:" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "collapsed": false, 99 | "input": [ 100 | "%load_ext ddg_magics_ext" 101 | ], 102 | "language": "python", 103 | "metadata": {}, 104 | "outputs": [ 105 | { 106 | "output_type": "stream", 107 | "stream": "stdout", 108 | "text": [ 109 | "The ddg_magics_ext module is not an IPython extension.\n" 110 | ] 111 | } 112 | ], 113 | "prompt_number": 6 114 | }, 115 | { 116 | "cell_type": "code", 117 | "collapsed": false, 118 | "input": [ 119 | "%ddg python madrid" 120 | ], 121 | "language": "python", 122 | "metadata": {}, 123 | "outputs": [ 124 | { 125 | "output_type": "stream", 126 | "stream": "stdout", 127 | "text": [ 128 | "https://duckduckgo.com/?&q=python+madrid\n" 129 | ] 130 | }, 131 | { 132 | "html": [ 133 | "\n", 134 | " \n", 141 | " " 142 | ], 143 | "metadata": {}, 144 | "output_type": "pyout", 145 | "prompt_number": 7, 146 | "text": [ 147 | "" 148 | ] 149 | } 150 | ], 151 | "prompt_number": 7 152 | } 153 | ], 154 | "metadata": {} 155 | } 156 | ] 157 | } -------------------------------------------------------------------------------- /IPython-201501-pythonmadrid-kikocorreoso/nbextensions/talk/talk.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ---------------------------------------------------------------------------- 3 | * Copyright (c) 2014 - Kiko Correoso 4 | * 5 | * Distributed under the terms of the MIT License. 6 | * 7 | * A little extension to talk with the IPython notebook and write the 8 | * conversation in a cell. 9 | * 10 | * Ths extension is based on previous work by Damián Ávila and Min Ragan Kelley 11 | * see https://github.com/damianavila/mIPyex/tree/master/custom/spellchecker 12 | * see https://github.com/minrk/ipython_extensions 13 | * ---------------------------------------------------------------------------- 14 | */ 15 | 16 | /* 17 | * ---------------------------------------------------------------------------- 18 | * INSTALLATION 19 | * 20 | * Add this file and neighboring talk.css to $(ipython locate)/nbextensions/talk 21 | * 22 | * And load it with: 23 | * 24 | * %%javascript 25 | * IPython.load_extensions('talk/talk'); 26 | * ---------------------------------------------------------------------------- 27 | */ 28 | 29 | define(["require"], function (require) { 30 | "use strict"; 31 | 32 | // Test browser support 33 | window.SpeechRecognition = window.SpeechRecognition || 34 | window.webkitSpeechRecognition || 35 | null; 36 | 37 | if (window.SpeechRecognition){ 38 | 39 | var recognizer = new window.SpeechRecognition(); 40 | recognizer.continuous = true; 41 | recognizer.interimResults = true; 42 | recognizer.lang = "es-ES" 43 | 44 | var talk_func = function(){ 45 | 46 | var textarea = $('