Let's make a leap in the manufacturing industry by utilizing the Web in addition to Python

background

Recently, the introduction of Python in the manufacturing industry is progressing. It is convenient for automation and application creation, and it seems that this momentum will not stop in the future.

However, I have been in charge of business for five years since I introduced Python at the factory, and in recent years I have been using Web technology more often. When I first started using Python, the __Web technologies were HTML and CSS? It doesn't really matter to me, who is the main data analyst, right? I thought it was __. However, in my practice, I realized that Python and web technology are very compatible, and recently I've been using half of the web and half of Python.

Article content

In this article, I would like to write that an engineer working in a factory discovered the importance of web technology. Perhaps the air these days is that Python is useful in the manufacturing industry, but it doesn't matter because the web is in a different field. However, I think that Python can be fully utilized only with Web technology. I would like to share what I discovered about the (surprising?) Importance of web technology as a result of introducing Python at a factory.

Constitution

As a composition ・ Organize the usage of Python in the manufacturing industry ・ About the importance of Web technology I would like to mention.

Python usage in manufacturing

It's a bit redundant, but I feel that there are three main uses for Python in the manufacturing industry. ・ Data shaping and business automation ・ Advanced data analysis ・ Production of business applications (including AI application production)

1. Data shaping and business automation

First is the first. In factories, I think that the files required for manufacturing are often managed by Excel. And I think that there are many tabulation work done by copying and pasting the data in some folder to Excel. The first use of Python is to automate this task. Data managed by csv can be read by Pandas, and Excel can also be operated, so the aggregation work can be completed in an instant. Since Python is a general-purpose programming language, it is encouraging to be able to automate all "procedural repetitive tasks" performed on a PC in principle.

2. Advanced data analysis

The second is advanced data analysis. I think that those who are used in research systems have many uses for this. Of course, you can do it offline, but hopefully you can automate advanced analysis. That is, in general

  1. Get data from the factory offline at first
  2. Analyze with your PC and report the result I think that there is a tendency for this flow to occur, but I think that Python can be used to automate this flow and incorporate it into the line. It is necessary to create the API described later, automate the data acquisition part, and create a library of analysis codes, but it is possible to automatically analyze the cause of defects for all production lots and predict the quality. Will be. You have a dream that you can use the analysis code as if you were living in the factory, not just offline.

3. Business application production

The third is business application production. I'm sorry for myself, but when I started using Python, I used it mainly for automating my work, but gradually my desires became uncontrollable. It is a desire to "use the created application around". I think there are quite a few, so I think that creating business applications is also a common pattern for using Python in the manufacturing industry. Or maybe there is a business that has recently implemented AI. And the reason why I thought it was necessary to utilize Web technology was in this third application.

The need for web technology

If you create a GUI with Python, you have to prepare the same environment for everyone who uses it. If it's about a single digit, it can be managed, but as the number of people increases, the effort increases and it becomes painful. However, when it was made into an executable file, it was not easy to use because it became large in size, failed to compile, and could not be debugged. Therefore, I faced the issue of how to prepare a server PC, complete the environment construction with only one of them, and enable the user to provide services by accessing it. As the use of Python progresses, this need will grow, and I think the need for Web technology will emerge.

In addition, the second __ is the merit of utilizing Web technology in advanced data analysis __.

A. Offline analysis of the handed data B. Incorporate analysis code into the line and automatically output results for all lots

I think the difference is big, because the Web is very useful for the latter.

Other benefits of implementing the Web

In other words, the introduction of Web technology enables the following two points necessary for automating analysis. ・ Formatted data can be distributed via API (the base of data utilization expands) ・ You can even create smartphone apps that utilize data collected at the head office or on-site (applications that utilize data can be developed regardless of the execution environment).

Formatted data can be delivered via API

