{"generator":"Jekyll","link":[{"@attributes":{"href":"https:\/\/domvwt.github.io\/feed.xml","rel":"self","type":"application\/atom+xml"}},{"@attributes":{"href":"https:\/\/domvwt.github.io\/","rel":"alternate","type":"text\/html"}}],"updated":"2021-06-18T14:58:51+00:00","id":"https:\/\/domvwt.github.io\/feed.xml","title":"domvwt","subtitle":"Thoughts, ideas, and projects.\n","author":{"name":"Dominic Thorn","email":"dominic.thorn@gmail.com"},"entry":[{"title":"esparto","link":{"@attributes":{"href":"https:\/\/domvwt.github.io\/python\/bootstrap\/html\/pdf\/reporting\/2021\/04\/09\/esparto.html","rel":"alternate","type":"text\/html","title":"esparto"}},"published":"2021-04-09T18:47:12+00:00","updated":"2021-04-09T18:47:12+00:00","id":"https:\/\/domvwt.github.io\/python\/bootstrap\/html\/pdf\/reporting\/2021\/04\/09\/esparto","content":"<p>Simple HTML and PDF document generator for Python.<\/p>\n\n<p><a href=\"https:\/\/github.com\/domvwt\/esparto\">GitHub<\/a> - <a href=\"https:\/\/domvwt.github.io\/esparto\/\">Docs<\/a> - <a href=\"https:\/\/pypi.org\/project\/esparto\/\">PyPI<\/a><\/p>\n\n<!--more-->\n\n<hr \/>\n\n<p>Sharing reports is a common requirement in data science; analyses and model evaluations often need to be \nmade available to peer reviewers, business stakeholders, and internal compliance and validation functions - among others.\nThere are some excellent frameworks, such as <a href=\"https:\/\/plotly.com\/dash\/\">Dash<\/a> and <a href=\"https:\/\/docs.bokeh.org\/en\/latest\/index.html\">Bokeh<\/a>, for creating sophisticated interactive\napplications but when it comes to producing a self contained static document there is a surprising lack of\nsatisfying alternatives.<\/p>\n\n<p>This is the motivation behind <em>esparto<\/em>: a lightweight framework for producing well \nformatted pages with minimal effort. I like to think of it as a middle-ground between a Jupyter Notebook and a fully\nfeatured interactive dashboard.<\/p>\n\n<p>Esparto provides a streamlined API that lets users define their page in terms of sections, rows, and columns; \nand an intelligent wrapping system that automatically converts Python objects into content. \nThe grid system and components are borrowed from <a href=\"https:\/\/getbootstrap.com\/\">Bootstrap<\/a> to ensure documents adapt to viewing devices\nwith a clean and consistent style. At publishing time, the completed document is passed to <a href=\"https:\/\/palletsprojects.com\/p\/jinja\/\">Jinja2<\/a> and fed \ninto an HTML template with all style details and dependencies captured inline. There is also the option to save\nthe page as a PDF file through integration with <a href=\"https:\/\/weasyprint.org\/\">Weasyprint<\/a>.<\/p>\n\n<p>Esparto supports content rendering within Jupyter Notebooks, allowing users to interactively and iteratively build \ndocuments without disrupting their workflow.<\/p>\n\n<p>Please check out the <a href=\"https:\/\/domvwt.github.io\/esparto\/\">documentation<\/a> and <a href=\"https:\/\/github.com\/domvwt\/esparto\">GitHub repo<\/a> if you\u2019d like to learn more.<\/p>\n\n<h4 id=\"examples\">Examples<\/h4>\n\n<p><a href=\"https:\/\/domvwt.github.io\/esparto\/examples\/iris-report.html\">Iris Report - Data Analysis<\/a><\/p>\n\n<p><a href=\"https:\/\/domvwt.github.io\/esparto\/examples\/interactive-plots.html\">Interactive Plots - Bokeh and Plotly<\/a><\/p>","author":{"name":"Dominic Thorn","email":"dominic.thorn@gmail.com"},"category":[{"@attributes":{"term":"python"}},{"@attributes":{"term":"bootstrap"}},{"@attributes":{"term":"html"}},{"@attributes":{"term":"pdf"}},{"@attributes":{"term":"reporting"}}],"summary":"Simple HTML and PDF document generator for Python. GitHub - Docs - PyPI"},{"title":"aldentefier (fast.ai + FastAPI)","link":{"@attributes":{"href":"https:\/\/domvwt.github.io\/computer-vision\/deep-learning\/fastai\/fastapi\/docker\/2020\/12\/27\/aldentefier.html","rel":"alternate","type":"text\/html","title":"aldentefier (fast.ai + FastAPI)"}},"published":"2020-12-27T11:00:00+00:00","updated":"2020-12-27T11:00:00+00:00","id":"https:\/\/domvwt.github.io\/computer-vision\/deep-learning\/fastai\/fastapi\/docker\/2020\/12\/27\/aldentefier","content":"<p>Image classification API with a decoupled HTML \/ JS frontend and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a> \/ <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> backend.<\/p>\n\n<p><a href=\"https:\/\/github.com\/domvwt\/aldentefier-api\">GitHub<\/a> - <a href=\"https:\/\/domvwt.github.io\/aldentefier-api\">WebApp<\/a><\/p>\n\n<!--more-->\n\n<hr \/>\n\n<p>The aldentefier app was created to test the combination of <a href=\"https:\/\/www.fast.ai\/\">fast.ai<\/a> and <a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a> for producing a quick \nproof of concept service. Using the familiar Google <a href=\"https:\/\/cloud.google.com\/run\">Cloud Run<\/a> service for hosting the backend with a <a href=\"https:\/\/domvwt.github.io\/aldentefier-api\">static API \nportal<\/a> proved to be a useful setup, avoiding the long loading screen when the docker service needs to be cold \nstarted. The decoupling also means that, in a production setting, these services can be scaled independently. For example, \nif the prediction service is called from a number of different client applications.<\/p>\n\n<p>The image classification model was developed while following <a href=\"https:\/\/course.fast.ai\/\">practical deep learning for coders<\/a>.\nJeremy Howard and the team at <a href=\"https:\/\/www.fast.ai\/\">fast.ai<\/a> have produced some excellent, free courses on deep learning and AI ethics. \nThe application first approach to teaching is a welcome alternative to teaching from fundamentals and they\u2019ve been attracting\na lot of positive attention for their efforts in democratising AI and for the accomplishments of their students. \nI highly encourage anyone new to deep learning, or looking to quickly produce a working application, to \n<a href=\"https:\/\/www.fast.ai\/\">check out their page<\/a> and <a href=\"https:\/\/github.com\/fastai\/fastbook\">freely available book<\/a>.<\/p>\n\n<p><a href=\"https:\/\/fastapi.tiangolo.com\/\">FastAPI<\/a> is a web framework designed specifically for building API services. It\u2019s incredibly fast thanks to its \nasynchronous serving capability and robust due to its strongly enforced type safety. It even produces and serves \ninteractive API docs in <a href=\"https:\/\/swagger.io\/tools\/swagger-ui\/\">swagger<\/a> and <a href=\"https:\/\/redoc.ly\/\">redoc<\/a> formats right out of the box. Powered by \n<a href=\"https:\/\/www.starlette.io\/\">Starlette<\/a> and <a href=\"https:\/\/pydantic-docs.helpmanual.io\/\">Pydantic<\/a>, it\u2019s remarkably quick while being simple and satisfying to develop with.<\/p>\n\n<p>It should be noted that the model doesn\u2019t do a fantastic job of classifying user submitted photos (this was not a priority for the project\u2026) but it does make its guesses quickly and reliably!<\/p>\n\n<p><br \/><\/p>\n\n<p><a href=\"https:\/\/domvwt.github.io\/aldentefier-api\"><img src=\"\/assets\/aldentefier.png\" alt=\"aldentefier\" \/><\/a><\/p>","author":{"name":"Dominic Thorn","email":"dominic.thorn@gmail.com"},"category":[{"@attributes":{"term":"computer-vision"}},{"@attributes":{"term":"deep-learning"}},{"@attributes":{"term":"fastai"}},{"@attributes":{"term":"fastapi"}},{"@attributes":{"term":"docker"}}],"summary":"Image classification API with a decoupled HTML \/ JS frontend and FastAPI \/ Docker backend. GitHub - WebApp"},{"title":"SpotifySoundboard","link":{"@attributes":{"href":"https:\/\/domvwt.github.io\/plotly\/dash\/interactive\/visualisation\/spotify\/2020\/10\/21\/spotify-soundboard.html","rel":"alternate","type":"text\/html","title":"SpotifySoundboard"}},"published":"2020-10-21T11:00:00+00:00","updated":"2020-10-21T11:00:00+00:00","id":"https:\/\/domvwt.github.io\/plotly\/dash\/interactive\/visualisation\/spotify\/2020\/10\/21\/spotify-soundboard","content":"<p>Interactive dashboard application demonstrating the <a href=\"https:\/\/plotly.com\/dash\/\">Dash<\/a> framework with data from <a href=\"https:\/\/spotifycharts.com\/regional\">Spotify<\/a>.<\/p>\n\n<p><a href=\"https:\/\/github.com\/domvwt\/spotify-soundboard\">GitHub<\/a> - <a href=\"https:\/\/spotify-soundboard-kxyoqpiojq-nw.a.run.app\/\">WebApp<\/a><\/p>\n\n<!--more-->\n\n<hr \/>\n\n<p>The SpotifySoundboard web app was developed as a way of familiarising myself with <a href=\"https:\/\/cloud.google.com\/\">Google Cloud Platform<\/a> \nand the <a href=\"https:\/\/plotly.com\/dash\/\">Dash<\/a> framework for analytical application development. The project uses Google\u2019s <a href=\"https:\/\/cloud.google.com\/run\">Cloud Run<\/a>\nto host <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> containers for the live application and for the weekly update service. A combination of the \n<a href=\"https:\/\/cloud.google.com\/scheduler\">Cloud Scheduler<\/a> and <a href=\"https:\/\/cloud.google.com\/pubsub\/\">PubSub<\/a> messaging triggers the regular update and maintenance job.<\/p>\n\n<p>In addition to these cloud services, the application uses the <a href=\"https:\/\/docs.aiohttp.org\/en\/stable\/\">aiohttp<\/a> library to asynchronously send and\nprocess requests to the Spotify data API. For the weekly update this constitutes around 60 requests, one for each\ncountry included in the report. However, on a fresh deployment, many hundreds of requests must be managed as we\nbuild a data set of weekly streaming data for each country over a two year period. The <a href=\"https:\/\/github.com\/Tinche\/aiofiles\">aiofiles<\/a>\nlibrary helps manage asynchronous file writes, which although do not pose a serious bottleneck in this application\nwould be critical if we were to request larger files from the API.<\/p>\n\n<p><br \/><\/p>\n\n<p><a href=\"https:\/\/spotify-soundboard-kxyoqpiojq-nw.a.run.app\/\"><img src=\"\/assets\/spotify-soundboard.png\" alt=\"spotify-soundboard\" \/><\/a><\/p>","author":{"name":"Dominic Thorn","email":"dominic.thorn@gmail.com"},"category":[{"@attributes":{"term":"plotly"}},{"@attributes":{"term":"dash"}},{"@attributes":{"term":"interactive"}},{"@attributes":{"term":"visualisation"}},{"@attributes":{"term":"spotify"}}],"summary":"Interactive dashboard application demonstrating the Dash framework with data from Spotify. GitHub - WebApp"}]}