![]() You may also have to open a spreadsheet, read the information in it and, according to some business logic, append more data to it.įor example, using the online store scenario again, say you get an Excel spreadsheet with a list of users and you need to append to each row the total amount they’ve spent in your store. That’s gonna earn you an extra slice of cake at your company’s next birthday party! Appending Information to an Existing Spreadsheet What can you do to help? Well, you can make a quick script using openpyxl that iterates over every single User record and puts all the essential information into an Excel spreadsheet. However, they don’t have access to the Database, or they don’t know how to use SQL to extract that information easily. Now, the Marketing team wants to contact all users to give them some discounted offer or promotion. Say you have a Database table where you record all your users’ information, including name, phone number, email address, and so forth. Exporting Database Data Into a Spreadsheet Now, to import the data, you’ll have to iterate over each spreadsheet row and add each product to the online store. You are responsible for tech in an online store company, and your boss doesn’t want to pay for a cool and expensive CMS system.Įvery time they want to add new products to the online store, they come to you with an Excel spreadsheet with a few hundred rows and, for each of them, you have the product name, description, price, and so forth. This article is written for intermediate developers who have a pretty good knowledge of Python data structures, such as dicts and lists, but also feel comfortable around OOP and more intermediate level topics.įirst things first, when would you need to use a package like openpyxl in a real-world scenario? You’ll see a few examples below, but really, there are hundreds of possible scenarios where this knowledge could come in handy. Create simple or more complex spreadsheets, including adding styles, charts, and so on. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |