<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Python on Data Artisans</title><link>https://dataartisans.tech/tags/python/</link><description>Recent content in Python on Data Artisans</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 07 Jul 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://dataartisans.tech/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Python: Presenting Data with Streamlit</title><link>https://dataartisans.tech/python-presenting-data-with-streamlit/</link><pubDate>Sun, 07 Jul 2024 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-presenting-data-with-streamlit/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;You have all your data ready to go. It has been cleansed and transformed to all your needs. Now you need to make it easy to consume by your target audience. In this scenario our users can be just about anyone. We need to make the data easy to access and even easier to navigate.&lt;/p&gt;
&lt;p&gt;Challenge accepted!&lt;/p&gt;
&lt;h2 id="tooling"&gt;Tooling&lt;/h2&gt;
&lt;p&gt;As the title suggests we are going to be using &lt;a href="https://pypi.org/project/streamlit/"&gt;Streamlit&lt;/a&gt; to present our data. If you aren&amp;rsquo;t familiar with Streamlit I suggest you take a tour of their &lt;a href="https://streamlit.io/"&gt;website&lt;/a&gt; or &lt;a href="https://github.com/streamlit/streamlit"&gt;GitHub repo&lt;/a&gt; to see what they have to offer. I chose Streamlit because it offers the ability to get a small project like this off the ground very quickly. We will also be using &lt;a href="https://pandas.pydata.org/"&gt;Pandas&lt;/a&gt;, and this will all be running on Python 3.12.2.&lt;/p&gt;</description></item><item><title>Python: Extract Data From PDF</title><link>https://dataartisans.tech/python-extract-data-from-pdf/</link><pubDate>Fri, 05 Jul 2024 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-extract-data-from-pdf/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;True story, the town I live in recently had some issues around the town budget. As I started to get involved I wanted to look at the data provided by our Board of Finance. To my misfortune, I found myself trying to analyze data in a PDF. Trying to do any sort of analysis on it was time consuming and frustrating. To make the data useful I needed to extract data from PDF and into something more flexible, in this case a simple CSV will do. Here is a sample of what we are working with:&lt;/p&gt;</description></item><item><title>Python &amp; SQL Server: Manage Database Transactions</title><link>https://dataartisans.tech/python-sql-server-manage-database-transactions/</link><pubDate>Sun, 14 Jan 2024 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-sql-server-manage-database-transactions/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;In our &lt;a href="https://dataartisans.tech/python-sql-server-bulk-loading-data/"&gt;last post&lt;/a&gt; we used &lt;a href="https://www.sqlalchemy.org/"&gt;SQLAlchemy&lt;/a&gt; to bulk load data into SQL Server. Now that we can bulk load data we want to perform other actions on our database. In todays post we want follow a common loading strategy and &lt;a href="https://learn.microsoft.com/en-us/sql/t-sql/statements/truncate-table-transact-sql?view=sql-server-ver16"&gt;TRUNCATE&lt;/a&gt; the target table before loading it. Adding this functionality to our script leaves us with a choice to make in how we want to execute our SQL statements and manage database transactions.&lt;/p&gt;</description></item><item><title>Python &amp; SQL Server: Bulk Loading Data</title><link>https://dataartisans.tech/python-sql-server-bulk-loading-data/</link><pubDate>Sun, 19 Nov 2023 00:00:00 +0000</pubDate><guid>https://dataartisans.tech/python-sql-server-bulk-loading-data/</guid><description>&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;You have a bunch of data and need to load it into SQL Server using Python. With the abundance of options out there its difficult to know what the best tool is to use. Lets approach the problem with two requirements. The solution needs to be &lt;strong&gt;easy to implement&lt;/strong&gt; and &lt;strong&gt;blazing fast&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id="tooling"&gt;Tooling&lt;/h2&gt;
&lt;p&gt;Initially &lt;a href="https://pypi.org/project/bcpandas/"&gt;bcpandas&lt;/a&gt; looked like a great solution for this task. While it does fit our two requirements, it becomes very difficult to work with for data that contains multiple separators or any odd strings. If the data you work with is like mine it is almost never perfect. I quickly pivoted away from this due to its inability to handle imperfect data.&lt;/p&gt;</description></item></channel></rss>