As mentioned in the first use of Python, I think that the use of data formatting is the royal road to using Python. Then, when I thought about using the formatted data, I realized that it would be extremely convenient if I hit the Web browser and the data was returned. In short, it is delivered by Web API. I think that an environment where data can be obtained without permission by hitting the API by specifying the lot and the number of data is also very useful for automating analysis. I don't know if it's just Python, but I don't know if it ended up with data organization, but by creating an API, it will be possible to make the data aggregated by Python accessible from other offices and to use it more widely. .. Personally, I like the API of the backend with Flask and the frontend is a cross-platform framework Angular or React. But now I might start with Vue.js.

You can also make a smartphone app to use in the field

This was the discovery. When it comes to web technology, the image of a static site of HTML and CSS was strong, but recently there seems to be a technology called SPA (single page application), and if you use SPA, you can make something equivalent to a desktop application ( There is also a word called PWA (Progressive Web App) that is often used as a set with SPA. I understand that it is expressed as PWA when expressing the properties of things made with the technology called SPA, so in context. PWA may be more accurate than SPA) (Note 1). Frameworks such as Angular, React, and Vue are such, but since these make full use of JSX, which is an extension language of TypeScript and JavaScript, it is an image of application development rather than HP production. This allows you to create desktop apps like TKinter, PysimpleGUI, PyQt, etc. on the web as well. In addition, Angular, React, and Vue are cross-platform. In other words, it is possible to output not only to web apps but also to Android and iOS apps (!) (Note 2). As a result, while ensuring user accessibility via the browser, it will be possible for the app to be used in places that cannot be accessed by the browser (= on-site, for example). This is an unexpected discovery found by introducing the Web, and I think that Python alone could only develop an application that runs on the staff's PC, but by introducing the Web, it can be used by many people and situations. I got the development method of. The backend is still written in Python, but the frontend has benefited greatly from moving to the web.

Summary

It's a bit verbose, but if you use Web technology as described above, you can use the data created in Python more widely, and you can reduce the time and effort required to improve the environment due to the spread of Python. With the help of the Web, even for advanced analysis using Python, which has been attracting attention in recent years, it is possible to build a mechanism that automatically performs it for all lots and makes use of it throughout the factory, not just offline. I think that Python is becoming more widespread in the manufacturing industry, but it is easy to recognize that the field of the Web is different. However, I think that the range of utilization will expand if there is a Web, so please consider it.

If you find this article useful, please LGTM: thumbs up: Let's do our best to utilize IT in the manufacturing industry!

Note 1: What are PWA and SPA? Note 2: What is cross-platform?

