Do you know how to use Python + SeaTable?

What do you use Python for? Since it is Python, there are many things you can do with it, including crawlers, automated scripts, machine learning, etc. But in fact, for many non-professionals, it is difficult to achieve some interesting or useful goals and results using Python alone. For example, you can use Python to capture data and create applications such as maps and galleries, or even share and collaborate on it. If you then use Python to create a web page for visualization and sharing, it will be more complicated and difficult to maintain. And if used in combination with SeaTable tables, it will be very convenient and can help you easily implement many ideas and applications. It is also free to use, can use the cloud version, and can also be deployed privately.
SeaTable is a new digital platform based on smart tables. Flexible business systems and applications can be built.

1. Introduction to Python + SeaTable table

SeaTable is a new digital platform based on online collaborative tables. It combines the ease of use of collaborative tables with the powerful data processing capabilities of a database. It supports rich data types such as "File", "Picture", "Radio Selection", "Collaborator" and "Formula", which can help us organize and manage various information in the form of tables. Based on tables, it also supports rich extended functions such as customized workflow, application building, and data analysis, allowing you to quickly build flexible business systems and software applications. Rich data types, rich plug-ins, external applications

Furthermore, SeaTable provides: Python API, multi-condition data deduplication, various automatic data processing, automation rules, reminder rules, buttons, various visualization plug-ins, SQL query plug-ins, page design plug-ins, advanced statistics, and various Rich functions such as external applications are practical and easy to use. It can meet the integrated use of the whole process of data collection, collection, processing, statistical analysis, visualization, sharing, and application production. Take scripts as an example. It provides a running environment for Javascript and Python scripts. We can manage scripts and data in a table without having to find a separate server. Moreover, multiple script files can be stored in the table according to different needs. With one click, you can achieve the desired effect and easily automate data processing. script

For example, when we usually use Python scripts to write some small applications, how to save, display and share data is a very troublesome place. However, if we use SeaTable, a collaborative table, we can effectively simplify the development of small applications. With its own Python script running environment, we can manage scripts and data in one place instead of finding a separate server, saving a lot of costs. It can be summarized as follows: In the SeaTable table, multiple script files can be stored and executed with one click. In the SeaTable table, you can use the "Automation Rules" function to set up regular runs for the views of the sub-tables in the table (such as default views, other views with filtering and other conditions set), such as daily, weekly, monthly, and can be configured accordingly. Choose specific points. In the SeaTable table, you can add a "button" type column to call and run scripts with one click, making the table more like an application. Add automation rules to run scripts Add automation rules to run scripts Use the "Button" column to call and run scripts

2. Python + SeaTable table application scenarios

(1) Obtain company financing and other information from the Qixinbao website and generate visual data analysis charts

Case: This case is based on the real needs of an investment company. The investment company obtains the financing information of each company into the SeaTable table through Qixinbao's external API interface, and completes cross-table linking, calculation, and automatic data visualization analysis. SeaTable: Python + SeaTable | Get company financing and other information from the Qixinbao website to the SeaTable table

1. Data synchronization

First, write basic company information in the form, using the company name and unified credit code as basic data. As shown in the "Company" subtable in the figure below: Add the table and fill in the basic information. Next, create a subtable "Financing Information" in the table for subsequent filling in the obtained financing and other information. Then insert columns into this sub-table, such as financing round, unified credit code, financing date, financing amount, etc. As shown below: Create a sub-table and insert columns. Then, use the unified credit code in the "Company" sub-table to request data from Qixinbao's API. At this time, you need to apply for the APP_KEY and SECRET_KEY of the API on Qixinbao yourself, and at the same time, you need to add the local IP address to Qixinbao's IP whitelist. After completing these preparations, you can use Python combined with the relevant API of SeaTable to write financing data. The following is the algorithm logic of data synchronization: for each company in the "Company" sub-table, use Qixinbao API to obtain the company's financing data, including financing amount, financing round, financing date, etc. Compare the "Financing Information" subtable: If a certain financing record does not exist, then add it; if it exists, but the information in the table is inconsistent, then the information in the table is considered to have been manually updated by the user and will not be modified; if it has been exists, and the information is consistent, it will not be processed. get

