<?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 Radu Nedelcu on Medium]]></title>
        <description><![CDATA[Stories by Radu Nedelcu on Medium]]></description>
        <link>https://medium.com/@Mr.Radu?source=rss-c0a96773fdb9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pxyfxp2Gocuuu81UHBUNiA@2x.jpeg</url>
            <title>Stories by Radu Nedelcu on Medium</title>
            <link>https://medium.com/@Mr.Radu?source=rss-c0a96773fdb9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:19:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Mr.Radu/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[If you can’t beat the market at least you can protect from it using Python]]></title>
            <link>https://medium.com/swlh/protect-your-portfolio-using-cppi-strategy-in-python-c3184c2b6767?source=rss-c0a96773fdb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3184c2b6767</guid>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[asset-allocation]]></category>
            <dc:creator><![CDATA[Radu Nedelcu]]></dc:creator>
            <pubDate>Mon, 27 Jul 2020 17:46:09 GMT</pubDate>
            <atom:updated>2020-07-29T18:13:08.471Z</atom:updated>
            <content:encoded><![CDATA[<h4>Build your own portfolio downside protection strategy in Python</h4><h4>With lower transaction costs CPPI and TIPP strategies among the simplest ways to implement downside protection algorithms for your portfolio. Here’s a simple guide in Python.</h4><p>One of the most straightforward strategies to apply when building a portfolio is diversification. Diversification allows you to enjoy a portfolio that gives you back maximum reward for the risks you take.</p><p>You can increase exposure to different regions (North-America, Europe, Asia, etc.) or different sectors (industrials, pharmaceutical, financial, etc.) or different currencies or invest in different asset classes(equity, fixed income, alternative investments, cash instruments).</p><blockquote><em>Diversification works well on average in most market condition but it fails for example in extreme bear markets like the one induced by the COVID-19 lockdown.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q_lgSpsLt9d-5Sca" /><figcaption>Photo by <a href="https://unsplash.com/@natalie_rhea?utm_source=medium&amp;utm_medium=referral">Natalie Rhea Riggs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Welcome CPPI</h3><p>Black and Jones have introduced <strong>constant proportion portfolio investment (CPPI)</strong> in 1987. It allows you to dynamically allocate assets to get performance by exposing yourself to upside while protecting against downside. It’s a strategy that works well without having to introduce derivatives like options in your portfolio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*COU3YI9LYtCX9Gw8" /><figcaption>Photo by <a href="https://unsplash.com/@alexblock?utm_source=medium&amp;utm_medium=referral">Alex Block</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>How does it work?</h3><p>You will allocate a portion of your portfolio to the risky assets in multiple M the difference between your assets value (AV) and a given floor (F).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FctisMHRVeT57vYdCQbgdA.png" /><figcaption><a href="http://www.deltaquants.com/Introduction-to-risks-in-CPPI-products">http://www.deltaquants.com/Introduction-to-risks-in-CPPI-products</a></figcaption></figure><p><em>For example given a multiplier M=4 and assuming your current asset value (AV) is at 100%, and you want to keep its value at a minimum 85% (floor F=85%). You can invest 4x($100-$85)=4x$15=$60 into your risky assets and the rest of $40 to safe assets.</em></p><h4>Not a silver bullet..</h4><p>Implement this carefully and trade frequently and you can almost guarantee you will never go below the floor. Trade rarely, once a quarter, and there might be cases when the losses you make in the risky portfolio between two trade dates can bring your portfolio value below the floor. This will happen if the losses in your risky portfolio compared to your safe assets are higher than 1 over the multiplier M.</p><p><em>For example, if your multiplier M is 4,1/4=0.25, so if in a quarter your losses in the risky portfolio are higher than 25% in relation to your safe assets you will break the floor.</em></p><h3>How to do it in Python?</h3><p>I will show you the CPPI strategy using the S&amp;P 500 Index data. <a href="https://datahub.io/core/s-and-p-500#data-cli">This is the index data source, and it also contains more details about the columns used.</a></p><p>Let’s import the S&amp;P 500 Index data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3a009af6ab62de0cd515f279b9076d2/href">https://medium.com/media/c3a009af6ab62de0cd515f279b9076d2/href</a></iframe><p>Next, we need to define what is a safe asset. It could be a coupon bearing bond, zero coupon bond or a high yield savings account, but for reference (and because we can find this data easier) we can take the <a href="https://www.treasury.gov/resource-center/data-chart-center/interest-rates/pages/textview.aspx?data=yield">3 month U.S. Treasury Bill</a> which on average is 4.29% whereas at the time I’m writing this it’s 0.13%. For exercise purposes I will pick 2% or 0.02 which is a sensible value.</p><p>I will also pick $100 as my portfolio starting value and a floor of 70% — so will not accept my portfolio to drop below 70% of its value. Will pick the multiplier <em>m</em> to be 6 (multiplier values between 3 and 8 are very common).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b60561799fcbd91c6a2df3b664368d8/href">https://medium.com/media/6b60561799fcbd91c6a2df3b664368d8/href</a></iframe><h4>The CPPI algorithm has 5 main steps</h4><ol><li>Calculate the cushion value: C=<em>CPPI - F</em></li><li>Calculate the allocation to the risky asset: <em>E=C x m</em></li><li>Calculate the allocation in the safe asset which is the remainder: <em>B=CPPI-E</em></li><li>Compute the growth of your risky and safe allocations:</li></ol><p><em>CPPI = E*(1 + risky_price_change)+ B*(1 + safe_asset_return)</em></p><p>*<em>safe_asset_return can be a coupon or the price change of a zero-coupon bond</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb57f19d87e7dc6e944f20f4d8e1301c/href">https://medium.com/media/bb57f19d87e7dc6e944f20f4d8e1301c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa746fa763da1dc826b7d7ab617348ce/href">https://medium.com/media/aa746fa763da1dc826b7d7ab617348ce/href</a></iframe><p>Run it and plot the results.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8aaf4558bf834a1e4c843f92363504f/href">https://medium.com/media/b8aaf4558bf834a1e4c843f92363504f/href</a></iframe><p>As you can see in the chart below, the CPPI strategy can protect against downside. The 2002 dot-com bubble and the 2008 subprime loans market crashes the portfolio value preserved above the floor (70% of the initial value in this case).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6_BKOycXG2R2m8Mse3tkg.png" /></figure><p>Looking at the weight allocations relative to the portfolio value, we can see how the allocation to risk assets dropped while the allocation to safe assets increased during market downturns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hH4W2S3YCE0by4jGNrNu5Q.png" /><figcaption>Risk vs Safe allocation</figcaption></figure><p>One drawback is that once your portfolio value reaches new heights (after 2013), the chance of falling and breaching the initially set floor value reduces — there is almost no chance it can breach it in the near term. As a consequence, you would end up fully invested in the risky assets.</p><p>In one scenario you might be thinking if setting the floor at $70 when the portfolio value is above $150 or more, is a sensible thing. It would make more sense to update the floor along with our portfolio value.</p><h3>Welcome TIPP</h3><p>Estep and Kritzman developed <strong>TIPP (Time — Invariant Protection Portfolio)</strong> with origins in CPPI, in1988. Essentially with TIPP we update the floor relative to the previous maximum portfolio value and not the initial value of the portfolio.</p><p>We will also update the code so that we can adjust the rebalancing periods. Remember the wider the gap between trade points the higher the probability to break the floor.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a3d6287431feff7e0102bfff705c2a8/href">https://medium.com/media/4a3d6287431feff7e0102bfff705c2a8/href</a></iframe><p>This time we will run it for data from 1990 and we will set the constant multiplier M=4.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c79678bbf338d730017b494bdfe87ad/href">https://medium.com/media/3c79678bbf338d730017b494bdfe87ad/href</a></iframe><p>As expected, floor value increases and always sits at 70% level from the maximum previous portfolio value. So for example, if in 2008 just before market downturn my portfolio value was roughly $500, the floor will be set at $350 level until 2014 when we have a new peak and hence a new floor value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7i_S4BX3XligstN9KdsfQ.png" /></figure><h3>Conclusion</h3><p>CPPI and TIPP are basic downside insurance algorithms. They can be used like a structured product where you can consider an index or ETF as your risky asset, bond, savings account or even cash as your safe asset.</p><p>Both CPPI and TIPP are limited by the transaction costs that occur when rebalancing frequently, however nowadays, trading applications charge almost nothing for transactions so these strategies become more practical.</p><p>Feel free to play around with the multiplier and test this algorithm on bigger time frames and various products other than S&amp;P 500 Index or the default 2% safe asset return.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3184c2b6767" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/protect-your-portfolio-using-cppi-strategy-in-python-c3184c2b6767">If you can’t beat the market at least you can protect from it using Python</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[How to get free  historical and live stock prices and FX rates using Python]]></title>
            <link>https://medium.com/data-science/how-to-get-free-historical-and-live-stock-prices-and-fx-rates-using-python-part-i-a7718f0a4e4?source=rss-c0a96773fdb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7718f0a4e4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[stock-price]]></category>
            <category><![CDATA[stock-market]]></category>
            <dc:creator><![CDATA[Radu Nedelcu]]></dc:creator>
            <pubDate>Mon, 06 Jul 2020 09:55:23 GMT</pubDate>
            <atom:updated>2020-07-21T15:20:50.678Z</atom:updated>
            <content:encoded><![CDATA[<h4>Stock prices in Python</h4><h3>How to get free historical and live stock prices and FX rates using Python</h3><h4>This is a guide that shows how to get historical and live stock prices and FX rates using Python from either <a href="https://finance.yahoo.com/">Yahoo Finance</a> or <a href="https://www.alphavantage.co/">Alpha Vantage</a>.</h4><p>Both APIs are free, however Alpha Vantage standard API limits to <a href="https://www.alphavantage.co/premium/">5 requests per minute and 500 requests per day</a>. This should be enough for a simple portfolio stock monitoring tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GmliIWmCgG_D4b85" /><figcaption>Photo by <a href="https://unsplash.com/@chrisliverani?utm_source=medium&amp;utm_medium=referral">Chris Liverani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>How many APIs are there?</h3><p>The list is long and has increased in recent years. The list of providers who allow free API calls for stock market data includes: <a href="https://finnhub.io/">Finnhub.io</a>, <a href="https://www.tenquant.io/">TenQuant.io</a>, <a href="https://unibit.ai/api/docs/V2.0/introduction">UniBit</a>, <a href="https://iexcloud.io/">IEXCloud</a>, <a href="https://marketstack.com/">marketstack</a>, <a href="https://www.quandl.com/">Quandl</a>, <a href="https://eodhistoricaldata.com/">EOD Historical Data</a> and it is constantly changing.</p><h3>Which market identifiers do I use?</h3><p>In practice in the financial services industry you will come across SEDOL, ISIN, CUSIP, RIC, BB Ticker, BB Full Ticker (last two are bloomberg identifiers) but for the free APIs you can check out this list of MICs (market identifier code) <a href="https://www.iso20022.org/market-identifier-codes">here</a>.</p><h3>Yahoo Finance</h3><p>Yahoo Finance API is free but the universe of tickers is limited. It’s also harder to identify what ticker should you use in your API call but the ISO list above can help. Below is a set of functions that can return closing prices for either a ticker or a list of tickers. You can change the period but some of the tickers don’t have data that old.</p><p>The code below used a Python wrapped for the Yahoo Finance API and for more details you can check <a href="https://github.com/ranaroussi/yfinance">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79d4f254b0ae380472f4a02a95c5635b/href">https://medium.com/media/79d4f254b0ae380472f4a02a95c5635b/href</a></iframe><p>Here is an example of using the price function for the USDGBP currency pair:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncRhVNWht0jnXwdQj9UjZA.png" /></figure><p>Another one for two stock prices:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4vVrNQL0MU0KtoWdByTQg.png" /></figure><h3>Alpha Vantage</h3><p>Alpha Vantage is offering cloud based stock market API. Users can access historical and real-time financial data, technical indicators and other data types. Both founders of the startup are MBA graduates from Harvard Business School.</p><p>To use the <a href="https://www.alphavantage.co/support/#api-key">Alpha Vantage Standard API you will have to sign up first</a>. There is a documentation page with more examples of API calls if you want to get more or other kinds of data.</p><p>The code below uses a Python wrapper for Alpha Vantage API with more details available <a href="https://github.com/RomelTorres/alpha_vantage">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1bee3a4cbc4b83acc6fb7c590755ce5/href">https://medium.com/media/c1bee3a4cbc4b83acc6fb7c590755ce5/href</a></iframe><p>Here is an example using the get_prices function for Microsoft Corporation (MSFT) and Tesla, Inc. (TSLA):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pH6zmPSqOhoRxTc7BRs2FQ.png" /></figure><p>Another one for FX rates paired to GBP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nHejpB8a5dUaJKsgllv-rg.png" /></figure><p>For a basic stock portfolio tool price and rates is the minimum you need to compute your own metrics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7718f0a4e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/how-to-get-free-historical-and-live-stock-prices-and-fx-rates-using-python-part-i-a7718f0a4e4">How to get free  historical and live stock prices and FX rates using Python</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[External config file in .NET Core 3.0]]></title>
            <link>https://medium.com/@Mr.Radu/external-config-file-in-net-core-3-0-5cbe06ca74d1?source=rss-c0a96773fdb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cbe06ca74d1</guid>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[config]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Radu Nedelcu]]></dc:creator>
            <pubDate>Fri, 14 Feb 2020 15:32:50 GMT</pubDate>
            <atom:updated>2020-02-14T15:32:50.618Z</atom:updated>
            <content:encoded><![CDATA[<h3>External config file in .NET Core 3.0</h3><p>I am going to show one way to provide external config files to a .NET Core 3.0 Console App or WPF application.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b197959a94f624d1b1d750d0b2d2d29/href">https://medium.com/media/2b197959a94f624d1b1d750d0b2d2d29/href</a></iframe><p>You will have to provide full path for the .json configuration file.</p><h3>How to use it?</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/244cbefd57286e9dd1da15495edc34b5/href">https://medium.com/media/244cbefd57286e9dd1da15495edc34b5/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cbe06ca74d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dockerize your Python script and connect to external SQL Server]]></title>
            <link>https://medium.com/data-science/deploying-python-script-to-docker-container-and-connect-to-external-sql-server-in-10-minutes-225ff4c19ce5?source=rss-c0a96773fdb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/225ff4c19ce5</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Radu Nedelcu]]></dc:creator>
            <pubDate>Fri, 14 Feb 2020 15:11:02 GMT</pubDate>
            <atom:updated>2020-07-09T16:46:03.876Z</atom:updated>
            <content:encoded><![CDATA[<h4>Docker, Python and SQL Server</h4><h4>Having looked over many links and tutorials I decided to write a simple guide on how to deploy a Python script to a Docker container and then connect to an external SQL Server instance and execute a simple insert command using <a href="https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/python-sql-driver-pyodbc?view=sql-server-ver15"><em>pyodbc</em></a>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WnAVipFG3GSJRIYE" /><figcaption>Photo by <a href="https://unsplash.com/@arifriyanto?utm_source=medium&amp;utm_medium=referral">Arif Riyanto</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This guide is written assuming you already have:</p><ul><li>Docker installed and switched to using Linux containers</li><li>SQL Server instance running</li></ul><p>You need to create 3 files:</p><ul><li>Dockerfile</li><li>main.py (which is your main Python code)</li><li>requirements.txt</li></ul><h4>Dockerfile</h4><pre>FROM python:3</pre><pre>WORKDIR /app</pre><pre>ADD requirements.txt .<br>ADD main.py .</pre><pre>#Optional<br>ENV https_proxy=<a href="http://proxy1.uk.webscanningservice.com:3128/">http://[</a>proxy]:[port]<br>ENV http_proxy=<a href="http://proxy1.uk.webscanningservice.com:3128/">http://[</a>proxy]:[port]</pre><pre># install FreeTDS and dependencies<br>RUN apt-get update \<br> &amp;&amp; apt-get install unixodbc -y \<br> &amp;&amp; apt-get install unixodbc-dev -y \<br> &amp;&amp; apt-get install freetds-dev -y \<br> &amp;&amp; apt-get install freetds-bin -y \<br> &amp;&amp; apt-get install tdsodbc -y \<br> &amp;&amp; apt-get install --reinstall build-essential -y</pre><pre># populate &quot;ocbcinst.ini&quot; as this is where ODBC driver config sits<br>RUN echo &quot;[FreeTDS]\n\<br>Description = FreeTDS Driver\n\<br>Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\<br>Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so&quot; &gt;&gt; /etc/odbcinst.ini</pre><pre>#Pip command without proxy setting<br>RUN pip install -r requirements.txt</pre><pre>#Use this one if you have proxy setting<br>RUN pip --proxy <a href="http://proxy1.uk.webscanningservice.com:3128/">http://</a>[proxy:port] install -r requirements.txt</pre><pre>CMD [&quot;python&quot;,&quot;-i&quot;,&quot;main.py&quot;]<br></pre><h4>main.py</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae47437d1b99d8a955d190be83403a91/href">https://medium.com/media/ae47437d1b99d8a955d190be83403a91/href</a></iframe><h4>requirements.txt</h4><ul><li><strong>Option 1</strong></li></ul><p>Create a text file and add one line as follows:</p><pre>pyodbc==4.0.28</pre><ul><li><strong>Option 2</strong></li></ul><p>Use Python terminal if you use <a href="https://www.jetbrains.com/pycharm/">PyCharm </a>or any terminal and run <a href="https://pip.pypa.io/en/stable/reference/pip_freeze/"><em>pip freeze</em></a> command:</p><pre>pip freeze &gt; requirements.txt</pre><p>This will produce a file with all required modules.</p><h3>Build &amp; Run Docker image</h3><p>Finally we want to build and run the image.</p><pre>#Build the image<br>docker build -t my-app .<br>#Run it<br>docker run my-app<br>#Find container name<br>docker ps --last 1<br>#Check logs<br>docker logs &lt;container name&gt;</pre><p>If you want to explore the container and run the script manually then modify last line of the <em>Dockerfile, </em>build and run<em> again</em>:</p><pre>#CMD [&quot;python&quot;,&quot;-i&quot;,&quot;main.py&quot;]</pre><pre>CMD tail -f /dev/null</pre><p>This will make the container long running, enabling you to open a bash shell within using:</p><pre>docker exec -ti &lt;container name&gt; bash</pre><p>Then you would be able to explore the container and execute <em>main.py</em> manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*oF_2RSBuq3acqOTO8PIhyw.png" /><figcaption>Screenshot of the container after opening bash shell</figcaption></figure><p>If you want to stop or remove your container use:</p><pre>#List all containers<br>docker ps -a</pre><pre>#List all container id<br>docker ps -aq</pre><pre>#Stop container<br>docker stop &lt;container_name&gt;</pre><pre>#Will remove all your containers<br>docker rm -f $(docker ps -aq)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=225ff4c19ce5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/deploying-python-script-to-docker-container-and-connect-to-external-sql-server-in-10-minutes-225ff4c19ce5">Dockerize your Python script and connect to external SQL Server</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>