Andrejus Baranovski

Subscribe to Andrejus Baranovski feed
Blog about Oracle, Full Stack, Machine Learning and Cloud
Updated: 5 hours 51 min ago

Best Platform for Python Apps Deployment - Hugging Face Spaces with Docker

Thu, 2023-01-05 14:52
I walk through Hugging Face Spaces Docker SDK deployment option. I was using it to deploy our Streamlit/Python app Sparrow. So far very happy with Spaces Docker SDK - simple setup, very stable and good runtime performance, HTTPS out of the box, content compression out of the box too.

 

File Upload/Download in Streamlit/Python

Mon, 2022-12-19 02:55
File upload/download is supported by Streamlit out of the box. There are a few hints to share about more effective file upload implementation. You will learn how to wrap the file upload widget with Streamlit form, use Submit button to confirm the upload and reinitialize the upload widget. Additionally, I will show you an example of how to download JSON file from the server with Streamlit download component.

 

Dependent UI Widgets in Streamlit/Python

Mon, 2022-12-12 08:35
This video explains how to implement dependent UI widgets refresh in Streamlit/Python, when the value changes. I'm using Streamlit Empty widget as a placeholder to update selectbox with a new entry, after the new file upload. Selectbox displays the list of uploaded files.

 

Invoice Annotation with Sparrow/Python

Sun, 2022-12-04 07:52
I explain our Streamlit component for invoice/receipt document annotation and labeling. It can be used either to create new annotations or review and edit existing ones. With this component you can add new annotations directly on top of the document image. Existing annotations can be resized/moved and values/labels assigned. 

This component is part of Sparrow - our open-source solution for data extraction from invoices/receipts with ML.

 

Responsive UI with Streamlit/Python

Mon, 2022-11-28 01:28
I explain how to get current UI width info in Streamlit and use this value to calculate number of columns to be generated for the form block. Streamlit is server side UI framework and it runs on Python.

 

Calling JavaScript from Streamlit/Python

Sun, 2022-11-20 14:30
Streamlit is Python framework, it helps to build UI with low code approach. Code runs on server and there is no functionality, which would allow to inject client side events with JavaScript. Luckily there is a 3rd-party Streamlit component, it allows to make JavaScript calls from server side Python code. Response from such JavaScript call is received within the same Streamlit execution, this makes it possible to use values returned from JavaScript in Python logic. In this example, I show one liner JavaScript call to get UI screen width, to be able to calculate layout structure adjustments in Python, based on the screen size.

 

Building Streamlit/Python Dynamic Forms

Sat, 2022-11-12 00:51
Streamlit is great to build Web UIs for data apps. Dynamic UIs are common requirement for data apps. Data structures usually dynamic, set of attributes is changing and this requires dynamic UI. I explain how to generate dynamic forms with Streamlit. It works very smooth.

 

Streamlit/Python Drawable Canvas - Element Selection (React JS)

Sun, 2022-11-06 16:05
With Streamlit component you can render canvas and draw. I explain how this canvas component implements object selection and passes data from React canvas to Streamlit.

 

Understanding Streamlit/Python Application Flow

Sun, 2022-10-30 15:57
Streamlit re-executes Python script, each time when the request is sent to the server. You should keep this in mind when building Streamlit apps. There are scenarios when you want to make sure code is not executed on subsequent call. You can control this with Streamlit session object.

 

Streamlit/Python Handling Fast Data Entry

Sun, 2022-10-23 14:30
I explain how to enable fast data entry in Streamlit with form component. By default, Streamlit input components execute server call on data change. When wrapped by form component, changes are sent to the server in batch, when Save button is pressed.

 

Streamlit Python/React for Image Annotation

Sun, 2022-10-16 14:16
Data annotation is important step in ML model training process. With data annotation tool you can build a dataset and use it to train or finetune the model. There are Streamlit components available to draw on top of images using canvas. In this video I explain how to use these components. How to run them locally to be able to add changes based on your own functionality requirements.

 

Streamlit Python App Setup

Sun, 2022-10-09 14:18
I explain my experience setting up the new Streamlit app for development. I share several best practices and hints on how to make application code readable and maintainable. I talk about the development process with Streamlit and why it is a good choice to build UI for new products.

 

Django Python with Oracle JET UI Table

Mon, 2022-10-03 14:10
Oracle JET provides a large set of UI components for enterprise apps. I explain how you can display data from Django with Oracle JET table. Data is injected into Django HTML template on the server side and later consumed by JET UI component.

 

HTMX: Events and Triggers - Django CRUD, part 5

Mon, 2022-09-26 08:16
Refreshing dependent fragments with data is a very common use case in enterprise applications. In this example, data is changed in editable form. If data is saved to DB successfully through Django backend, we raise HTMX event and with HTMX trigger refresh dependent readonly table to display the latest data.

 

HTMX: Saving Form Changes - Django CRUD, part 4

Wed, 2022-09-21 03:29
I explain how to run POST request through HTMX attribute on HTML form tag to save form changes to the backend. You will see how to report validation errors through HTMX response.

 

HTMX: Fetch Edit Form Data - Django CRUD, part 3

Sun, 2022-09-11 13:41
HTMX makes it possible to call the backend from HTML without JavaScript. You can add HTMX attribute to HTML tag, for example, button, and call backend endpoint. HTMX can process HTML fragment response and inject it into the Web page. This allows achieving partial page refresh, without full page reload.

Python Django Model Form - Django CRUD, part 2

Sun, 2022-09-04 10:25
I explain how to generate UI in Django on top of Model Form. You can define Model Form with Django Model and inherit model attributes and constraints. Model Form makes it simple not only to render the form, but also control validation and data processing phases.

 

Python Django CRUD part 1 - Data Model and Constraints

Sun, 2022-08-28 22:56
In this episode of Django CRUD, I will explain how to define a data model in Django and set up constraints to ensure data validity. These constraints will be applied automatically when data will be updated from the UI.

 

Dynamic UI in Django with Alpine.js

Mon, 2022-08-15 08:11
Django generates static HTML UI, this requires a full request submit to the server. But you can build dynamic UI's, by including and using Alpine.js library. With Alpine.js you can open dialogs, hide content or disable UI controls. This helps to improve Django app UI usability.

 

The old old coolness - HTMX | Execute HTTP request directly from HTML tag

Sat, 2022-08-06 13:47
Developing a modern Web app with Django and Tailwind? Thinking of using React, Vue, or another fancy JS library for UI implementation? I would recommend spending some time and trying HTMX. With HTMX you can execute partial requests and return HTML content to replace web page regions. HTMX properties are defined directly on HTML tags, this makes it easy to use and flexible.

 

Pages