<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Madison Ostermann on Medium]]></title>
        <description><![CDATA[Stories by Madison Ostermann on Medium]]></description>
        <link>https://medium.com/@madisonostermann?source=rss-3c0585509282------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_nO68gYvnDMsqij4VRYRbQ.jpeg</url>
            <title>Stories by Madison Ostermann on Medium</title>
            <link>https://medium.com/@madisonostermann?source=rss-3c0585509282------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:23:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@madisonostermann/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Solving the Data Dilemma: Efficiently Load CSV Data into a SQL Database]]></title>
            <link>https://madisonostermann.medium.com/solving-the-data-dilemma-efficiently-load-csv-data-into-a-sql-database-55d363856235?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/55d363856235</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 21:06:53 GMT</pubDate>
            <atom:updated>2022-03-20T21:06:53.441Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3PviYTebmlRhAuXR" /><figcaption>Photo by <a href="https://unsplash.com/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You’re probably reading this article because you have a similar challenge to the one I had — you need to get data from a spreadsheet into a SQL database. Pick your poison, but Python is a great tool to accomplish this.</p><p>This article will compare not one but <strong>FOUR</strong> ways to write data from a spreadsheet into a SQL table with Python in order to determine the most efficient method.</p><h3>Connect to SQL</h3><p>If you haven’t already connected to SQL in Python, you’ll want to do that. If you’re not sure how, I have a <a href="https://towardsdev.com/connecting-to-a-sql-server-from-linux-mac-osx-with-python-3daf1dba6558">separate article</a> on how to do this!</p><p>Once you’re set, your code should look somewhat like this:</p><pre># PACKAGES<br>import pyodbc<br>from getpass import getpass</pre><pre># INPUTS<br>username = input(&quot;Username: &quot;)<br>password = getpass(&quot;Password: &quot;)<br>database = input(&quot;Database Name: &quot;)<br>schema = input(&quot;Schema: &quot;)<br>table = input(&quot;Table: &quot;)<br>dsn = input(&quot;DSN Name: &quot;)</pre><pre># CONNECT TO DATABASE<br>conn = pyodbc.connect(&quot;DSN=&quot;+dsn+&quot;;UID=&quot;+username+&quot;;PWD=&quot;+password)<br>print(conn)</pre><p><em>Note: I’m on Mac and had lots of configuration troubleshooting that ultimately led me to use a combination of a DSN and UN/PW to connect. If you’re on Windows, you might be using a different driver or credentials setup, so don’t worry if this looks a little bit different but still works.</em></p><p>Hopefully you get an output that looks something like:</p><pre>&lt;pyodbc.Connection object at 0x7f847b10ef10&gt;</pre><h3>Read Spreadsheet</h3><p>If you have an excel workbook:</p><pre># PACKAGES<br>import pandas as pd</pre><pre># READ EXCEL FILE<br>df = pd.read_excel(&quot;my_data.xlsx&quot;, dtype=str)</pre><p>If you have a CSV:</p><pre># PACKAGES<br>import pandas as pd</pre><pre># READ CSV FILE<br>df = pd.read_csv(&quot;my_data.csv&quot;, dtype=str)</pre><h3>Write to the SQL Database</h3><blockquote><em>So here’s where it gets tricky; there are a lot of packages and methods through which you can write the contents of the dataframe to the database.</em> But they are not all made equal.</blockquote><h4>Method 1: BULK INSERT (PERMISSIONS MIGHT RESTRICT)</h4><p>There are security concerns around allowing developers the ability to use the BULK INSERT query, so if you’re using an organizational database you probably won’t be able to use this method. However, if you can, this is the code you’d want to try:</p><pre>cursor = conn.cursor()<br>cursor.execute(&quot;BULK INSERT &quot;+schema+&quot;.&quot;+table+&quot; FROM &#39;my_data.csv&#39;&quot;)<br>conn.commit()</pre><p>I’m not able to try this out, so let me know in the comments if you’re able to do this and how it performs against the other methods.</p><h4>Method 2: Loop + Single Execute + INSERT INTO (SLOW)</h4><p>This is the most basic and least optimal approach, so I would not recommend it, but it would be remiss of me to exclude this method from the list.</p><pre>chunk = df.values.tolist()<br>tuple_of_tuples = tuple(tuple(x) for x in chunk)<br>cols = (&quot;?,&quot;*df.shape[1])[:-1]<br>cursor = conn.cursor()<br>for t in tuple_of_tuples:<br>   cursor.execute(f&quot;INSERT INTO &quot;+schema+&quot;.&quot;+table+&quot; VALUES ({cols})&quot;, t)<br>conn.commit()</pre><p>Rule of thumb: before resigning yourself to looping through dataframe rows for reading/writing, check the documentation and stackoverflow forums for more efficient solutions.</p><h4>Method 3: Execute Many + INSERT INTO (DEPENDS ON DRIVER)</h4><p>If you have a connection to the SQL database using the ODBC driver, you’re one of the lucky ones.</p><p>I tried the following code and it failed, giving me a <em>segfault</em> error. After some research, I found that this was because fast_executemany = True uses an ODBC feature called “parameter arrays” and that feature is not supported FreeTDS and some other ODBC drivers.</p><p>However, one of my Windows-using teammates was able to run this with success.</p><pre>chunk = df.values.tolist()<br>tuple_of_tuples = tuple(tuple(x) for x in chunk)<br>cols = (&quot;?,&quot;*df.shape[1])[:-1]<br>cursor = conn.cursor()<br>cursor.fast_executemany=True<br>cursor.executemany(f&quot;INSERT INTO &quot;+schema+&quot;.&quot;+table+&quot; VALUES ({cols})&quot;, tuple_of_tuples)<br>conn.commit()</pre><h4>Method 4: SQL Alchemy “to_sql” (WINNER?)</h4><p>This method requires a little bit more setup, but the actually write operation is only <em>one line</em> of code. Too good to be true? Spoiler: it’s not!</p><p>First you need to create an engine object using SQL Alchemy by substituting in your credentials and database details. What this looks like will depend on how you connect to your database — I recommend having a DSN in your configuration files for ease and security in your code.</p><p>Once the engine is created, it’s only one line to write the data frame (e.g. your spreadsheet as a Python object) to the SQL table. Your parameters should be as follows:</p><ul><li>con = engine you just created (con = connection)</li><li>name = SQL table to which you’re writing data</li><li>schema = SQL schema that the table is in</li><li>if_exists = what to do if the table already exists — I have it dropping the old data and inserting entirely fresh data (hence &#39;replace&#39; in my code), but you can have it &#39;fail&#39; if you don’t want any data to be written, or &#39;append&#39; if you want to add data to the existing data.</li><li>index = whether or not to write the index column from the data frame</li><li>chunksize = the number of rows to be written to the table at once — this parameter tripped me up at first. Default behavior is to write all rows at once, however there is a limit on the number of fields it can write at once (chunksize = (number of rows * number of columns) / limit))</li><li>method = <strong>this one matters the most!!!</strong> If you leave it blank, the default is for it to use single INSERT calls, which is exactly the same as using Method #2 (slow). Using &#39;multi&#39; will pass multiple values into a single INSERT call and drastically speeds it up!!!</li></ul><pre># PACKAGES<br>import sqlalchemy</pre><pre># CREATE ENGINE - MAC WITH DSN<br>engine = sqlalchemy.create_engine(&quot;mssql+pyodbc://&quot;+username+&quot;:&quot;+password+&quot;@&quot;+dsn, connect_args={&quot;database&quot;: database})  <br>  <br># CREATE ENGINE - WINDOWS WITH NO DSN<br>server_name_or_ip = &quot;XXX.XXX.XXX.XXX&quot;<br>engine = sqlalchemy.create_engine(&quot;mssql+pyodbc://&quot;+server_name_or_ip+&quot;/&quot;+database+&quot;?trusted_connection=yes&amp;driver=ODBC+Driver+17+for+SQL+Server&quot;)</pre><pre>df.to_sql(con=engine, name=table, schema=schema, if_exists=&quot;replace&quot;, index=False, chunksize=100, method=&quot;multi&quot;)</pre><p>This method was very snappy for loading up my dataset with ~40 columns, and ~18,000 rows.</p><h3>Conclusion &amp; Final Thoughts</h3><p>The first two methods, bulk insert and loop of single inserts, are the least ideal. When it comes to the most optimal, it’s probably a toss up between Methods #3 and #4 for Windows-users and definitely #4 for Mac-users.</p><p>Here’s the code from all four methods combined into a single gist — please try speed-testing these out and let me know if you had similar results!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b41cc212cb3a3adb499713bb292a531a/href">https://medium.com/media/b41cc212cb3a3adb499713bb292a531a/href</a></iframe><p>Hope this article helped you with your data-processing dilemma and consider following me for more coding- and data-related tutorials!</p><p><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55d363856235" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to a SQL Server from Linux/Mac OSX with Python and R]]></title>
            <link>https://towardsdev.com/connecting-to-a-sql-server-from-linux-mac-osx-with-python-3daf1dba6558?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/3daf1dba6558</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[r]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Fri, 17 Dec 2021 14:45:09 GMT</pubDate>
            <atom:updated>2022-01-10T10:52:50.194Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a tutorial to do exactly what the title indicates — connect to a SQL server from Linux/Mac OSX with Python <em>and </em>R.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*22hnnrN6mz4zs61L" /><figcaption>Photo by <a href="https://unsplash.com/@jannisbrandt?utm_source=medium&amp;utm_medium=referral">Jannis Brandt</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX">This</a> is the primary resource I used to get started in Python and <a href="https://db.rstudio.com/best-practices/drivers/">this</a> is what I used for R, but while following along I noticed some errors in documentation and learned a few critical lessons that I’ve incorporated into the following steps. Hopefully my pain will be your gain!</p><h3>Set Up</h3><p>The configuration steps are essentially the same for Python and R.</p><h4>1. Install Homebrew</h4><p>Homebrew is the package manager for Unix-like operating systems. You most likely already have it installed if you’re reading this article, but if not their <a href="https://brew.sh/">website</a> is very helpful for getting it set up. TLDR, run:</p><pre>/bin/bash -c &quot;$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh">https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh</a>)&quot;</pre><h4>2. Install FreeTDS</h4><p>FreeTDS is a set of libraries that enables the connection to SQL servers. You can install it using Homebrew by running this command in your terminal.</p><pre>brew install freetds</pre><h4>3. Install UnixODBC</h4><p>UnixODBC is an open-source project that implements ODBC (open database connectivity), an API for accessing DBMS (database management systems). You can install this using Homebrew as well with this command:</p><pre>brew install unixodbc</pre><h4>4. Point to UnixODBC directories</h4><p>Edit your .bashrc/.bash_profile/.zshrc file:</p><pre>vi ~/.bashrc</pre><p>to include something like:</p><pre>export LDFLAGS=&quot;-L/Users/YOUR_USERNAME/homebrew/opt/unixodbc/lib $LDFLAGS&quot;<br>export CPPFLAGS=&quot;-I/Users/YOUR_USERNAME/homebrew/opt/unixodbc/include $CPPFLAGS&quot;<br>export PKG_CONFIG_PATH=&quot;/Users/YOUR_USERNAME/homebrew/opt/unixodbc/lib/pkgconfig $PKG_CONFIG_PATH&quot;</pre><p><strong>When you do this, make sure the paths are actually correctly. </strong>If it’s not under Users/YOUR_USERNAME/homebrew/opt/..., it might be under /usr/local/opt/....</p><p>Reload whichever file you edited with:</p><pre>source ~/.bashrc</pre><p>so that your changes take effect.</p><h4>5. Install pyodbc (only if you care about connecting with Python)</h4><p>Pyodbc is a Python module that simplifies accessing ODBC databases. You can install it by running the following command:</p><pre>python3 -m pip install --no-binary pyodbc pyodbc</pre><p>A couple notes on this:</p><ul><li>I tried installing this in a python virtual environment to use in isolation and it didn’t work — so if you’re trying to do that and having issues just know I tried without success as well. If you’re reading this and <em>did</em> get it working, please leave a comment with tips :)</li><li>The no-binary flag proved to be helpful in preventing some errors, namely:</li></ul><pre>ImportError: dlopen(/Users/mgipson/odbc_py/venv/lib/python3.9/site-packages/pyodbc.cpython-39-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib<br>  Referenced from: /Users/mgipson/odbc_py/venv/lib/python3.9/site-packages/pyodbc.cpython-39-darwin.so<br>  Reason: image not found</pre><h4>6. Configure FreeTDS</h4><p>You’ll want to inform FreeTDS of the IP/hostname and port you’re trying to connect to; this is done by adding this information into the freetds.conf file. You can check for the location of this file by running:</p><pre>tsql -C</pre><p><em>If this comes back with an error, you most likely have an issue with how the FreeTDS package was installed; try removing the download and clearing the Homebrew cache and trying again if that’s the case. You’ll need to get this resolved before moving forward, unfortunately.</em></p><p>Once you have the location of the freetds.conf file, append the following to the end of the file:</p><pre>[MY_DATABASE]  <br> host = XXX.XXX.XXX.XXX<br> port = XXXX<br> tds version = 7.3</pre><p>Notes:</p><ul><li>Substitute in whatever alias you want to have for your database connection, I’m using MY_DATABASE as an example.</li><li>Host should be the IP or URL of the connection.</li><li>Port is by default 1433, but I still specified that in my file.</li><li>7.3 was the appropriate TDS version for me, but <a href="https://www.freetds.org/userguide/ChoosingTdsProtocol.html">make sure to double check this</a>.</li></ul><h4>7. Test FreeTDS</h4><p>You can test to see if what you just set up in freetds.confworks by running:</p><pre>tsql -S MY_DATABASE -U my_username -P &#39;this-is-a-pswd&#39;</pre><p>Note: your password needs to be enclosed in quotes, your username does not. The -S argument (server) should match whatever alias you have in freetds.conf for the connection, which in my example is MY_DATABASE.</p><p>If you get something that looks like the following, you’re good!</p><pre>locale is &quot;en_US.UTF-8&quot;<br>locale charset is &quot;UTF-8&quot;<br>using default charset &quot;UTF-8&quot;<br>1&gt;</pre><p>You can enter quit to escape.</p><h4>8. Configure ODBC</h4><p>Track down the file libtdsodbc.so — it might be in /usr/local/lib or something like /Users/YOUR_USERNAME/homebrew/Cellar/freetds/1.3.4/lib/. <br>I just used Finder and confirmed by checking it in my terminal. <strong>Make a note of this file path to use in a minute.</strong></p><p>Find the location of the files odbcinst.ini and odbc.ini by running:</p><pre>odbcinst -j</pre><p>You’ll be editing those files so it might be good to navigate to that directory, in my case:</p><pre>cd /Users/YOUR_USERNAME/homebrew/etc/</pre><p>Edit:</p><pre>vi odbcinst.ini</pre><p>to include the correct path to the FreeTDS driver (libtdsodbc.sothat we found a sec ago):</p><pre>[FreeTDS]<br>Description=FreeTDS Driver for Linux &amp; MSSQL<br>Driver=/Users/YOUR_USERNAME/homebrew/Cellar/freetds/1.3.4/lib/libtdsodbc.so<br>Setup=/Users/YOUR_USERNAME/homebrew/Cellar/freetds/1.3.4/lib/libtdsodbc.so<br>UsageCount=1</pre><p>I aliased this as FreeTDS since it’s pointing to the FreeTDS driver and that makes sense, but do what you will.</p><p>Now edit:</p><pre>vi odbc.ini</pre><p>to point to the configuration you did for MY_DATABASE (a.k.a. your equivalent database connection alias) and your FreeTDS driver (a.k.a. your equivalent driver alias):</p><pre>[MY_DATABASE]<br>Description         = Test to SQLServer<br>Driver              = FreeTDS<br>Servername          = MY_DATABASE</pre><p><strong>VERY IMPORTANT NOTE: I’m not sure why, but it absolutely makes a difference if you have spaces/tabs at the start of lines in these two ODBC files. If you don’t believe me, just try it. It will break.</strong></p><h4>9. Test ODBC</h4><p>Now for the fun part! Test out all that tedious configuring by running something like:</p><pre>isql MY_DATABASE my_username ‘this-is-a-password’</pre><p>Where MY_DATABASE is really the alias of your database connection (I’m sure you’re getting the hang of it by now). Again, username doesn’t need enclosed in quotes but password does.</p><h3>Try it out in Python</h3><p>Create a test python file — doesn’t matter where it is or what it’s called — with the following contents.</p><pre>import pyodbc<br>from getpass import getpass</pre><pre>username = getpass(&quot;Username: &quot;)<br>password = getpass(&quot;Password: &quot;)<br>cnxn = pyodbc.connect(&#39;DSN=MY_DATABASE;UID=&#39;+username+&#39;;PWD=&#39;+ password)<br>print(cnxn)</pre><p><strong>Substitute in </strong><strong>MY_DATABASE for your database connection alias</strong> then run! Hopefully you get an output that looks something like:</p><pre>&lt;pyodbc.Connection object at 0x7f847b10ef10&gt;</pre><p>If you do, success! Happy database-ing.</p><p>If you don’t, chances are there’s a detail that’s throwing a wrench in things — it could be something as silly as a typo in the password field or spaces before text in the config files.</p><h3>Try it out in R</h3><p>Although you’ve configured the ODBC files, they will be of no use to us if R cannot locate them. So, to start with, the odbc.ini and odbcinst.ini files need to be copied to the directory that R looks for them in:</p><pre>cp /Users/YOUR_USERNAME/homebrew/etc/odbc.ini /usr/local/etc/</pre><pre>cp /Users/YOUR_USERNAME/homebrew/etc/odbcinst.ini /usr/local/etc/</pre><p><em>Reminder: you can use </em><em>odbcinst -j to quickly find the location of these files.</em></p><p>I’m assuming you have RStudio installed or an environment to work with R configured. For simplicity, I’m going to give steps as if we’re working in RStudio.</p><p>In the RStudio console, run:</p><pre>install.packages(&quot;shiny&quot;)<br>install.packages(&quot;odbc&quot;)</pre><p>to get the packages you need installed.</p><p>To double check your ODBC config files are in the right place, run:</p><pre>odbc::odbcListDrivers()</pre><p>If this comes back with the contents of your files, you’re in good shape. If it doesn’t, you don’t have them in the location that R needs them at.</p><p>Now you’re ready. Add the following to your main file (in my case app.R):</p><pre>library(shiny)<br>library(odbc)</pre><pre>ui &lt;- fluidPage(</pre><pre>)</pre><pre>server &lt;- function(input, output) {<br>    con &lt;- dbConnect(<br>              odbc::odbc(),<br>              driver = &quot;FreeTDS&quot;,<br>              uid = rstudioapi::askForPassword(&quot;Database user&quot;),<br>              pwd = rstudioapi::askForPassword(&quot;Database password&quot;),<br>              server = &quot;XXX.XXX.XXX.XXX&quot;,<br>              port = 1433)<br>    print(con)<br>}</pre><pre>shinyApp(ui = ui, server = server)</pre><p><strong>The biggest headache in setting up with R was that the connection string parameters were <em>incorrect</em> in the </strong><a href="https://db.rstudio.com/best-practices/drivers/"><strong>documentation</strong></a><strong>. It needs to be </strong><strong>server and not </strong><strong>host.</strong></p><p>You’ll need to substitute in the alias to your driver and the IP/URL for your server.</p><p>If you get an error, restart R and try it again. It might have not picked up that you moved the ODBC files to the correct location and just need a refresh.</p><p>Unfortunately I wasn’t able to figure out how to successfully use a DSN for this connection, so if you have any tips please comment below!</p><p>If this article was helpful, let me know with some claps and comments :)</p><p>I write about coding, data science and professional development mostly so check out my page if those are mutual interests!</p><p><a href="https://medium.com/@madisongipson">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3daf1dba6558" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/connecting-to-a-sql-server-from-linux-mac-osx-with-python-3daf1dba6558">Connecting to a SQL Server from Linux/Mac OSX with Python and R</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Eliminating Useless Tags from HTML]]></title>
            <link>https://blog.devgenius.io/eliminating-useless-tags-from-html-6bc4fae51563?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bc4fae51563</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Thu, 09 Dec 2021 03:29:21 GMT</pubDate>
            <atom:updated>2021-12-15T15:15:49.767Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Quick, easy, and no setup required.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5D5S0LTcxhULFgH6" /><figcaption>Photo by <a href="https://unsplash.com/@grakozy?utm_source=medium&amp;utm_medium=referral">Greg Rakozy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Say you have some HTML:</p><pre>&lt;html&gt;<br>   &lt;body&gt;<br>      &lt;p&gt;<br>         This is my body <br>         &lt;span&gt;<br>            text<br>         &lt;/span&gt;<br>         .<br>      &lt;/p&gt;<br>      &lt;div&gt;<br>         &lt;p&gt;<br>            Then here&#39;s another body<br>               &lt;span style=&quot;width=300px;&quot;&gt;<br>                  STYLED<br>               &lt;/span&gt;<br>         &lt;/p&gt;<br>      &lt;/div&gt;<br>   &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Your first question might be: <strong>but why?</strong> Honestly, I don’t really know, but this wouldn’t be the first time something crazy was found on the internet.</p><p>Regardless of the reason behind this insanity, obviously, there are some frustrating things about this, most notably 1) the super useless span containing one word that should just belong in the p tag and 2) the extra div that contains nothing but the single p.</p><p>To remedy this, I offer the following script. It might not work for all cases, but it’s easy enough to tweak, and I hope that my comments offer enough context so that this is useful for more cases than just this one!</p><h3>1. Create a Google Colab Notebook</h3><p>Google Colab is an amazing tool that allows you to run code in your browser using Google’s computing resources — best of all, it requires <strong>literally no setup</strong> on your computer.</p><p>For non-developers, this is crazy helpful because it means you don’t have to dive into the world of setting up a development environment on your machine (which can be a complete headache). For seasoned programmers, this is crazy helpful because it simply saves time and headaches!</p><p>Visit <a href="http://colab.research.google.com/">http://colab.research.google.com</a> and create a new notebook.</p><figure><img alt="Computer screen displaying the notebook options in Google Colab." src="https://cdn-images-1.medium.com/max/1024/1*UOAaZHAzNBUTUnL4AV4CPQ.png" /><figcaption>Create a new notebook in Google Colab.</figcaption></figure><h3>2. Add Code</h3><p>Most of the time I end up scanning articles like this for code gists with the information I need. So, for people like me, here you go :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54d53b695f6e84d6c7d6a219c2f337b2/href">https://medium.com/media/54d53b695f6e84d6c7d6a219c2f337b2/href</a></iframe><p>The comments do this justice I think, but step-by-step:</p><ol><li>Import the BeautifulSoup package (helps elegantly process HTML)</li><li>Establish the function clean_html that actually cleans up this HTML. More on this in a second.</li><li>Allow the user to paste HTML that needs to be edited into an input prompt and convert it to “soup” e.g. parsed data from the HTML.</li><li>Establish a loop that asks what tags you’d like to clean repeatedly until you’re all done. Once you are done, write the final, cleaned, prettified HTML to a file.</li><li>Back to the clean_html function: this looks for all the tags with the type you indicated in the HTML. If the tag doesn’t have any attributes (e.g. style) then it’s essentially dissolved into the parent tag. <strong>Be careful with this </strong>— it works for the example I provided with the div tag holding a single p tag, but if it held multiple this might change how things look. The script can be tweaked to account for this, and other cases, but just a forewarning that you’ll want to double-check results.</li></ol><h3>3. Run!</h3><p>Like I mentioned earlier, Google Colab is awesome because it requires zero setups. All you need to do is run it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Y8Hlublo9TP67-eCz2vC-w.gif" /></figure><p>You can see in this that I successfully cleaned the HTML example snippet from the top of this article, with the output saved in the text file.</p><p><em>Side note: I divided up my code into different panes in the notebook for organization, but you can keep it all in one.</em></p><h3>Let me know if this was helpful or if you made modifications/enhancements!</h3><h3>If you liked this article, please consider following or checking out other articles!</h3><p><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bc4fae51563" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/eliminating-useless-tags-from-html-6bc4fae51563">Eliminating Useless Tags from HTML</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Underrated Productivity Hack: Computer Shortcuts]]></title>
            <link>https://blog.devgenius.io/the-underrated-productivity-hack-computer-shortcuts-9b6dd61b0795?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b6dd61b0795</guid>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[productivity-hacks]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Fri, 21 May 2021 18:51:19 GMT</pubDate>
            <atom:updated>2021-05-22T08:16:19.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PsO5Kc2lOakTMUss" /><figcaption>Photo by <a href="https://unsplash.com/@christinhumephoto?utm_source=medium&amp;utm_medium=referral">Christin Hume</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Using keyboard shortcuts is an incredibly underrated productivity hack. Invest a small amount of time in learning them, and you’re guaranteed to increase productivity and streamline workflows.</blockquote><p><strong>Note: </strong>as I discover more useful keyboard , or people contribute their insights in the comments, this list will be updated!</p><p>I cannot believe that I went through ~most~ of college without leveraging hotkeys. Writing essays and editing code would have gone <em>so</em> much smoother and faster if I would have taken the time to learn and implement these hotkeys into my everyday typing rhythm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*1cTLKxzJKxa9v1xHt4ly4g.gif" /><figcaption>Me before knowing hotkeys.</figcaption></figure><p>Since learning (like, <em>actually</em> learning) these shortcuts, my computer productivity has skyrocketed. It’s much easier, faster, and less frustrating to edit any text or code, plus made navigating around my system much smoother.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*llo1lB4_K_2z532YscnPvA.gif" /><figcaption>Me after learning hotkeys.</figcaption></figure><p>This article is going to outline the hotkeys I use on a daily basis, including tips on:</p><ul><li>Window &amp; Program Management</li><li>Document &amp; Folder Management</li><li>Text Editing</li><li>Other General Mac Commands</li><li>VSCode</li></ul><p>These are intended for Mac, however I use Windows for work, and many of these hotkeys are the same on Windows — just substitute the cmd key with the ctrl key. Application-specific hotkeys (such as those for VSCode) will be exactly the same, just again substiture out cmd for ctrl.</p><h3>Window &amp; Program Management</h3><ul><li>cmd + space : spotlight search, simple way to open new apps or files</li><li>cmd + f : search for content (can use cmd + g in many applications to flip through search hits)</li><li>cmd + n : new program window, new note/file</li><li>cmd + t : new tab</li><li>ctrl + tab : jump through open tabs</li><li>ctrl cmd + f : full screen on/off</li><li>cmd + h : hide window</li><li>cmd + m : minimize window</li><li>cmd + w : close window or tab</li><li>cmd + q : quit program</li><li>cmd + tab + arrows : switch programs</li><li>cmd + , : open program preferences</li></ul><p>It would be very remiss of me if I did not mention the window management application I use, Spectacle. There is a key of the commands needed to reorganize windows included in this tool.</p><p><a href="https://www.spectacleapp.com/">Spectacle</a></p><h3>Document &amp; Folder Management</h3><p>When you’re in Finder, there are some helpful shortcuts for opening and managing folders and files.</p><ul><li>cmd + n : new Finder window</li><li>cmd + shift + n : new folder</li></ul><p>If you have a file selected…</p><ul><li>space : previews file</li><li>cmd + o : opens file</li><li>cmd + delete : moves file to trash</li></ul><p>When you’re in a document…</p><ul><li>cmd + s : save</li><li>cmd + shift + s : save as</li><li>cmd + p : print</li></ul><h3>Text Editing</h3><p>These work in essentially any application where you’re editing text: your browser, notes app, Word/Pages, code editor, etc.</p><ul><li>cmd + up/down arrow : jump to top/bottom of document or page</li><li>cmd + left/right arrow : jump to beginning/end of a line</li><li>opt + left/right arrow : jump over words</li><li>shift + up/down arrow : highlight lines</li><li>shift + left/right arrow : highlight characters</li><li>cmd + [ : un-indent line (without being at the start of the line)</li><li>cmd + ] : indent line (without being at the start of the line)</li></ul><p>These can be combined to become rather powerful. For example:</p><ul><li>cmd + shift + left/right arrow : highlight entire lines</li><li>cmd + shift + up/down arrow : highlight up to the top or down to the bottom of a document or page</li><li>opt + shift + left/right : highlight words</li><li>cmd + delete : delete entire lines</li><li>opt + delete : delete words</li></ul><p>Most already know that cut/copy/paste can be accomplished using cmd + x/c/v, respectively. The tip I would like to add to this is that not only can you apply these commands to a highlighted section of text, you can also <em>apply cut/copy/paste to entire lines</em>. I use this method frequently for working with entire lines or blocks of code in my editor.</p><p>When using messages on my Mac, I find this shortcut is a little less clunky when calling up the emoji board:ctrl + cmd + space.</p><h3>Other General Mac Commands</h3><h4>Basics</h4><ul><li>cmd + a : select all</li><li>cmd + z : undo</li><li>cmd + shift + z : redo</li></ul><h4>Screen Capture or Record</h4><ul><li>cmd + shift + 3 : screen capture entire screen</li><li>cmd + shift + 4: screen capture section</li><li>cmd + shift + 4 + space : screen capture a window</li><li>cmd + shift + 5 : screen record or capture options</li></ul><p>Some of the included hotkeys I discovered through Apple’s page about Mac keyboard shortcuts. I only included commands that I use basically on a daily basis, so it might be worth it to check out this page as well.</p><p><a href="https://support.apple.com/en-us/HT201236">Mac keyboard shortcuts</a></p><h3>VSCode</h3><p>VSCode is an incredibly powerful tool, so naturally there’s <em>a lot</em> to unpack. Right now, I’m just going to be covering the top hotkeys that I use within VSCode to make my coding workflow as seamless as possible.</p><h4>Command Palette</h4><p>VSCode includes a powerful feature called the “command palette,” through which developers can run complex commands, grep for files, debug, etc. Here are some of the commands I frequent most:</p><ul><li>cmd + p : open command palette <strong>OR</strong> search files in workspace</li><li>cmd + p; @ : jump to symbol in editor</li><li>cmd + p; # or cmd + t: jump to symbol in workspace</li><li>cmd + p; &gt; or cmd + shift + p: show and run commands</li><li>cmd + p; : : jump to line in file</li><li>cmd + p; ? : show all command palette options</li></ul><h4>File &amp; Pane Management</h4><p>Quickly opening/closing/switching files is key for efficient developer workflows.</p><ul><li>cmd + shift + n : new window</li><li>cmd + n : new file</li><li>cmd + o : prompts finder to open a new file within your current workspace or folder</li><li>ctrl + tab : flip through different open files</li><li>cmd + w : close file</li><li>cmd + 1 : jump to <strong>or</strong> create group 1 (2, 3, etc. for groups 2, 3, etc.)</li><li>cmd + shift + f : search for keywords in any file throughout workspace</li><li>cmd + J : toggle bottom panel</li><li>cmd + , : open settings</li></ul><h4>In-File Editing</h4><p>All of the text editing tips from before can be applied in VSCode. Be wary of the file type you’re working with though, as not all typical text editing commands have a code editing equivalent.</p><p>There are a couple more code-editing shortcuts in VSCode that are not found in other text-editing applications:</p><ul><li>cmd + f : search for content (cmd + g to flip through search hits, also can use the replace function through the find bar)</li><li>cmd + opt + [ : collapse lines</li><li>cmd + opt + ] : expand lines</li><li>opt + click : create multiple cursors (useful when you have multiple items that need to be updated to the same thing — can also use a “replace all” function)</li><li>cmd + b : if you’re in a markdown or text file, this bolds text</li><li>cmd + b : if you’re in a code file, it hides/shows the sidebar</li><li>cmd + l : highlights the following lines</li><li>cmd + u : jump to the place you last edited</li><li>cmd + / : (un)comment line(s)</li></ul><p>In the near future, I plan on writing another article about VSCode tips — including extensions, complex hotkey combinations, file and workspace management, etc. Stay tuned for that.</p><p>As with the Apple keyboard shortcuts, there is an all-knowing source of hotkeys for VSCode as well. This reference also details how to create custom keybindings, which should be taken advantage of in order to really optimize workflows.</p><p><a href="https://code.visualstudio.com/docs/getstarted/keybindings">Keyboard shortcuts for Visual Studio Code</a></p><p>I hope this article was helpful and introduced some new tips that you can apply and integrate in your workflow. Let me know if you have other tips or resources in the comments, or which of these tips was coolest/most helpful!</p><p>If you’ve made it this far, you must be interested in hacking your productivity or streamlining your workflows. You might even be interested in a couple other topics I’ve written on.</p><ul><li><a href="https://blog.devgenius.io/bash-aliases-and-functions-a-programmers-productivity-hack-1027c65f37">Bash Aliases and Functions: a Programmer’s Productivity Hack</a></li><li><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b6dd61b0795" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/the-underrated-productivity-hack-computer-shortcuts-9b6dd61b0795">The Underrated Productivity Hack: Computer Shortcuts</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In(ternship) Retrospect: what I wish I would’ve known prior to my first internship.]]></title>
            <link>https://madisonostermann.medium.com/in-ternship-retrospect-what-i-wish-i-wouldve-known-prior-to-my-first-internship-ee3feecf367e?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee3feecf367e</guid>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[students]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[professional-development]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Tue, 18 May 2021 01:59:37 GMT</pubDate>
            <atom:updated>2021-05-18T01:59:37.850Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Lessons learned — two years and three internships later.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dUtxJH93dx-lrab8" /><figcaption>Photo by <a href="https://unsplash.com/@israelandrxde?utm_source=medium&amp;utm_medium=referral">Israel Andrade</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Flashback to March 2019.</p><p>I’m a computer science newbie, just a year into my degree after switching over from music. After attending a conference for women in STEM hosted at Harvard, I was left with an overhwelming sense of excitement and dread. While the experience was incredibly inspiring, it brought me to the realization that I was utterly behind — wrapping up my sophomore year, totally missed the tech recruiting season (how did no one tell me it was in the fall?!?), few programming projects on my Github profile, no internship or summer plans in sight.</p><p>However, I was determined to find an internship for the summer. It took 2 months and more applications (and rejections) than I care to admit, but I <strong>finally</strong> received an offer!</p><p>Fast forward to present day.</p><p>I’ve worked three different internships — business operations in product management, software development for an enterprise product, and data science at NASA. While my path into and through these opportunities has been somewhat unorthodox, I’ve learned some valuable lessons that I’m hoping will be helpful to other students!</p><h3>Internships are unparalleled experiences.</h3><p>Take it from this recently graduated student: internships are your pathway to full time jobs. With the competitive professional landscape and rapidly evolving fields of today, it’s not enough to just be working on or possess a college degree. Most entry-level jobs nowadays require 1+ years of relevant professional experience, which for students are found through internships.</p><p>The reason internship experience is so distinct is because it offers exposure to a professional environment, allows you to build industry-relevant skills, collaborate with different individuals and teams in a real-world capacity, and more. These are things that cannot be acquired in a classroom, through personal projects or research papers, or other academic experiences.</p><h3>Lessons Learned</h3><h4>There is no right way.</h4><p>First and foremost, there is no right way, place or time to get an internship.</p><p>In tech, it feels like there’s a template for success. Do your leetcode, take your classes, do your projects, interview round after round, get an internship, and get a job offer a semester later. I can’t speak for other fields, but I imagine there are similar cases.</p><p>However, everyone’s path is different. Mine was a lot different than most of my peers — it’s not a bad thing, just a fact. I got a very late start in the recruiting cycle and started off with a non-tech internship, transitioning into roles closer to my career goals. Not typical, but it worked.</p><p>It’s important to keep this in mind throughout the internship search process because sometimes “the right way” isn’t <em>your right way</em>.</p><h4>Prepare if possible.</h4><p>When I became aware that I missed the tech recruiting season, I simply did not have time to build the portfolio needed to obtain the roles I wanted (more on how I got past this in the next section).</p><p>However, for the following internships, I had plenty of time to prepare. In addition to gaining experience from my first internship, I made sure to work on individual and group side projects, write research papers through courses, and create independent study opportunities for myself. By putting in that extra energy and preparing a relevant portfolio, I managed to secure internships that aligned with my career goals.</p><h4>Pivot!</h4><p>Trying to get a software development internship with minimal software development projects in my arsenal was a complete dead end. So what next?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*XSl3RbyTj9K6bhQhYJrtFA.gif" /></figure><p>I pivoted and changed my approach. Instead of trying to get an internship that I wanted with no relevant experience, I started trying to get an internship with my relevant experience even if it wasn’t exactly what I wanted. <em>I kept an open mind and focused on what I could bring to the table.</em></p><h4>Stand out.</h4><p>There will be a ton of students with comparable experiences competing for the same internships. You can make yourself stand out by having an exceptional resume, website, and LinkedIn. I’ve said all that I would about these things in other articles that you should check out for in-depth tips.</p><ul><li><a href="https://madisongipson.medium.com/tips-for-creating-a-stellar-eportfolio-dc26ac997aed">Tips for Creating a Stellar ePortfolio</a></li><li><a href="https://medium.com/swlh/linkedin-tips-reach-all-star-status-open-opportunity-doors-ebc6b9774ff3">LinkedIn Tips: Reach All-Star Status &amp; Open Opportunity Doors</a></li></ul><h3>Make the most of your opportunities.</h3><p>After you have an internship, it’s simply not enough to coast by — especially if you’re trying to gain valuable, transferrable skills or hoping for a job offer. Here are a few suggestions I have for making the most of an internship — which can be applied to most other opportunities — once you have your foot in the door.</p><h4>Seek out opportunities to build your desired skillset.</h4><p>The reason that internships are unparalleled experiences is because they provide relevant professional experience for entry-level roles. This is assuming that your internship <em>actually</em> provides relevant experience. That being said, you can make the most of your internship by being proactive in making opportunities for yourself that will help advance your own professional development interests.</p><p>For example: in my business operations internship, I had the opportunity to work on data visualizations for a product management dashboard. Because I was interested in advancing my data analytics and science skillset, I said yes to every related opportunity and even suggested projects that would both help the team and contribute to my growing skillset with data.</p><h4>Be your own best advocate.</h4><p>Actions speak louder than words, right? By working hard, being professional, and saying yes to challenges, you can demonstrate that you’re a valuable asset to the team — potentially biding yourself another semester or even promoting yourself into a full time role.</p><p>Furthermore, if you’re able to track your input and output, going so far as to quantify the difference you made (e.g. “providing additional data access methods that increased visibility by 80%”), you can present that information to managers during performance reviews or add it to a resume for job applications.</p><h4>Connect with others.</h4><p>This may seem like an obvious one, but the importance cannot be underscored enough. Not only will getting to know other interns, your teammates, and managers make the whole experience more enjoyable, but you’ll also be building your professional network. Most times there will be chat groups or after-work socials (even virtually) that will provide opportunities to get to know people past work!</p><p>Please share in the comments if these lessons learned were valuable for you, or if you have any additional insights!</p><p><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee3feecf367e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making the Most of Neo4j: Integrating Python Code with Py2Neo]]></title>
            <link>https://python.plainenglish.io/making-the-most-of-neo4j-integrating-python-code-with-py2neo-6a7eb281fddb?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a7eb281fddb</guid>
            <category><![CDATA[graph-database]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Mon, 29 Mar 2021 02:30:35 GMT</pubDate>
            <atom:updated>2021-03-29T16:17:07.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b7ZZPHItFy-UDWzG" /><figcaption>Photo by <a href="https://unsplash.com/@sapegin?utm_source=medium&amp;utm_medium=referral">Artem Sapegin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’d be surprised to come across a programmer or data scientist who <em>hasn’t</em> used Python for at least one project. However, there are fewer people who have come across Neo4j, so this article is meant for the niche few of us who love combining the flexibility of Python and the awesomeness that is graph databases.</p><p>If you’re unfamiliar with Py2Neo, it’s a pip-provided Python packages that acts as a Neo4j driver. You provide your database credentials to some Python code leveraging Py2Neo, it connects to your database, executes Cypher queries, and returns results. Talk about useful!</p><p>This article will provide a <strong>guide for setting up the environment</strong> as well as <strong>template code.</strong></p><p>I’ve implemented this on both Windows and Mac, so if you’re having issues, leave a comment and I might be able to advise on differences between the two environments.</p><p><em>This assumes that you have Neo4j Browser installed, your graph database is created, and all that’s left is to connect it to some Python code!</em></p><h3>Setup</h3><p>My personal recommendation when dealing with any Python-involved project is to set up a virtual environment; this ensures you have the correct versions of everything <em>and</em> isolates package installation, which prevents many future headaches. Here’s how we do this:</p><ol><li>Navigate to your project folder — in this case we’re looking for the folder that the database is housed in. You can easily find this path by opening the project folder through Neo4j browser (Ellipses &gt; Open folder &gt; DBMS).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obVkTrZdkPRO7nMB1vzuqg.png" /></figure><p>2. Create a python folder alongside your other folders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*8-GlMB0Qi424uaAbduhbLg.png" /></figure><p>3. Open that folder in your terminal (Ctrl+Click folder).</p><p>4. Create virtual environment within the python folder (python -m virtualenv venv or equivalent).</p><p>5. Start virtual environment (.\\\\venv\\scripts\\activate.ps1 on Windows, source venv/bin/activate on Mac — I have this aliased as startvenv, see <a href="https://medium.com/dev-genius/bash-aliases-and-functions-a-programmers-productivity-hack-1027c65f37">this article</a> on Bash aliases if you’re interested).</p><p>5. Install required packages; for this, we just start with a single package (pip install py2neo). If you have multiple packages, I highly recommend using pip freeze &gt; requirements.txt to save all package requirements to a file, which you can then easily download in a script-like fashion using python -m pip install -r requirements.txt. This is especially useful if you share code.</p><p>6. Start up your Neo4j database.</p><h3>Template</h3><p>Great! Now you have your Neo4j database spun up and your Python virtual environment set.</p><p>This is the starter code for Py2Neo; create a new file in that python folder you created that contains this code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e18d2885804a0fed63265e49b930a37d/href">https://medium.com/media/e18d2885804a0fed63265e49b930a37d/href</a></iframe><p>Run this script using python py2neo.py (substitute in the correct filename, of course). It will prompt you for the port of the database (found in the database detail pane in Neo4j Browser, see below), your username and password (which would’ve been created when the database was created — default usernames are neo4j).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*jR0ztRikIoo15C0e88ZY1w.png" /></figure><p>After running the script, you should expect all nodes, all properties, and specific properties to be printed.</p><h3>Conclusion</h3><p>This gist should give you a good idea of Py2Neo’s capabilities. You can use .format() to substitute parameters into a Cypher query, get the results back as plan .data() or even a .dataframe(), and use list comprehension to easily compile results into a list. There are some specific things about Py2Neo that are useful to know, such as transactional commits. I plan to write an article about this in the future, but their <a href="https://py2neo.org/2021.0/">documentation</a> is also fairly informative.</p><p>If you’re interested in other Neo4j, Cypher and Py2Neo/Python topics, you may enjoy these other couple articles.</p><ul><li><a href="https://medium.com/analytics-vidhya/automate-neo4j-database-construction-with-python-d9c1ada7413e">Automate Neo4j Database Construction with Python</a></li><li><a href="https://medium.com/swlh/running-a-cypher-query-with-parameters-through-a-python-script-f0089e245b4d">Running a Cypher Query With Parameters Through a Python Script</a></li></ul><p><em>Follow me for more content on coding, data science and professional development!</em></p><p><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a7eb281fddb" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/making-the-most-of-neo4j-integrating-python-code-with-py2neo-6a7eb281fddb">Making the Most of Neo4j: Integrating Python Code with Py2Neo</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LinkedIn Tips: Reach All-Star Status & Open Opportunity Doors]]></title>
            <link>https://medium.com/swlh/linkedin-tips-reach-all-star-status-open-opportunity-doors-ebc6b9774ff3?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebc6b9774ff3</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[resume]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[linkedin]]></category>
            <category><![CDATA[professional-development]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 03:25:25 GMT</pubDate>
            <atom:updated>2021-01-11T20:20:54.843Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>If you’ve already mastered your LinkedIn and are ready to take it to the next level, check out my article on <a href="http://As a twenty-something in the twenty-first century, my professional digital presence is essential in my pursuit of a fulfilling career. Even if you aren&#39;t a twenty-something, your online portfolios (whether through LinkedIn, your own website, Github, etc.) are what tell other professionals and potential employers what you&#39;re all about.">how to make your website/ePortfolio really stand out.</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TL43vc8-GqQJiW0q" /><figcaption>Photo by <a href="https://unsplash.com/@brookelark?utm_source=medium&amp;utm_medium=referral">Brooke Lark</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a twenty-something in the twenty-first century, my professional digital presence is essential in my pursuit of a fulfilling career. Even if you aren’t a twenty-something, your online persona is what tells other professionals and potential employers what you’re all about.</p><h3>Overview</h3><p>I’m a big fan of <a href="https://medium.com/swlh/productivity-tip-the-benefits-of-task-batching-c6ac8c6ea05e">task-batching</a>, and think it’s a great approach to the larger (and possibly overwhelming) task of beefing up your LinkedIn. There are a bunch of small tasks that can be done in one sitting, and other more involved ones that require a time block of their own.</p><p>That being said, this article is organized in the following chunks:</p><ol><li><strong>Getting Started</strong><br>Small things that can be done during an episode of your favorite show.</li><li><strong>Craft your Biography</strong><br>Tell the world what you’re all about.</li><li><strong>Elaborate on Experiences</strong><br>Show, don’t just tell.</li><li><strong>Put your Skills to the Test</strong><br>Demonstrate that you actually know what you say you know.</li><li><strong>You Get What (Endorsements &amp; Recommendations) You Give</strong><br>Add value to others, and they’ll return the favor.</li></ol><h3>Getting Started</h3><p>This section covers the quick &amp; easy things that you could knock out while watching a show or listening to a podcast. It seems long (due mostly to the images included), but you’ll be done in no time.</p><h4>1. Personalize your URL</h4><blockquote>Why?</blockquote><p>When you print your LinkedIn URL on a business card or resume, or maybe add it to an online application, it looks <em>way</em> more polished.</p><blockquote>How?</blockquote><p>At the top right of your profile page, there’s an “Edit public profile &amp; URL” link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pr-ycw-1QZvO2aC1Qqpkw.png" /></figure><p>On a new page, you’ll have the option to edit the custom URL. <br>I just used a bit of my name, to keep it short and sweet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n40XMOiu-KJTtHEJgz0pMQ.png" /></figure><h4>2. Improve your Headline</h4><blockquote>Why?</blockquote><p>When someone searches for you, the headline is the thing that follows. <br>It’s your first impression. <br>It tells people — in under a second — who you are and what you’re about. <br>It’s a recruiter’s tip-off that you’re a fit… or that you’re not.</p><p>It’s your self-proclaimed professional identity, if you will.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*hooKREhgV8xW3paVY_wu8g.png" /></figure><blockquote>How?</blockquote><p>Your headline should describe,<strong> </strong>simultaneously<strong>, who you are &amp; who you want to be.</strong></p><p>If you’re a student, say that, and specify what you’re studying. If you want a career in a specific industry or role, communicate that somehow — “future astronaut” or “aspiring videographer.”</p><p>My current headline states specifically what I’m currently doing, which is fortunately what I want to continue doing as well.</p><p>Logistically, the headline is part of your top profile section, which can be edited by selecting the pencil icon in your header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Jw70KNXWyuKdlSUGKU6X5g.png" /></figure><p>While you’re there…</p><h4>3. Link to your Website</h4><blockquote>Why?</blockquote><p>Your website — whether it be a blog, ePortfolio, etc. — is going to tell people a lot more about you (and in the exact way you want) than your LinkedIn can. I delve into what your website can do for you that LinkedIn can’t <a href="https://madisongipson.medium.com/tips-for-creating-a-stellar-eportfolio-dc26ac997aed">here</a>.</p><p>Plus, if you’ve put all that work into creating a website, why <em>wouldn’t</em> you want to link it?</p><blockquote>How?</blockquote><p>When you click the pencil icon to edit your headline, just stay on that same page. Scroll down and select to edit “Profile URL, Website, Phone, Email, Birthday, WeChat ID.” The “Website URL” field at the top is what you’re looking for.</p><h4>4. Take Advantage of the Neglected “Featured” Section</h4><blockquote>Why?</blockquote><p>When you scroll down on your page, you see the “About” section (more on that later) soon followed by the “Featured” section.</p><p>That means that when people first check out your profile, they’ll see this “Featured” section (or the lack thereof) in the first few scrolls. You should take full advantage of that ability to capture their attention with 1) graphics and 2) the most important content you have to offer.</p><blockquote>How?</blockquote><p>You can link to posts, articles, links and media within this section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*SxLCm45vH4Injsh4soKWrA.png" /></figure><p>Some ways to use this:</p><ul><li>If you write articles, post them to LinkedIn, and link them here.</li><li>If you make really great LinkedIn posts, link them here.</li><li>If you have any other websites or portfolios (e.g. Github &amp; Medium), link them here.</li><li>If you’re really active on other social sites, plug those handles in here.</li><li>If you have visual work to show (digital or physical art, graphic designs, photos, videos, travel photos), add it here.</li><li>If you have great presentations (from conferences or competitions or sales pitches), add it here.</li><li>If you have research papers or articles you wrote for the school paper, link them here.</li></ul><p>I know those examples might’ve been overkill, but my point is: people don’t think they have anything to link in this section, when you <em>most likely </em>do. Take advantage of it!</p><h4>5. Add Education &amp; Licenses/Certifications</h4><blockquote>Why?</blockquote><p>The more you know, the better.</p><blockquote>How?</blockquote><p>Education is straightforward, just keep in mind:</p><ul><li>Include your GPA if it was notable, leave it off if not.</li><li>Don’t forget to add clubs/associations/sports. Even if they aren’t relevant to your field, it’s still good to show that you’re well-rounded.</li></ul><p>Even if the certification doesn’t seem relevant to you for a position, doesn’t mean that a potential employer sees it the same way. Link any and all licenses &amp; certifications you have.</p><h4>6. Max out your Skills</h4><blockquote>Why?</blockquote><p>Beyond communicating all of the skills you possess, having your skills labeled on LinkedIn can help match you with job postings that require certain skillsets. So, by adding as many skills as possible to your profile, you’re actually augmenting the possibility that you match and attract opportunities.</p><blockquote>How?</blockquote><p>You can add up to 50 skills, in areas like Industry Knowledge, Tools &amp; Technologies, Interpersonal Skills, etc.</p><p>Because I’m a programmer, my Tools &amp; Technologies section is a little more robust than the others, but I would highly recommend making sure you have a good balance between the sections.</p><h4>7. Include (Relevant) Accomplishments</h4><blockquote>Why?</blockquote><p>The accomplishments section is a great way to round out the rest of your profile. Including only relevant accomplishments ensures that your information does not get muddied.</p><blockquote>How?</blockquote><p>You can add many different types of accomplishments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/163/1*C6vofGA7MZWqqP2nW9aLgQ.png" /></figure><p>A couple tips:</p><ul><li>Courses: only link to recent and relevant courses. That hiring manager is going to be confused why you’re still mentioning that freshman level creative writing course after starting your Masters in Public Health.</li><li>Projects, Honors and Awards, &amp; Organizations: actually describe what you did. It’s easy to just title it, give it a date, and call it good. But if the project’s worth including in this list, talk about what you did and try to highlight what transferrable skills you learned from it. Also, include links to code repositories, articles, videos, etc. that relate.</li><li>Test Score: only include if recent, relevant, and notable.</li></ul><h4>8. Get Involved- Like Pages of Interest</h4><blockquote>Why?</blockquote><p>While people can see what pages and topics you’ve liked on LinkedIn, that’s not really the point of this.</p><p>If you follow certain pages or topics, you’ll have a better chance of stumbling into networks of individuals with similar interests. In addition to getting more content catered to you, you’ll also increase the chances of quality online networking.</p><blockquote>How?</blockquote><p>First, just search for things like:</p><ol><li>Thought leaders in your industry</li><li>Companies/Organizations/Schools you want to follow</li><li>Trends/Ideas you want to follow (as hashtags)</li></ol><p>If you want to do more exploring…</p><ol><li>Check out your “My Network” tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*k4i8xua6CTkmpJKPlrinmQ.png" /></figure><p>2. On the left side of the page, you’ll see this dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*k8KsXeRvqKNX9PGaHv5zSQ.png" /></figure><p>3. Under either the “Pages” or “Hashtags” tab, you’ll see a page of tiles (if you’ve already liked things). At the top, you’ll see something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*9G-j8No7ioiBuG1hERKUDw.png" /></figure><p>4. The “Follow fresh perspectives” tab is where I would recommend first going to find companies, people, influencers, and hashtags to follow.</p><h4>9. Get Connected</h4><blockquote>Why?</blockquote><p>LinkedIn’s supposed “magic number” is 30 connections — after you hit that threshold, the relevancy of your news feed increases and more connections and opportunities open up.</p><blockquote>How?</blockquote><p>When I was really working on my LinkedIn, I would watch an episode of Schitt’s Creek in the background while going through and making as many connections as LinkedIn would allow in a night. It was so quick and easy.</p><p>There are several different types of connections to make.</p><ol><li>Friends &amp; Family (just search for them)</li><li>Classmates &amp; Alumni<br>Go to your university’s LinkedIn pages and click on the “Alumni” tab. You can filter by location, company, industry, major, etc. <br>Even if your peers aren’t alumni yet, they should still show in this list.</li><li>Current &amp; Past Professors/Teachers<br>You might have to just search for their names — they’ll appreciate the connection I’m sure!</li><li>Current &amp; Past Colleagues<br>Similarly, go to your company’s LinkedIn pages and click on the “People” tab. You can again use the same filters, or search the list.</li><li>Conference Connections<br>When you go to a conference, try to snag a business card or name of people you meet. Afterward, send them a friendly note on LinkedIn and keep connected! If they’re in your industry, you never know when having that connection can help present opportunities or enhance your industry knowledge.<br>With everything virtual at the moment, conferences are likely to have Linkedin Groups (or someting equivalent on another platform) so you can see everyone who attended the conference. Take advantage of these as well!</li><li>Company Connections<br>If you’re actively seeking employment, connect with individuals at the companies you’d like to work for — recruiters and individuals that have a similar job title as the one you are working toward.<br>When you cold-connect like this, make sure to include a warm note introducing yourself and the reason for wanting to connect. If you have a specific call to action, include that as well, as it will increase the chances of something actually coming to fruition.</li></ol><h3><strong>Craft your Biography</strong></h3><p>This shouldn’t take you too long, but it does take a little more thought than the previous bits and can be tricky if you’re coming up with it from scratch.</p><blockquote>Why?</blockquote><p>The “About” section is one of the first things on your profile and has the opportunity to make a great first impression.</p><blockquote>How?</blockquote><p>The “About” section should reflect who you are, which is why I don’t want to prescribe a way to do this. I have a couple guiding tips if you’re having trouble getting started.</p><ul><li>I found it helpful to begin with a one-sentence tagline intro, that tells who I am, what I do, and what I live for.</li><li>Get creative — you could format it like an elevator pitch, divide it into a timeline of your life, talk about your most recent travel adventure.</li><li>Talk about more than just your professional aspects. The first part of mine is pretty career-focused, but I make sure to mention my musical interest and coffee addiction.</li><li>Don’t let it get too long — it doesn’t have a word cap. I’ve seen people who write a chapter in their bio, and it seemed to distract more than add. You want to tell them a little bit about you, but let your profile show the rest.</li></ul><p>If you really need some help, get input from a friend who knows both your professional and personal aspects.</p><h3><strong>Elaborate on Experiences</strong></h3><p>If you don’t already have your descriptions for jobs and volunteer experiences fleshed out, this can take some time. However, I find it helpful to go over everything once, and come back to it later to refine it. Sometimes I go through a few iterations of editing these before reaching the fine-tuned product. The good news? It always pays off.</p><blockquote>Why?</blockquote><p>How you talk about what you’ve done is a make or break — on resumes and on LinkedIn. Being able to identify transferrable skills and highlight marketable traits about yourself is key. I’m planning on doing an article on this at a later point, so follow me to stay in the loop for updates :)</p><p>That being said, you should definitely include descriptions under your jobs and volunteer experiences.</p><blockquote>How?</blockquote><p>You can use bullet points or a paragraph, whatever you’re used to. The more important part is to not make this too long. Be thorough, but succinct. Focus on the important parts, leave out the distracting details, and attach links where relevant. Even though you have more room than your one-page resume, it doesn’t mean you should use it — viewers’ attention spans are still just as short.</p><h3><strong>Put your Skills to the Test</strong></h3><p>This not only involves a concentrated time block, but might involved <em>a little</em> bit of preparation.</p><blockquote>Why?</blockquote><p>You’ve claimed you know these skills, but it’s even better if you can demonstrate that you know them.</p><blockquote>How?</blockquote><p>Take the skill quizzes — but only when you’re ready.</p><p>I took the Python skill quiz as a pretty new programmer and was totally unprepared… not surprisingly, I failed it. You only get 3 chances, so make sure you aren’t just shooting the moon on these.</p><h3><strong>You Get What (Endorsements &amp; Recommendations) You Give</strong></h3><p>Skill endorsements don’t take long at all — again, put on a show or a podcast.</p><p>Recommendations take a little more energy, but you can knock out a few in one sitting for sure.</p><blockquote>Why?</blockquote><p>Giving skill endorsements and recommendations to others on LinkedIn is a great way to increase the quality of your professional connections, not to mention that it’s just a nice thing to do.</p><p>Usually, once you give an endorsement or recommendation, they’ll be returned. If not, you can always just reach out and ask.</p><blockquote>How?</blockquote><p>Skill endorsements just require a click.</p><p>When giving recommendations, I like to mention my relationship to the individual, what we worked on, top attributes of the individual (that aren’t mentioned in other recommendations, and especially interpersonal ones), and conclude by giving praise (e.g. “looking forward to collaborating again in the future,” “any team would be thrilled to have them”).</p><h3>Happy Connecting!</h3><p>I hope those tips were helpful in getting you started toward all-star status and advancing your professional digital presence. Please let me know how these work for you, or if you have any additional pointers!</p><h3>Follow Madison Gipson for more publications on professional development, coding, and more!</h3><p><a href="https://madisongipson.medium.com/">Madison Gipson - Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebc6b9774ff3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/linkedin-tips-reach-all-star-status-open-opportunity-doors-ebc6b9774ff3">LinkedIn Tips: Reach All-Star Status &amp; Open Opportunity Doors</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Neo4j Database Construction with Python]]></title>
            <link>https://medium.com/analytics-vidhya/automate-neo4j-database-construction-with-python-d9c1ada7413e?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9c1ada7413e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[graph-database]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 03:43:07 GMT</pubDate>
            <atom:updated>2020-12-21T17:50:25.348Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial detailing how to import data and create your graph database via a Python script.</h4><figure><img alt="Minimal workspace with laptop displaying code." src="https://cdn-images-1.medium.com/max/1024/0*sX35n3pZFZbwvIhg" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A recent project of mine has involved creating a <strong>massive</strong> (upwards of a million nodes and relationships) graph database in Neo4j. When there’s that much to process, having an automated script comes in clutch. This article outlines some tips I have for anyone in a similar situation.</p><p>Code is linked throughout, and please comment any additional tips!</p><h3>Pre-Requisites</h3><ol><li>Python needs to be installed (preferably 2.7 or later)</li><li>Neo4j database should be created, with any plugins or settings needed set<br>(I use the APOC and GDSL plugins, and increase max heap size to 3GB)</li><li>Cypher queries that will build the database as you’d like</li></ol><h3>Setup: Python Directory &amp; Virtual Environment</h3><ol><li>Navigate to the graph’s directory. The directory on my Mac looks like /Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-asdfjkl-1234-etc/installation-4.1.1/. I pin this to my sidebar for easy access.</li><li>Create a python directory within that installation directory.</li><li>Optional: inside the python directory, create a virtual environment. I really like working with a venv because I can easily share or transfer the requirements.txt with all of the required packages with teammates or other projects, respectively. <a href="https://docs.python-guide.org/dev/virtualenvs/">This resource</a> helped me successfully set up virtual environments on both my Mac and PC.</li><li>Once your virtual environment is created, you can install the py2neo package via pip.</li><li>If your Cypher queries import data from any files, go ahead and place those files in the import directory (should be within the same installation directory).</li></ol><h3>Coding Time</h3><p><em>Note: the full code for this project is in the following repository, so you can reference the context of the gists below or check out the data I was importing.</em></p><p><a href="https://github.com/mgipson/Text-Similarity">mgipson/Text-Similarity</a></p><h4>Script Skeleton</h4><p>Our main Python script that imports the data or builds the nodes and relationships will live inside that handy Python folder and virtual environment.</p><p>This code block does the bare minimum:<br>1. Import py2neo <br>2. Establish a database connection<br>3. Run a single query</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b09f76cccd731dcbc37f19615e26a814/href">https://medium.com/media/b09f76cccd731dcbc37f19615e26a814/href</a></iframe><p>With <a href="https://py2neo.org/2020.1/">Py2Neo</a>, you can run Cypher queries as-is or use the Py2Neo functions to perform similar actions. My personal preference is running Cypher queries as-is because I can simply copy and paste the code to and from the Neo4j browser.</p><p>If you want something super simple, you could repeat the graph.run() call with your different queries and it would get the job done. However, there are some things I discovered when developing my own script that helped tremendously; keep reading if you want to see if these will be useful to you.</p><h4>Batching &amp; Auto-Committing</h4><p>I leveraged <a href="https://neo4j.com/labs/apoc/4.1/graph-updates/periodic-execution/">periodic commits (aka batching</a>) because I kept running into memory issues with my heavier-lifting queries.</p><p>If you do run in batches, you’ll want to use an open transaction (accomplished with the begin(), run(), commit() sequence in the code below) instead of a closed transaction (standalone run() call). <br>This is because a closed transaction auto-commits, meaning that if you use batching and a closed transaction, it will execute and commit your first batch but not continue to do the other batches. Definitely <strong>not</strong> what we want.</p><pre>#Without Periodic Commits</pre><pre>graph.run(&quot;&quot;&quot;LOAD CSV WITH HEADERS<br>FROM &#39;file:///womeninstem.csv&#39; AS line<br>MERGE (person:Person { name: line.personLabel })<br>ON CREATE SET person.birth = line.birthdate, person.death = line.deathdate&quot;&quot;&quot;)</pre><pre>#With Periodic Commits</pre><pre>query_list = []</pre><pre>query_list.append(&quot;&quot;&quot;CALL apoc.periodic.iterate(&quot;<br>LOAD CSV WITH HEADERS<br>FROM &#39;file:///womeninstem.csv&#39; AS line<br>RETURN line<br>&quot;,&quot;<br>MERGE (person:Person { name: line.personLabel })<br>ON CREATE SET person.birth = line.birthdate, person.death = line.deathdate&quot;, {batchSize:1000, parallel:false, retries: 10}) YIELD operations&quot;&quot;&quot;)</pre><pre>#would have more queries in query_list</pre><pre>for query in query_list:        <br>   g = graph.begin() # open transaction        <br>   result = g.run(query).to_data_frame() # execute query<br>   g.commit() # close transaction</pre><h4>Query Failure Alerts</h4><p>The thing about running a Cypher query through Python code instead of in the browser is that it doesn’t always tell you if the query fails- it will alert you of syntax errors, but that’s about it.</p><p>For that reason, it’s important to have something implemented that alerts you if a query doesn’t finish completely.</p><pre>query_list = []</pre><pre>query_list.append(&quot;&quot;&quot;CALL apoc.periodic.iterate(&quot;<br>LOAD CSV WITH HEADERS<br>FROM &#39;file:///womeninstem.csv&#39; AS line<br>RETURN line<br>&quot;,&quot;<br>MERGE (person:Person { name: line.personLabel })<br>ON CREATE SET person.birth = line.birthdate, person.death = line.deathdate&quot;, {batchSize:1000, parallel:false, retries: 10}) YIELD operations&quot;&quot;&quot;)</pre><pre>#would have more queries in query_list</pre><pre>for query in query_list:        <br>   g = graph.begin() # open transaction        <br>   result = g.run(query).to_data_frame() # execute query<br>   try:            <br>      if result[&#39;operations&#39;][0][&#39;failed&#39;] &gt; 0: #means batch failed<br>         print(&#39;Could not finish query&#39;)<br>      else: #means batch succeeded                <br>         g.commit() # close transaction<br>         print(&#39;Completed query &#39;)<br>   except Exception as e: #means there&#39;s a syntax or other error         <br>      g.commit() # close transaction  <br>      print(&#39;Completed query&#39;)</pre><h4>Parameterizing Queries</h4><p>I wrote a short separate article on this- long story short, you tag the simple .format() substitution onto the end of the Cypher query.</p><p><a href="https://madisongipson.medium.com/running-a-cypher-query-with-parameters-through-a-python-script-f0089e245b4d">Running a Cypher Query with Parameters through a Python Script</a></p><p>I haven’t written about these yet, but there are a few other tricks I have up my sleeve with constructing a Neo4j database (parallelizing queries, simple GUI to display script progress, etc.); however, they deserve their own articles and I have not written those yet. I plan to link them here once I do though!</p><p>If you’d like to check out the larger project from which this was pulled, see this repository.</p><p><a href="https://github.com/mgipson/Text-Similarity">mgipson/Text-Similarity</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9c1ada7413e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/automate-neo4j-database-construction-with-python-d9c1ada7413e">Automate Neo4j Database Construction with Python</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a Cypher Query With Parameters Through a Python Script]]></title>
            <link>https://medium.com/swlh/running-a-cypher-query-with-parameters-through-a-python-script-f0089e245b4d?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0089e245b4d</guid>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[graph-database]]></category>
            <category><![CDATA[cypher]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Sun, 13 Dec 2020 18:10:45 GMT</pubDate>
            <atom:updated>2020-12-14T06:49:11.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Clean, minimal workspace setup with laptop displaying code in front of a window." src="https://cdn-images-1.medium.com/max/700/1*W-7tMktpn801Yo_jgUrvsw.png" /></figure><p>I’ve been working on a project for a few months now that has involved tying a Neo4j database to a Dash application, which ultimately comes down to being able to run Cypher queries through Python code.</p><p>The library <a href="https://py2neo.org/2020.1/">Py2Neo</a> has been incredibly useful for this; you can run Cypher queries as-is or use the Py2Neo functions to perform similar actions. <br>My personal preference is running Cypher queries as-is because I can simply copy and paste the code to and from the Neo4j browser.</p><pre>Cypher Query in Neo4j Browser: <br>MATCH (n:Person) RETURN n.name AS name</pre><pre>Cypher Query with Py2Neo:<br>graph.run(&quot;&quot;&quot;MATCH (n:Person) RETURN n.name AS name&quot;&quot;&quot;).data()</pre><p>See how easy that is?</p><p><a href="https://medium.com/neo4j/py2neo-v4-2bedc8afef2">This article</a> details Py2Neo further.</p><p>Sometimes we need to dynamically substitute parameters into a query though. For a class project earlier this semester, I was trying to add descriptions for people nodes in my database.</p><p>This involved iterating through the names of people nodes, grabbing the person’s description from the Wikipedia API, then assigning the description to the person node in question. Doing this requires substitution of the person’s name into a Cypher query; the following code is how this was done.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6b521ed3d724e7cedb4992912e33431/href">https://medium.com/media/e6b521ed3d724e7cedb4992912e33431/href</a></iframe><p>It’s a simple .format() substitution on the string containing the Cypher query — nothing fancy, but incredibly useful and easy!</p><p>I hope this short tutorial was useful. If you have any additional methods to accomplish the same goal, please comment and let’s share our knowledge!</p><p>By the way, here’s the larger project from which this was taken!</p><p><a href="https://github.com/mgipson/Text-Similarity">mgipson/Text-Similarity</a></p><p>If you’d like to see how I’ve leveraged Py2Neo in an automated script that builds a Neo4j database, check out this article!</p><p><a href="https://madisongipson.medium.com/automate-neo4j-database-construction-with-python-d9c1ada7413e">Automate Neo4j Database Construction with Python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0089e245b4d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/running-a-cypher-query-with-parameters-through-a-python-script-f0089e245b4d">Running a Cypher Query With Parameters Through a Python Script</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips for Creating a Stellar ePortfolio]]></title>
            <link>https://madisonostermann.medium.com/tips-for-creating-a-stellar-eportfolio-dc26ac997aed?source=rss-3c0585509282------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc26ac997aed</guid>
            <category><![CDATA[linkedin]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[college]]></category>
            <category><![CDATA[resume]]></category>
            <dc:creator><![CDATA[Madison Ostermann]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 15:48:42 GMT</pubDate>
            <atom:updated>2020-06-19T17:01:58.001Z</atom:updated>
            <content:encoded><![CDATA[<p>To start, let’s answer a few questions.</p><h4>What’s an ePortfolio?</h4><p>An ePortfolio is basically a professional, personalized landing page; you can think of it as a customizable LinkedIn.</p><h4>Why should you have an ePortfolio?</h4><p>An ePortfolio is like your LinkedIn on steroids. You can include whatever content you’d like, not limited to the fields LinkedIn provides, and add your own personality flares through design (which is great for reasons described later in this article).</p><h4>What are the basic things to include in an ePortfolio?</h4><p>By the time you’re asking this question, you should already have a resume and LinkedIn, which is convenient since there’s a lot of overlap in content on each.</p><p>An ePortfolio should definitely include <strong>experiences</strong> (jobs) and <strong>education</strong> (degrees, certificates). Your other sections depend largely on where you are in your career and your area of expertise. As a college student, I include <strong>relevant college courses</strong> under education, and a few <strong>involvements and awards </strong>relating to my field. I have a section to showcase some <strong>coding projects</strong>, but similarly you could include a <strong>design portfolio</strong> or <strong>articles</strong> you’ve written. Something nice to include is an <strong>interests</strong> section (which I’ll talk about more in depth later) to give insight into your personality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qAYwM7556JzeGDSS" /><figcaption>Photo by <a href="https://unsplash.com/@christinhumephoto?utm_source=medium&amp;utm_medium=referral">Christin Hume</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So now that some of the foundational questions are answered, let’s get into these 6 tips for creating a stellar ePortfolio.</p><h3>3 Do’s</h3><h4>1. DO keep it consistent.</h4><p>Your resume, LinkedIn, ePortfolio, GitHub, business cards, and whatever other professional platforms you’re on should be <strong>aesthetically consistent</strong>. Using the same photos, style, colors, verbiage help comprise a cohesive look, which demonstrates to potential employers that you’re organized and can see the bigger picture.</p><p>For example: I use a handful of photos from the same photoshoot on all my platforms so there’s a little variation but everything’s still coordinated. On my ePortfolio, the main color used compliments the photos, which helps established a clean look.</p><h4>2. DO keep it true to you.</h4><p>I bet if we spent 10 minutes chatting, I’d discover 847 awesome things about you. Unfortunately, a potential employer is only going to spend 30 seconds (tops) glancing through your ePortfolio. You have to make those 847 awesome things apparent on first glance, and I’m not just talking about the skills you have that would make you a great candidate for the job.</p><blockquote>You want to show them you’re a person they want to work <strong>with</strong>, <br>not just someone who would be a good employee.</blockquote><p>You can do this by expressing who you are and what you’re about on your ePortfolio… after all, it is your personal landing page where you get to control the narrative about yourself.</p><p>I think a lot of times we hesitate showing our true personalities on LinkedIn or our personal websites because it could potentially be seen as unprofessional. However, there are tasteful ways to express personality without sacrificing professionalism.</p><ol><li>With Visuals: choose designs, layouts, and colors that reflect your personality.</li><li>With Content: include a little bit of humor in your about section to show your light-hearted attitude, create a personalized photo strip of places you’ve travelled, highlight a few articles you’ve written on Medium… including these things shows the depth of your personality and helps humanize you to potential employers. Plus, that stuff is fun!</li></ol><p>Showing your personality on your ePortfolio also helps companies that share common interests and values with you realize that you’d be a great fit, so in the end you’ll find a place to work that also works for you.</p><blockquote>In other words, <strong>if you seem plain online, you won’t attract colorful companies.</strong></blockquote><h4>3. DO show, don’t tell.</h4><p>Often we list things like “strong written and verbal communication,” “time management,” “organization,” and “collaboration” in our skills section, but when you have a personal website, you have the chance to <strong>show</strong> instead of <strong>tell</strong> about your skills. Here are a few examples of what I mean:</p><ul><li><strong>Show</strong> your strong communication skills by having stellar verbiage describing your experiences.</li><li><strong>Show</strong> time management by listing a job that you had while also in school.</li><li><strong>Show </strong>organization by having your website layout clean and even having your content across platforms consistent (like mentioned earlier).</li><li><strong>Show </strong>collaboration skills by listing group projects or teams you’ve been on.</li></ul><p>In addition to demonstrating your skills, you can <strong>show</strong> your work by including external links. If you do have any work on other platforms that you want employers to know about, this is your ultimate tool! For example, I not only link to my GitHub repos, but I also have a “projects” section highlighting some of the best projects I’ve done. These projects have their own links to GitHub or even a demo video on YouTube. You can get really creative here!</p><p>One thing you <strong>don’t</strong> want to link to on your website is your paper resume… it defeats the purpose of having an ePortfolio. Your website should include everything on your resume plus some; linking it reiterates information that’s already there.</p><h3>3 Dont’s</h3><p>ePortfolios are one of those things that if they’re done right, it scores you major points with a potential employer. If it’s done wrong though… it could hurt you more than help.</p><h4>1. DON’T make it for yourself.</h4><p>Yes, it’s your personal website that should showcase your personality and your work. But at the end of the day, you’re creating it so that potential employers can see if you’re a good fit for the company and position.</p><p>That means that the content should contain only what potential employers would care about. The best way to do this is to <em>reduce noise and emphasize highlights.</em></p><p><strong>To reduce noise, </strong>think: is the hiring manager at the company I want to work at going to think this would help me in this role? Are there transferrable skills I got from that involvement that I could bring into this role? If the answer is no and no, then omit it.</p><p><em>There is a line between what’s relevant and what helps you express your personality</em>; a rule of thumb is if you’re trying to keep something in the sections of experience, education, skills, involvements (basically the meatier sections) that helps express your personality, it doesn’t belong. Instead, think about dedicating a separate section (like “interests”) for these.</p><p>For example: I’ve been heavily involved in music my entire life, but I’m going into a career in software development, so none of my music involvements are listed under “experiences” or “involvements.” Instead, I included a photo strip at the bottom of my website where I highlight my interests, including music. This is a good compromise because I’m including those fun things that help express my personality, but don’t have them distracting from the primary sections.</p><p>If you’re having trouble figuring out what to filter, you can also get input from friends, family, university career office, etc. I’ve found having that outside perspective is really helpful in deciding what to keep and what to toss.</p><p><strong>Emphasizing highlights</strong> will be partially done after reducing noise; by taking out that clutter, the focus is on what’s left… which is the stuff that matters.</p><p>Another way to emphasize highlights further is visually; literally highlighting things or making them a different color/font/size help draw attention to them. For example, I highlighted words in my experience section that are also skills that an employer would look for. This ended up being a great replacement for my “skills” section too!</p><blockquote>Reducing noise and emphasizing highlights ensures that you’re not creating a website for yourself. And in the end, creating a website with content that’s relevant to them also demonstrates that you’re more focused on what they want than what you want, which is a great attribute to have as a potential employee.</blockquote><h4>2. DON’T use filler.</h4><p>After you reduce noise, you might feel like there’s not as much to work with and have a tendency to add in filler content. But remember… <strong>less is more</strong>.</p><p>For example, I didn’t list <em>all</em> the points from <em>all</em> my jobs, just the most important points from recent jobs. I listed my relevant college courses, but not all of them. If someone asked me about one of these courses in an interview, I’d be able to talk with them about what I learned and how it’s relevant to the position.</p><blockquote>Putting in extra filler material is like adding more ice cubes… it’s not any more effective than the original content, and just waters everything down.</blockquote><h4>3. DON’T just list, tell a story.</h4><p>This is more about your experiences section; using bullets is fine, but they shouldn’t be random points with no correlation. Whatever you add under an experience should tell a story about it, or give a bigger picture idea of what you did in that role. This isn’t exclusive to what you contributed; it can include any way you added value or even what you learned.</p><p>For example, in my current internship, I resolve support tickets, but I don’t list that on my ePortfolio. Instead I include the core skills that I use to resolve support tickets (aka <strong>transferrable skills</strong>). Focusing on the bigger picture of the technologies I use and the way the team works gives a clear impression of what it is I do.</p><p>Also, you don’t just want to tell a story about what you have done… <strong>also tell a story about what you can do in the future</strong>. By focusing on those transferrable skills and what you’ve learned, you’re also demonstrating what you can bring to future employers.</p><blockquote>Thank you to Anna Sirmeyer for being a great mentor and including me in the webinar in which I first shared these tips.</blockquote><blockquote><strong>Let me know if you found these pointers useful! Happy ePortfolio building :)</strong></blockquote><blockquote>Like and follow for more content around personal and professional development, productivity, and coding!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc26ac997aed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>