XML Books — Project Overview
Summary: XML Books loads a book catalog from an XML file stored in Google Drive, validates and parses it at request time, and exposes simple filters by author and title. The goal is to keep the app lightweight (no large datasets in the repo) while demonstrating external storage integration and clean UI rendering in Django.
Goals
- Load and validate an XML dataset from Google Drive (folder-scoped query + file download).
- Defend against HTML previews/warnings from Drive before parsing.
- Filter results via query params (
?author=...,?title=...). - Keep the Heroku slug small (no heavy datasets in the repo).
High-level Architecture
- View
xml_booksreads query params and builds the Drive request. - File listing by folder + exact filename; then direct file download.
- Guard: if payload looks like HTML, abort parsing (Drive preview pages).
- Parse with
xml.etree.ElementTreeand normalize CDATA/text. - Filter and render results with Bootstrap.
Environment Variables
| Variable | Description | Example |
|---|---|---|
GOOGLE_DRIVE_API_KEY |
API Key for Google Drive (Files: list/get). | AIzaSy...xyz |
GOOGLE_DRIVE_FOLDER_ID |
Folder ID containing the XML file. | 1AbCdEfGhIJ... |
BOOKS_XML_FILENAME |
Exact XML filename to fetch. | books.xml |
Endpoint & Usage
| Endpoint | Description | Params | Examples |
|---|---|---|---|
/data-science/books-filter/ |
Returns the book list from remote XML with optional filters. | author (optional), title (optional) |
?author=arturo?title=sidi?author=arturo&title=sidi
|
Error Handling
- 404/403 listing Drive: check
GOOGLE_DRIVE_FOLDER_IDpermissions. - HTML payload (preview/warning): abort parsing to avoid XML errors.
- XML ParseError: malformed or truncated XML; verify the source file.
- Timeouts: add caching and increase request timeout if needed.
Search Form
Author's book list:
LA METAMORFOSIS Y OTROS RELATOS: AUXILIAR BUP
ISBN: 9788431639778
Page: 160
Lang: Castellano
Year: 2014
Price: 9.83
Publisher By: Vicens-vives
Tags: Juvenil
EL INSPECTOR
ISBN: 9788420682549
Page: 264
Lang: Castellano
Year: 2009
Price: 10.45
Publisher By: Alianza editorial
Tags: Teatro contemporáneo extranjero del XIX al XXI,Teatro,Literatura
La visión ácida y crítica que Nikolai Gogol (1809-1852) tenía de la Rusia del zar Nicolás I, puesta de relieve en sus Historias de San Petersburgo entre las que se cuentan relatos tan célebres como La nariz y El abrigo y más aún en su novela Almas muertas, encuentra quizá su más acerada y universal expresión en El inspector, obra que en su primera representación en 1836 dejó conmocionada a buena parte del público asistente. En este peculiar “retablo de las maravillas” ruso, el rumor de la visita de un inspector a una pequeña ciudad del Imperio deja al descubierto todas las miserias y corruptelas de una sociedad en la que, a falta de cualquier instancia de control, el envilecimiento y el cohecho se convierten en normalidad. Como todos los grandes retratos de la naturaleza humana y merced a la suma capacidad de adaptación a los cambios sociales, políticos y económicos a ella inherente, la obra y su vigencia traspasan el tiempo y las fronteras. Completan el volumen unos valiosos apéndices, entre los que destacan el fragmento de una carta del autor, así como una pieza titulada «A la salida del teatro», que retratan en el caso de esta última, verosímilmente la repercusión inmediata de su estreno.
LOS MEJORES CHISTES CORTOS
ISBN: 9788496746282
Page: 336
Lang: Castellano
Year: 2008
Price: 8.50
Publisher By: Swing
Tags: Narrativa de humor,Géneros literarios,Literatura
LAS OLAS
ISBN: 9788437612881
Page: 376
Lang: Castellano
Year: 2005
Price: 16.48
Publisher By: Catedra
Tags: Narrativa extranjera del XIX al XXI en bolsillo,Narrativa en bolsillo,Literatura
EL ENAMORADO DE LA OSA MAYOR (2ª ED)
ISBN: 9788496489585
Page: 504
Lang: Castellano
Year: 2006
Price: 24.70
Publisher By: El acantilado
Tags: Narrativa extranjera,Novela contemporánea
TRECE PARA EL DIABLO. LAS MIL CARAS DEL PRINCIPE DE LAS TINIEBLAS
ISBN: 9788477026600
Page: 352
Lang: Castellano
Year: 2010
Price: 22.99
Publisher By: Valdemar
Tags: Narrativa de terror,Géneros literarios,Literatura
LA PERRA DE ALEJANDRIA
ISBN: 9788477026525
Page: 320
Lang: Castellano
Year: 2009
Price: 9.97
Publisher By: Valdemar
Tags: Histórica en bolsillo,Narrativa en bolsillo,Literatura
UN GRITO DE AMOR DESDE EL CENTRO DEL MUNDO
ISBN: 9788420472652
Page: 200
Lang: Castellano
Year: 2017
Price: 15.10
Publisher By: Alfaguara
Tags: Narrativa extranjera,Novela contemporánea
LA MALDICION DE LA ESPADA NEGRA / TORMENTOSA (SAGA ELRIC DE MELNI BONE 7 Y 8)
ISBN: 9788435021180
Page: 448
Lang: Castellano
Year: 2008
Price: 25.17
Publisher By: Edhasa
Tags: Narrativa fantástica,Géneros literarios,Literatura
LAS BRIGADAS FANTASMA (SAGA LA VIEJA GUARDIA 2)
ISBN: 9788445077078
Page: 264
Lang: Castellano
Year: 2008
Price: 17.10
Publisher By: Minotauro
Tags: Narrativa de ciencia ficción,Géneros literarios,Literatura
Las Brigadas Fantasma son jóvenes, son rápidos y fuertes y carecen de escrúpulos humanos. El universo es un lugar peligroso para la humanidad y está a punto de serlo mucho más, ya que tres razas alienígenas se han aliado contra los humanos. Cuentan con un importante aliado el científico militar Charles Boutin, que ha traicionado a la humanidad y ha desvelado los mayores secretos de las FDC. Para vencer, las FDC deberán averiguar qué ha llevado a Boutin a cometer semejante acto. La clave para resolver este enigma se llama Jared Dirac; un híbrido superhumano, creado a partir del ADN de Boutin y cuyo cerebro contiene la memoria del traidor. Pero el trasplante de memoria falla y Pared es trasladado a las Brigadas Fantasma. Allí se convierte en un soldado perfecto, hasta que los recuerdos de Boutin comienzan a manifestarse. Pared emprenderá entonces una búsqueda desesperada de su «padre» para obtener respuestas, pero el tiempo corre en su contra la alianza está preparando su ofensiva y planean cosas peores que la mera derrota militar de la humanidad.
HANNIBAL: EL ORIGEN DEL MAL
ISBN: 9788483465080
Page: 320
Lang: Castellano
Year: 2016
Price: 9.45
Publisher By: Debolsillo
Tags: Policiaca. Novela negra en bolsillo,Narrativa en bolsillo,Literatura
Hannibal Lecter, huérfano y testigo de barbaridades indescriptibles, sobrevive al vendaval de la Segunda Guerra Mundial en Europa del Este. Al terminar el conflicto su tío le localiza en un orfanato soviético y lo lleva a París para vivir con él y su bella esposa, lady Murasaki. Ella le cuida y con su apoyo Hannibal se convertirá en el alumno más joven y más dotado de la facultad de medicina de París. Sin embargo, Hannibal nunca podrá olvidar lo que ha vivido. Sus demonios lo atormentan constantemente y exigen venganza. Y el joven estudiante comienza a desarrollar sorprendentes y exquisitos talentos para cumplirla. «Con precisión de cirujano, Harris abre su palabra diseccionadora, analítica y eficaz, creando una atmósfera de suspense que atrapa al lector y le conduce por las estancias del palacio de la mente de un ser terrible.» El Cultural