2. Data processing (automatically link related records of two sub-tables)

After completing the data acquisition and synchronization, you can use the "Automatically add link" in the "Data Processing" function of SeaTable to match the rules of the "Unified Credit Code" columns of the "Company" and "Financing Information" sub-tables. To quickly add link records to these two sub-tables with one click to achieve the purpose of association. The operation is as follows: Click the "···" button in the table toolbar, select "Automatically add link" in "Data Processing" (there are a variety of data processing operations), as shown below: Automatically add a link and then select two according to the matching rules . The "Uniform Credit Code" columns in the sub-table are equal, and then click Run. As shown below: After running "Automatically Add Link" with one click and clicking Run, the two sub-tables will automatically generate link columns and associate the corresponding records at the same time. That is, the "Company" table will automatically be associated with all financing records of each unified credit code in the "Financing Information" table. As shown in the "Financing Information" column in the figure below (click the record in the cell to view and edit row details). As shown below: Automatically link associated records. At the same time, the "Financing Information" table will also automatically link to the associated records in the "Company" table, that is, each row of financing records is associated with which company it belongs to (click in the "Company" column cell records, you can enter to view and edit details). As shown below: Automatically link associated records

3. Quickly analyze data statistically and generate various visual charts

In the SeaTable table, as shown in the figure above, you can filter out data from different angles by adding a table view to facilitate quick switching of views. In addition, this also facilitates data analysis and visualization of data (views) from different angles. For example, you can use the "Statistics" function of the table to quickly create statistical tables and basic charts; use the "Advanced Statistics" plug-in (added with one click from the "Plugins" on the right side of the table) to quickly create a richer variety of statistical analysis charts. Complete more dimensions and forms of data visualization for financing tables. Charts can be exported. As shown below: Advanced statistics large-screen dashboard

(2) Use Python to grab Winter Olympics city information from Wikipedia and create a map

Case: Use Python to grab city data from Wikipedia, then automatically fill it into the SeaTable table, and use the visualization plug-in of the SeaTable table to automatically generate maps, galleries, etc. (See the case link below for code details) SeaTable: Python + SeaTable | Use Python to grab Winter Olympics city information from Wikipedia and create a map

1. Automatically obtain the city's longitude and latitude into the "Latitude and Longitude" field of the table

Obtaining information from web pages requires some simple python crawler technology. This task is implemented using the Python modules of requests and beatifulsoup. The requests module can simulate online requests and return a section of html DOM tree. beatifulsoup obtains the desired information in the tag by parsing the DOM tree. Taking the longitude and latitude of a city in Wikipedia as an example, the structure of the DOM tree is as follows:

2. Automatically obtain city pictures into the "City Pictures" field of the form

In addition to knowing the longitude and latitude information, this task also needs to download a picture and transfer it to the table. Similarly, the picture is the same as the longitude and latitude, and its original information can also be found in the DOM tree: The following is automated by running the script From the table results of written data, it can be seen that compared to searching online and manually filling in each row of data, the automated operation of the script can save a lot of time, and is accurate and efficient.

3. Use table map and gallery plug-ins to automatically generate city maps and galleries respectively.

(3) Synchronize server logs to SeaTable to allow better visualization and collaborative processing of logs

Case: Through filebea, Redis and Python scripts, we can collect logs from multiple servers into a table in SeaTable. Through the filter conditions and multi-view function of the table, we can easily analyze and view the logs. Through shared collaboration functions, collaborative processing by multiple people can be achieved.

3. Summary

As a new collaborative table and digital platform, SeaTable is not only feature-rich, but also easy to use. When we usually use Python to implement some programs, we can flexibly combine the functions of SeaTable tables, thereby saving time and labor costs in programming, development, maintenance, etc., and realizing more interesting things and more complete applications quickly and conveniently. The above cases serve as inspiration. I hope you can share more uses of Python + SeaTable to improve work efficiency! Make Python better!

Guess you like

Origin blog.csdn.net/Everly_/article/details/133177113