Article 1 explained on the personal site (Angular is recommended for system development for individuals and small groups) % e3% 83% bb% e5% b0% 91% e4% ba% ba% e6% 95% b0% e3% 81% ae% e3% 82% b7% e3% 82% b9% e3% 83% 86% e3 % 83% a0% e9% 96% 8b% e7% 99% ba% e3% 81% ab% e3% 81% afangular% e3% 81% 8c% e3% 82% aa% e3% 82% b9% e3% 82 % b9% e3% 83% a1 /) [Article 2 explained on the personal site (the reason why the combination of python and angular is the strongest)](https://np-sys.com/general/python%e3%81%a8angular%e3%81%ae%e7 % b5% 84% e3% 81% bf% e5% 90% 88% e3% 82% 8f% e3% 81% 9b% e3% 81% 8c% e6% 9c% 80% e5% bc% b7% e3% 81 % aa% e7% 90% 86% e7% 94% b1 /) Monaca Article [Book 1 I studied (Yano-san's Angular book. React version may be good. I think Vue.js is also a good book)](https://www.amazon.co.jp/Angular%E8% B6% 85% E5% 85% A5% E9% 96% 80-% E6% 8E% 8C% E7% 94% B0-% E6% B4% A5% E8% 80% B6% E4% B9% 83 / dp / 4798057738 / ref = sr_1_12? dchild = 1 & qid = 1605096458 & s = books & sr = 1-12) [Study Book 2 (Angular is used on an Ionic basis)](https://www.amazon.co.jp/Ionic%E3%81%A7%E4%BD%9C%E3%82%8B-%E3% 83% A2% E3% 83% 90% E3% 82% A4% E3% 83% AB% E3% 82% A2% E3% 83% 97% E3% 83% AA% E5% 88% B6% E4% BD% 9C% E5% 85% A5% E9% 96% 80-Angular% E7% 89% 88-iPhone-Android% E5% AF% BE% E5% BF% 9C / dp / 4863542925 / ref = asc_df_4863542925 /? Tag = jpo -22 & linkCode = df0 & hvadid = 342438969336 & hvpos = & hvnetw = g & hvrand = 7085597672568741271 & hvpone = & hvptwo = & hvqmt = & hvdev = c & hvdvcmdl = & hvlocint = & hvlocphy = 1009482 & hvtargid = pla-846810

Recommended Posts

Let's make a leap in the manufacturing industry by utilizing the Web in addition to Python
Let's make a web framework with Python! (1)
Let's make a combination calculation in Python
Let's make a web framework with Python! (2)
How to sort by specifying a column in the Python Numpy array.
Make a copy of the list in Python
I searched for the skills needed to become a web engineer in Python
Try to make a Python module in C language
I want to write in Python! (2) Let's write a test
Try to make a blackjack strategy by reinforcement learning (② Register the environment in gym)
Make a bookmarklet in Python
[Python] How to make a list of character strings character by character
Change the standard output destination to a file in Python
Let's make a spot sale service 4 (in Python mini Hack-a-thon)
Put the lists together in pandas to make a DataFrame
How to get the last (last) value in a list in Python
I tried to make a stopwatch using tkinter in python
I want to make input () a nice complement in python
I made a class to get the analysis result by MeCab in ndarray with python
Run the output code on the local web server as "A, pretending to be B" in python
How to determine the existence of a selenium element in Python
How to make a string into an array or an array into a string in Python
Let's make a GUI with python.
How to check the memory size of a variable in Python
Read the standard output of a subprocess line by line in Python
In the python command python points to python3.8
[Introduction to Python] How to use the in operator in a for statement?
How to check the memory size of a dictionary in Python
[Python] Make the function a lambda function
Hit the web API in Python
Let's prove the addition theorem of trigonometric functions by replacing the function with a function in SymPy (≠ substitution)
I wrote a script to extract a web page link in Python
I tried to find out the difference between A + = B and A = A + B in Python, so make a note
Let's make a web chat using WebSocket with AWS serverless (Python)!
Let's use Python to represent the frequency of binary data contained in a data frame in a single bar graph.
Get a capture of the entire web page in Selenium Python VBA
A memo organized by renaming the file names in the folder with python
Let's throw away JavaScript and write a web front end in Python!
[Ev3dev] Let's make a remote control program by Python with RPyC protocol
I made a program to check the size of a file in Python
A note I looked up to make a command line tool in Python
What is the fastest way to create a reverse dictionary in python?
I want to make a web application using React and Python flask
Let's make a shiritori game with Python
[Python] How to make a class iterable
Write the test in a python docstring
Run the Python interpreter in a script
Let's make a voice slowly with Python
How to get a stacktrace in python
Read the file line by line in Python
I tried to make a Web API
Let's make a Twitter Bot with Python!
Even a new graduate engineer can do it! The trick to make a difference in synchronization by commenting out
"Cython" tutorial to make Python explosive: Handling when a function on the C ++ side is passed by reference.
Various ways to read the last line of a csv file in Python
Let's make an A to B conversion web application with Flask! From scratch ...
[Python] Created a class to play sin waves in the background with pyaudio
Make the library created by Eigen in C ++ available from Python with Boost.Numpy.
How to read all the classes contained in * .py in the directory specified by Python
Use libsixel to output Sixel in Python and output a Matplotlib graph to the terminal.
[python] How to sort by the Nth Mth element of a multidimensional array