<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Python Archives - asap developers</title>
	<atom:link href="https://www.asapdevelopers.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.asapdevelopers.com/category/python/</link>
	<description>San Francisco Mobile App Developers</description>
	<lastBuildDate>Mon, 11 Jul 2022 19:20:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://www.asapdevelopers.com/wp-content/uploads/2017/04/favicon-asap-1.png</url>
	<title>Python Archives - asap developers</title>
	<link>https://www.asapdevelopers.com/category/python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Data analytics using Python’s Dash framework</title>
		<link>https://www.asapdevelopers.com/data-analytics-using-python-dash-framework/</link>
					<comments>https://www.asapdevelopers.com/data-analytics-using-python-dash-framework/#respond</comments>
		
		<dc:creator><![CDATA[Joaquin Acuña]]></dc:creator>
		<pubDate>Mon, 11 Jul 2022 19:20:15 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=15155</guid>

					<description><![CDATA[<p>Data analytics is a big part of the tech industry and one of the key tools of any successful decision-making process. Having the right means to manage and visualize data...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/data-analytics-using-python-dash-framework/">Data analytics using Python’s Dash framework</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">Data analytics is a big part of the tech industry and one of the key tools of any successful decision-making process. Having the right means to manage and visualize data can be a lifesaver in many situations. This is why, in this article, we will show how to use Python Dash to build a choropleth map app for data analytics and go over some Dash framework basics.</span></p>
<h2><span style="font-weight: 400;">What is Dash? </span></h2>
<p><span style="font-weight: 400;">According to the </span><a href="https://dash.plotly.com/"><span style="font-weight: 400;">official documentation</span></a><span style="font-weight: 400;">, “<em>Dash is the original low-code framework for rapidly building data apps in Python, R, Julia, and F# (experimental).</em>”</span></p>
<p><span style="font-weight: 400;">Dash was written on top of Plotly.js and React.js, making it an ideal tool for building and deploying data apps with customized user interfaces. Dash works by abstracting away all the technologies and protocols needed to build a full-stack web app that includes interactive data visualization through a couple of simple patterns.</span></p>
<p><span style="font-weight: 400;">Dash is so simple that it will take you less than 10 minutes to bind a user interface to your code.</span></p>
<p><span style="font-weight: 400;">An app developed with Dash is rendered on a web browser. It can be deployed to VMs or</span><a href="https://plotly.com/dash/kubernetes/"> <span style="font-weight: 400;">Kubernetes clusters</span></a><span style="font-weight: 400;"> to then share it through URLs. The fact that Dash is rendered on the web, means it’s also inherently cross-platform and mobile-ready!</span></p>
<p><span style="font-weight: 400;">All of these features make Dash quite popular; the framework is currently downloaded 600,000 times each month.</span></p>
<h2><span style="font-weight: 400;">What can be done with Dash? </span></h2>
<p><span style="font-weight: 400;">Well, Dash is just the pencil and you are the actual artist. However, to give an idea of what this framework can help you create, check out the </span><a href="https://dash.gallery/Portal/"><span style="font-weight: 400;">Dash app gallery</span></a><span style="font-weight: 400;">.</span></p>
<p><a href="https://dash.gallery/dash-soccer-analytics/"><span style="font-weight: 400;">This</span></a><span style="font-weight: 400;"> is my personal favorite.</span></p>
<h2><span style="font-weight: 400;">Building your first Dash graph</span></h2>
<p><span style="font-weight: 400;">Now that you have some context, let’s get to it and build a Dash graph.</span></p>
<h3><span style="font-weight: 400;">Install Python&#8217;s Dash</span></h3>
<p><span style="font-weight: 400;">First, you’ll need to create a virtual environment and activate it.</span></p>
<p>&nbsp;</p>
<p><strong>virtualenv dashvenv</strong></p>
<p><strong>source ./dashvenv/bin/activate</strong></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Then, install Dash.</span></p>
<p>&nbsp;</p>
<p><strong>pip install dash</strong></p>
<p><strong>pip install jupyter-dash</strong></p>
<p><strong>pip install pandas</strong></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">You can try running one of Dash’s ready-made examples; just create an app.py file and copy one of the </span><a href="https://dash.plotly.com/layout"><span style="font-weight: 400;">following examples</span></a><span style="font-weight: 400;">. For this article, we’ll be using the one below.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">gist</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/046b3881aac13b796dce3713d20fb60f.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/046b3881aac13b796dce3713d20fb60f"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<h3><span style="font-weight: 400;">Test the installation</span></h3>
<p><span style="font-weight: 400;">Now, run the example and see how it works. </span></p>
<p><strong># Run this app with `python app.py` and</strong></p>
<p><strong># visit http://127.0.0.1:8050/ in your web browser.</strong></p>
<h3><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-15161 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image1-300x116.png" alt="" width="393" height="152" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image1-300x116.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image1-768x296.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image1-900x349.png 900w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image1.png 906w" sizes="(max-width: 393px) 100vw, 393px" /></span></h3>
<h3><span style="font-weight: 400;">Change the example</span></h3>
<p><span style="font-weight: 400;">Dash includes a hot-reloading feature that is activated by default when running an app with app.run_server(debug=True). Therefore, Dash will automatically refresh your browser whenever you make a change to your code.</span></p>
<p><span style="font-weight: 400;">Give it a try by changing the title &#8220;Hello Dash&#8221; in your application or by changing the data on the x- or y-axis. Your app should auto-refresh with your changes.</span></p>
<h2><span style="font-weight: 400;">The 3 pillars of Dash</span></h2>
<p><span style="font-weight: 400;">We’ve shown you how to create an example graph app using Dash. Now it’s time to dig a little deeper into Dash itself by looking into three aspects of this framework: Dash components, plotly graphs, and Dash callbacks.</span></p>
<h3><span style="font-weight: 400;">Dash components</span></h3>
<p><span style="font-weight: 400;">dash_html_components (known as dash.html as of Dash version 2.0) includes a component class for each HTML tag, as well as keyword arguments for every HTML argument.</span></p>
<p><span style="font-weight: 400;">Dash provides supercharged components to help you create interactive user interfaces. You can find a core set of components (that are written and maintained by the Dash team) in the dash-core-components library.</span></p>
<p><span style="font-weight: 400;">When it comes to producing Dash apps, we&#8217;d advise you to manage the Dash Core Components styling and layout with Dash Enterprise.</span></p>
<h3><a href="https://plotly.com/python/"><span style="font-weight: 400;">Plotly graphs</span></a></h3>
<p><span style="font-weight: 400;">Plotly&#8217;s Python graphing library helps you create interactive graphs with publication quality. The library includes a wide variety of examples showing you how to produce different plots, charts, histograms, heatmaps, and more. Plotly.py is</span><a href="https://plotly.com/python/is-plotly-free"> <span style="font-weight: 400;">free and open-source</span></a><span style="font-weight: 400;">; this means you can</span><a href="https://github.com/plotly/plotly.py"> <span style="font-weight: 400;">view the source, report issues or even contribute on GitHub</span></a><span style="font-weight: 400;">!</span></p>
<h3><span style="font-weight: 400;">Dash callbacks</span></h3>
<p><span style="font-weight: 400;">Dash apps use callback functions (i.e.: functions that are automatically called by Dash whenever an input component&#8217;s property changes), in order to update some property in another component (i.e.: the output).</span></p>
<h2><span style="font-weight: 400;">Creating your own Python&#8217;s Dash app</span></h2>
<p><span style="font-weight: 400;">Now that we’ve gone over the basics, it’s time to get serious.</span></p>
<p><span style="font-weight: 400;">We will use a </span><a href="https://github.com/owid/covid-19-data/tree/master/public/data"><span style="font-weight: 400;">Covid-19 public dataset</span></a><span style="font-weight: 400;"> to create a world map with the pandemic evolution over time.  </span></p>
<p><span style="font-weight: 400;">First, you need to pull the data as CSV and create a pandas dataframe that includes just the relevant information.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-15162 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image2-1-300x75.png" alt="" width="436" height="109" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image2-1-300x75.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image2-1-768x192.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image2-1.png 929w" sizes="(max-width: 436px) 100vw, 436px" /></span></p>
<p><span style="font-weight: 400;">Then, create a Dash component that contains the following:</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">DIV</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">H1 header</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">DROPDOWN slct_year, which will contain the dates of our dataset</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">DIV output_container, a div that will display a user-friendly message </span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">A graph of the world heat map</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">To do this, you’ll have to re-format the dates in an object to create the Dash dropdown component.  </span></p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-15163" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image3-300x47.png" alt="python dash" width="421" height="66" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image3-300x47.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image3-768x120.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image3.png 845w" sizes="(max-width: 421px) 100vw, 421px" /></p>
<p><span style="font-weight: 400;">Then, you can create the app layout with your Dash components.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-15164" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image4-300x127.png" alt="python dash" width="435" height="184" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image4-300x127.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image4-768x326.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image4.png 788w" sizes="(max-width: 435px) 100vw, 435px" /></span></p>
<p><span style="font-weight: 400;">Now, you’ll need to create a callback function that will have the dropdown value as input, and the output_container and the map to update the information with the given input.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-15165" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image5-300x53.png" alt="python dash framework" width="408" height="72" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image5-300x53.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image5.png 661w" sizes="(max-width: 408px) 100vw, 408px" /></span></p>
<p><span style="font-weight: 400;">Then, you can define what to do with the input given value, that is, the selected year.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-15166 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image6-300x171.png" alt="" width="391" height="223" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image6-300x171.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image6.png 735w" sizes="(max-width: 391px) 100vw, 391px" /></span></p>
<p><span style="font-weight: 400;">You then create the friendly message and the choropleth graph.</span></p>
<p><span style="font-weight: 400;">You can find more information about this plotly.express.choropleth </span><a href="https://plotly.github.io/plotly.py-docs/generated/plotly.express.choropleth.html"><span style="font-weight: 400;">here</span></a><span style="font-weight: 400;">.</span></p>
<p><span style="font-weight: 400;">The data frame will be filtered by date; you can go ahead and add a continent filter, or add a selector for different values, such as vaccination percentage or tests performed.</span></p>
<p><span style="font-weight: 400;">If everything goes well, you should be able to run our app and see it working.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-15167" src="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7-300x163.png" alt="python's dash" width="427" height="232" srcset="https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7-300x163.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7-1024x556.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7-768x417.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7-1536x834.png 1536w, https://www.asapdevelopers.com/wp-content/uploads/2022/07/image7.png 1680w" sizes="(max-width: 427px) 100vw, 427px" /></span></p>
<p><span style="font-weight: 400;">You can find the repository for this project </span><a href="https://github.com/JoaquinAcuna97/dash.plotly"><span style="font-weight: 400;">here</span></a><span style="font-weight: 400;">.</span></p>
<h2><span style="font-weight: 400;">Final thoughts on data analytics using Python Dash framework</span></h2>
<p><span style="font-weight: 400;">As we can see, amazing apps can be built with small pieces of code by using <a href="https://www.asapdevelopers.com/python-development-company/">Python Dash framework</a>. This is definitely a powerful tool for every developer to have in their toolkit. Moreover, as we all know, when it comes to building something complex, patience and practice are the keys to success. So start practicing!</span></p>
<p>&nbsp;</p>

		<div id="fws_693973b474f6b"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row top-level standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/data-analytics-using-python-dash-framework/">Data analytics using Python’s Dash framework</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.asapdevelopers.com/data-analytics-using-python-dash-framework/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Free Python resources for every developer</title>
		<link>https://www.asapdevelopers.com/free-python-resources-for-every-developer/</link>
		
		<dc:creator><![CDATA[Pablo Giampedraglia]]></dc:creator>
		<pubDate>Mon, 06 Dec 2021 20:50:47 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=15072</guid>

					<description><![CDATA[<p>Designed by Guido van Rossum, Python is a programming language that was first released back in 1991 and has been gaining traction in the industry over the last few years....</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/free-python-resources-for-every-developer/">Free Python resources for every developer</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[


<p>Designed by Guido van Rossum, <a href="https://www.python.org/">Python</a> is a programming language that was first released back in 1991 and has been gaining traction in the industry over the last few years. With an emphasis on <a href="https://softwareengineering.stackexchange.com/questions/162923/what-defines-code-readability">code readability</a>, this open-source language is platform-independent, friendly and easy to use, not to mention it increases productivity. Python is also <a href="https://www.asapdevelopers.com/python-backend-language/">our backend language of choice</a> and, in this article, we’d like to help those delving into this language by sharing a comprehensive list of free Python resources for every developer.</p>
<p>We’ll start with some free Python resources for beginners, delve into some Python development tools and, of course, also cover some very useful Python libraries. We’ll also leave you with some useful Python blogs and podcasts, as well as the most relevant Python communities to help you at every step of your Python journey.</p>





<h2>Free Python resources for beginners</h2>





<p><img decoding="async" loading="lazy" class=" wp-image-15075 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image1-300x170.png" alt="free python resources" width="394" height="223" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image1-300x170.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image1-768x435.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image1.png 909w" sizes="(max-width: 394px) 100vw, 394px" /></p>
<p>If you are just starting out with this programming language, here is a list of free Python resources for beginners during their learning process.</p>



<ol>
<li><a href="https://docs.python.org/?ref=hackernoon.com">Official Python documentation</a></li>
</ol>



<p>If you are a “do-it-yourself” kind of person, the official Python documentation is the best place to start. It includes a comprehensive <a href="https://docs.python.org/3/tutorial/index.html">tutorial</a> on the language, as well as <a href="https://docs.python.org/3/whatsnew/3.10.html">information about updates</a>. There are also <a href="https://docs.python.org/3/library/index.html">library</a> and <a href="https://docs.python.org/3/reference/index.html">language references</a>, information about <a href="https://docs.python.org/3/installing/index.html">installing</a> and <a href="https://docs.python.org/3/distributing/index.html">distributing Python modules</a>, and more in-depth knowledge.</p>



<ol start="2">
<li><a href="https://www.codecademy.com/catalog">Codecademy</a></li>
</ol>



<p>Codecademy offers free courses for a variety of programming languages. They have a <a href="https://www.codecademy.com/catalog/language/python">dedicated Python section</a> that includes over a dozen beginner-friendly courses. Their free courses include Learn Python 2, Exploratory Data Analysis with Python, and Build Connect Four using Python.</p>



<p>Codecademy also offers a pro version with plenty of extra courses for both beginners and intermediate learners. You can make use of their free trial if you want to see if it’s worth it, after which the pro version costs <a href="https://www.codecademy.com/student-center">$149.99/year for students</a>.</p>



<p>The Codecademy website also includes Python <a href="https://www.codecademy.com/resources/docs/python">documentation</a>, <a href="https://www.codecademy.com/resources/videos/playlists/PLFzsFUO-y0HCLZORWHixExcnJ_E_54zi0">videos</a> and <a href="https://www.codecademy.com/resources/cheatsheets/language/python">cheat sheets</a>.</p>



<ol start="3">
<li><a href="https://learnpythonthehardway.org/book/">Learn Python The Hard Way</a></li>
</ol>



<p>Zed A. Shaw has created a series of books to help developers master Python. On the website, you’ll find a <a href="https://learnpythonthehardway.org/python3/">free sample of the Learn Python the Hard Way book</a>. This is a great way to get started and help you decide if this is the right tool for you. The free sample includes up to Exercise 8 and you can acquire the full book with 52 exercises for $29.99.</p>



<ol start="4">
<li><a href="https://www.w3schools.com/default.asp">W3Schools</a></li>
</ol>



<p>W3Schools is an excellent place to go when learning the most popular programming languages. Their <a href="https://www.w3schools.com/python/?ref=hackernoon.com">Python tutorial</a> is quite comprehensive; it includes plenty of examples and even a quiz to test your knowledge.</p>



<p>Their tutorial is free of charge, but there are also <a href="https://courses.w3schools.com/courses/python">paid courses</a> available if you’d like to get certified.</p>



<ol start="5">
<li><a href="https://developers.google.com/edu/python/">Google’s Python class</a></li>
</ol>



<p>Although Google’s Python class does not require any prior Python knowledge, it is best if you have some programming experience to make the most of it. In addition to examples and exercises, the class also includes helpful video lectures.</p>



<ol start="6">
<li><a href="https://python.swaroopch.com/">A Byte of Python</a></li>
</ol>



<p>A Byte of Python is a free book on programming with Python. It’s a great guide for complete programming beginners. The book covers Python version 3, although it also includes some guidance to adapt the knowledge to the previous Python version. Moreover, you will also find <a href="https://python.swaroopch.com/what_next.html">links to more resources</a> to continue learning once you are done with the book.</p>



<ol start="7">
<li><a href="https://docs.python-guide.org/?ref=hackernoon.com">The Hitchhiker’s Guide to Python</a></li>
</ol>



<p>The Hitchhiker’s Guide to Python is an extremely comprehensive source for Python development that is continuously updated. It gives you some context about the language and teaches you how to install it. It also goes over the various Python development environments and shows you how to write great Python code, among many other things. This guide is particularly useful if you are focused on the best practices for working with Python.</p>



<ol start="8">
<li><a href="https://code.tutsplus.com/articles/the-best-way-to-learn-python--net-26288">TutsPlus</a></li>
</ol>



<p>TutsPlus offers an excellent How-to tutorial for Python with links to dozens of different resources. As stated on its site, it is a “blueprint for making Python easy, fun and rewarding to learn.” It covers all the basics and includes links to a variety of ebooks, documentation, libraries and tools.</p>



<h2>Top Python blogs and podcasts</h2>





<p><img decoding="async" loading="lazy" class=" wp-image-15076 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image2-300x200.png" alt="Python free resources" width="374" height="249" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image2-300x200.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image2-768x511.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image2.png 824w" sizes="(max-width: 374px) 100vw, 374px" /></p>
<p>Whether you are looking for free Python resources for beginners or if you are an expert who wants to keep updated on the latest news about Python and get some solid tips, blogs and podcasts can be extremely helpful.</p>



<p>There are countless podcasts and blogs devoted to Python so we’ve made a selection that covers various aspects of the programming language. We won’t overwhelm you with extensive details, so here is a list of some of the top Python blogs and podcasts out there.</p>



<h3>Blogs</h3>



<ol>
<li><a href="http://love-python.blogspot.com/">Love Python</a></li>
<li><a href="https://planetpython.org/">Planet Python</a></li>
<li><a href="http://www.pybloggers.com/">PyBloggers</a></li>
<li><a href="https://www.blog.pythonlibrary.org/">Mouse Vs Python</a></li>
<li><a href="https://realpython.com/">Real Python</a></li>
<li><a href="https://www.fullstackpython.com/blog.html">Full Stack Python</a></li>
<li><a href="https://pbpython.com/">Practical Business Python</a></li>
</ol>



<h3>Podcasts</h3>



<ol>
<li><a href="https://realpython.com/podcasts/rpp/">The Real Python Podcast</a></li>
<li><a href="https://talkpython.fm/">Talk Python to Me</a></li>
<li><a href="http://podcastinit.com/">Podcast.init</a></li>
<li><a href="https://djangoriffs.com/">Django Riffs</a></li>
<li><a href="http://pythontesting.net/test-podcast/">Test and Code Podcast</a> </li>
<li><a href="https://pythonbytes.fm/">Python Bytes</a></li>
<li><a href="https://www.kennethreitz.org/import-this/">Import This</a></li>
</ol>



<h2>Python development tools</h2>





<p><img decoding="async" loading="lazy" class=" wp-image-15077 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image3-300x138.png" alt="python resources image" width="493" height="227" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image3-300x138.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image3-768x354.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image3.png 822w" sizes="(max-width: 493px) 100vw, 493px" /></p>
<p>There is no shortage of Python development tools. For this article, we have decided to make a list of the best free Python resources when it comes to those tools, including integrated development environments (IDEs), code editors, web frameworks, testing and debugging tools.</p>



<h3>IDEs and code editors</h3>



<ol>
<li><a href="https://code.visualstudio.com/?ref=hackernoon.com">Visual Studio Code</a></li>
</ol>



<p>This free and open-source IDE created by Microsoft is very popular (and not only for Python). Visual Studio Code is lightweight and includes many powerful features. You can add themes, debuggers and connect to other services. It also includes troubleshooting tools and is fully customizable.</p>



<ol start="2">
<li><a href="https://jupyter.org/?ref=hackernoon.com">JupyterLab</a></li>
</ol>



<p>Jupyter offers several tools for Python developers. There is JupyterLab, a web-based IDE for notebooks, code and data, and Jupyter Notebook, which is a web app that lets you create and share documents that contain code, text and visualizations. Both tools are great for data science and machine learning and are used by companies such as IBM, Google and Microsoft.</p>



<ol start="3">
<li><a href="https://www.jetbrains.com/pycharm/download/#section=windows">PyCharm</a></li>
</ol>



<p>This IDE was created by JetBrains with professional developers in mind. There are two versions of PyCharm: a free one for pure Python development and a paid one with support for web development. PyCharm includes code completion, code inspections, debugging, error highlighting and fixing, code refactoring and version control system.</p>



<ol start="4">
<li><a href="https://atom.io/?ref=hackernoon.com">Atom</a></li>
</ol>



<p>Atom is a code editor developed by GitHub. It’s open-source and its features are similar to <a href="https://www.sublimetext.com/">Sublime Text</a>’s. Atom allows for cross-platform editing, includes autocompletion, a built-in package manager, and a file system browser, among other features. It is also customizable; you can add packages, themes, and various HTML and JavaScript features.</p>



<ol start="5">
<li><a href="https://www.spyder-ide.org/?ref=hackernoon.com">Spyder</a></li>
</ol>



<p>Spyder is an IDE created for scientific use. It was written in Python, for Python, and is free and open-source.  It was designed by data analysts, scientists and engineers. It includes advanced editing, debugging, analysis and profiling functionalities, in addition to data exploration, deep inspection and visualization capabilities.</p>



<h3>Web frameworks</h3>



<ol>
<li><a href="http://djangoproject.com">Django</a></li>
</ol>



<p>Django is a highly popular open-source Python web framework. It has been used by companies such as Mozilla, Spotify and NASA, as well as within our team. The framework was built by experienced developers and aims at using automation wherever possible to speed up web development and let developers focus on the important stuff. Django is fast, secure and versatile. It is also highly scalable, secure and good for SEO.</p>



<ol start="2">
<li><a href="https://flask.palletsprojects.com/en/2.0.x/">Flask</a></li>
</ol>



<p>Flask is another free and open-source Python web framework that provides various tools for developing web apps. Flask is considered a micro-framework, which means it pretty much has no dependencies to external libraries. This framework is light, flexible and easy to learn.</p>



<ol start="3">
<li><a href="https://docs.cherrypy.dev/en/latest/">CherryPy</a></li>
</ol>



<p>CherryPy is a minimalist, object-oriented web framework that works wonders for web apps. It is fast, reliable and versatile. Just like Django and Flask, it is also open-source.</p>



<h3>Testing tools</h3>



<p>It wouldn’t be a comprehensive list of Python tools if we didn’t include some testing tools. Here are our top five free Python resources when it comes to testing.</p>



<ol>
<li>Robot</li>
</ol>



<p><a href="https://robotframework.org/">Robot</a> is probably the most popular Python automated testing framework. The framework was completely developed in Python and can be used for acceptance testing and <a href="https://www.asapdevelopers.com/python-test-driven-development/">test-driven development</a>. Robot can run on Java and .Net and supports cross-platform automation testing.</p>



<ol start="2">
<li><a href="https://docs.python.org/3/library/unittest.html?ref=hackernoon.com">Unittest</a></li>
</ol>



<p>Unittest—also called PyUnit—was the first automated unit test framework built with Python. It is built into Python, making it extra convenient to use. Unittest supports test automation, aggregation of tests into collections and sharing of setup and shutdown code for tests</p>



<ol start="3">
<li><a href="https://docs.pytest.org/en/latest/?ref=hackernoon.com">PyTest</a></li>
</ol>



<p>This open-source Python-based testing framework does especially well when it comes to functional and API testing. It includes autodiscovery of test modules and functions as well as modular fixtures. It also has a simple syntax and rich plugins.</p>



<ol start="4">
<li><a href="https://docs.nose2.io/en/latest/">Nose2</a></li>
</ol>



<p>This unit testing framework is the successor of Nose. On its website, Nose2 is defined as “unittest with plugins.” The Nose2 framework is open-source and aims to add more functionality for tests to the existing unittest.</p>



<ol start="5">
<li><a href="https://pypi.org/project/testify/">Testify</a></li>
</ol>



<p>This testing framework was designed to replace both unittest and Nose and includes more advanced features than the former. Testify’s strengths are automated unit testing, integration testing and system testing. It has an extensive plugin system, improvised test discovery, and a simple syntax-to-fixture method.</p>



<h3>Debugging tools</h3>



<p>Debugging tools are also a crucial Python resource. Here are a handful of them to help you debug your Python project. </p>



<ol>
<li><a href="https://realpython.com/python-print/">print()</a></li>
</ol>



<p>print() is actually a Python function that includes <a href="https://docs.python.org/3/library/trace.html">tracing</a>—also known as print debugging or caveman debugging—and <a href="https://docs.python.org/3/library/logging.html">logging</a>. If you need more extensive debugging, you can turn to some other tools we’ll see below.</p>



<ol start="2">
<li><a href="https://docs.python.org/3/library/pdb.html">pdb</a></li>
</ol>



<p>pdb—or The Python Debugger—is Python’s built-in debugger. This tool is extensible and actually defined as the class Pdb that internally uses the bdb (basic debugger functions) and cmd (support for line-oriented command interpreters) modules.</p>



<ol start="3">
<li><a href="https://www.onlinegdb.com/online_python_debugger?ref=hackernoon.com">GDB Online</a></li>
</ol>



<p>GDB Online is “<a href="https://www.onlinegdb.com/#:~:text=Welcome%20to%20GDB%20Online.,******%2F">an online compiler and debugger tool</a>” and can be used for a variety of programming languages. When it comes to Python, it uses Python version 3.0. GDB Online is a great tool for online coders and includes coding, compiling and debugging capabilities all in the web. </p>



<h2>Best free Python libraries</h2>



<figure class="wp-block-image"></figure>



<p><img decoding="async" loading="lazy" class=" wp-image-15078 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4-300x202.png" alt="free python resources image" width="474" height="319" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4-300x202.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4-768x517.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4-600x403.png 600w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4-400x269.png 400w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image4.png 820w" sizes="(max-width: 474px) 100vw, 474px" /></p>
<p>Our list of free Python resources would not be complete without a selection of Python libraries. Thanks to its large community, there are Python libraries for pretty much everything. We have gathered some of the most popular free Python libraries depending on your level of proficiency, as well as a list for the trending machine learning, below.</p>



<h3>For beginners</h3>



<p>Here are some of our library recommendations for beginners, although we should note that many libraries from the lists below (like NumPy, Matplotlib and Keras) are also great libraries for beginners.</p>



<ol>
<li><a href="https://pillow.readthedocs.io/en/stable/">Pillow</a></li>
<li><a href="https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html">OpenCV Python</a></li>
<li><a href="https://docs.python-requests.org/en/latest/">Requests</a></li>
<li><a href="https://pypi.org/project/Theano/">Theano</a></li>
<li><a href="https://www.nltk.org/">Natural Language Toolkit</a> (NLTK)</li>
<li><a href="https://ipython.org/">iPython</a></li>
<li><a href="https://arrow.readthedocs.io/en/latest/">Arrow</a></li>
</ol>



<h3>For every Python developer</h3>



<p>The libraries we saw above don’t apply just to beginners; however, they are a great starting point for taking their first steps with Python.</p>



<p>Since there are so many useful Python libraries out there, we have also selected some that every Python developer should add to their virtual bookcase.</p>



<ol>
<li><a href="https://pypi.org/project/scipy/">SciPy</a></li>
<li><a href="https://pypi.org/project/pygame/">Pygame</a></li>
<li><a href="https://pypi.org/project/beautifulsoup4/">Beautiful Soup</a></li>
<li><a href="https://pypi.org/project/peewee/">PeeWee</a></li>
<li><a href="https://www.sympy.org/">SimPy</a></li>
<li><a href="https://seaborn.pydata.org/">Seaborn</a></li>
<li><a href="https://docs.python.org/3/library/tkinter.html">Tkinter</a></li>
</ol>



<h3>For machine learning</h3>



<p>Finally, if your focus is machine learning, these are the best libraries for you.</p>



<ol>
<li><a href="https://numpy.org/">NumPy</a></li>
<li><a href="https://matplotlib.org/">Matplotlib</a></li>
<li><a href="https://pytorch.org/">PyTorch</a></li>
<li><a href="https://www.tensorflow.org/">TensorFlow</a></li>
<li><a href="https://pandas.pydata.org/">Pandas</a></li>
<li><a href="https://scikit-learn.org/">Scikit-learn</a></li>
<li><a href="https://keras.io/">Keras</a></li>
</ol>



<h2>Python communities</h2>





<p><img decoding="async" loading="lazy" class="aligncenter wp-image-15079" src="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image5-300x175.png" alt="community" width="475" height="277" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/12/image5-300x175.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image5-768x448.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/12/image5.png 934w" sizes="(max-width: 475px) 100vw, 475px" /></p>
<p>As we’ve mentioned, Python has a strong community behind it. There are countless developers that are willing to share their knowledge and help when others run into issues. Here are our top four communities to join if you are looking for support and resources for any of your Python projects.</p>



<ol>
<li><a href="https://www.pythonweekly.com/">Python Weekly</a></li>
</ol>



<p>Python Weekly is a weekly newsletter that includes curated news, jobs, tools, libraries articles and new releases, among many other things. You can subscribe for free on its website.</p>



<ol start="2">
<li><a href="https://www.pythondiscord.com/">Python Discord</a></li>
</ol>



<p>This is a large community of Python developers dedicated to helping new developers. The Python Discord community also encourages collaboration and friendships between experts.</p>



<ol start="3">
<li><a href="https://pyslackers.com/web">PySlackers</a></li>
</ol>



<p>PySlackers is an open Slack channel for Python enthusiasts. It is open for developers of any skill level to join and also includes a collection of learning resources.</p>



<ol start="4">
<li><a href="https://www.reddit.com/r/Python/?ref=hackernoon.com">r/Python</a></li>
</ol>



<p>r/Python is the official Python Reddit. You will find plenty of news, content and resources. You can also ask questions that the community will be happy to answer.</p>



<h2>Final thoughts on free Python resources</h2>



<p>Whether you were looking for free Python resources for beginners or experts, we hope this article has been able to cater to your needs. We’ve definitely tried to cover as much ground as possible within the realm of free and open-source resources.</p>

		<div id="fws_693973b477a9b"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/free-python-resources-for-every-developer/">Free Python resources for every developer</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python for CI/CD</title>
		<link>https://www.asapdevelopers.com/python-for-ci-cd/</link>
		
		<dc:creator><![CDATA[Joaquin Acuña]]></dc:creator>
		<pubDate>Mon, 30 Aug 2021 20:15:22 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=14818</guid>

					<description><![CDATA[<p>Avoiding integration hell is a must-do but seemingly simple task when your organization starts growing and hiring new developers. When working alone, writing code on your own and making it...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-for-ci-cd/">Python for CI/CD</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[




<p>Avoiding integration hell is a must-do but seemingly simple task when your organization starts growing and hiring new developers. When working alone, writing code on your own and making it work might seem enough. However, working with a team of professional software developers adds the challenge of coordinating many people working on the same code. Unless you want to spend hours, or even days, fixing the code so that it can finally integrate, making sure everyone is in sync, and guaranteeing nothing is broken, you should use Python for CI/CD.</p>





<p><a href="https://www.redhat.com/en/topics/devops/what-is-ci-cd">According to RedHat</a>, “<em>CI/CD is a method to frequently deliver apps to customers by introducing automation into the stages of app development. The main concepts attributed to Python for CI/CD are continuous integration, continuous delivery, and continuous deployment.</em>”</p>



<figure class="wp-block-image"><img decoding="async" class="aligncenter" src="https://lh3.googleusercontent.com/sVM4foC-fNoCrOYEXogHIFYOe6j3cgXKu1KP8bFAvrS40VMFXTMT85FxlsNUa1Q40Ug7zHDHXFi-i5YuLj2Okbtb2dEQtjSvXl-DOl7CjLPUg7-av5CvTUJUjWMVIshwHWPKM-je=s0" alt="" /></figure>



<p>&nbsp;</p>



<p>Now that we know what we’re talking about, let’s see how it all works.</p>



<h2>How to build a CI/CD pipeline with Python </h2>



<figure class="wp-block-image"></figure>



<p><img decoding="async" loading="lazy" class="aligncenter wp-image-7800" src="https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1-300x89.png" alt="Python for CI/CD" width="364" height="108" srcset="https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1-300x89.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1-768x228.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1-1024x304.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1-610x181.png 610w, https://www.asapdevelopers.com/wp-content/uploads/2017/08/Python_logo_and_wordmark.svg_-e1502721820678-1.png 2000w" sizes="(max-width: 364px) 100vw, 364px" /></p>
<p>We will be building a small CI/CD pipeline in 7 steps as you’ll see below. Let’s get started!</p>



<ol>
<li>
<h3>Write a Python program </h3>
</li>
</ol>



<p>First, we need a small software that will be deployed to the cloud. We will build a movie name generator, but it could also be a <a href="https://www.asapdevelopers.com/python-recommendation-systems/">movie recommendation system</a></p>



<p>To do this, first create a new directory (let’s call it <strong>&#8220;python-cicd&#8221;</strong>). </p>



<p>Inside this directory, create another directory called “generator” and, in this directory, save two files: </p>



<ul>
<li>An empty file called <strong>&#8220;__init__.py&#8221;</strong></li>
<li>And this script file called <strong>&#8220;generator.py&#8221;</strong></li>
</ul>
<p><script src="https://gist.github.com/JoaquinAcuna97/a51b16c8ff35a99890426373ee51cfa5.js"></script> <b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/a51b16c8ff35a99890426373ee51cfa5"><span style="font-weight: 400;">script</span></a></p>

<p>You should be able to run this Python script from the command line inside the “generator” directory we mentioned above; try it and check the movie results.</p>
<!-- /wp:paragraph -->
<p><code>

python-cicd$ python generator/generator.py<br />
Honor With Men'S Legacy<br />
python-cicd$ python generator/generator.py<br />
Construction Against Directors<br />

</code></p>
<!-- wp:paragraph -->

<!-- wp:paragraph -->
<p>Looks good! Now go ahead and add your own words to make more original movie titles. </p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true,"start":2} -->
<ol start="2">
<li>
<h3>Automate testing</h3>
</li>
</ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Many programmers choose to test the code they are writing manually by calling the piece of code they are developing, then printing the result to the console and, finally, visually scanning the output for correctness. This works for simple tasks but poses some problems:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>• When the output becomes too large, it gets harder to spot errors.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>• When the programmer gets tired, it is easy to miss subtly incorrect output.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>• When the implemented feature becomes larger, we tend to miss bugs we might have introduced in parts that were “tested” earlier.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>• Because the informal test scripts tend to be only useful for the programmer who wrote them, this means it is of no use to other developers.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph --><!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>These issues are the reason unit testing was invented. Through unit testing, you write sample calls to pieces of code and compare the return value to the expected value.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This comparison is generally done in a way that gives little or no output when the test passes and very obvious output otherwise. You can use a test harness to run tests from several test scripts and report just the errors and a statistical summary of the passed tests.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We need some additional tools to run the unit tests we are going to write. These are available as Python for CI/CD packages. To install them, you should use a tool called virtualenv.</p>
<!-- /wp:paragraph -->
<p><code>

python-cicd$  virtualenv venv<br />
Honor With Men'S Legacy<br />
python-cicd$ source venv/bin/activate<br />
(venv) python-cicd$<br />

</code></p>
<!-- wp:paragraph -->
<p>Next, create a new file called “requirements.txt” that lists the pytest dependency:</p>
<!-- /wp:paragraph -->
<p><code>

pytest==6.2.4<br />

</code></p>
<p>To download the dependencies listed in the requirements file, you’ll need to execute the “pip” command:</p>
<p><code>

(venv) python-cicd$  pip install -r requirements.txt<br />

</code></p>
<p>Create a new folder called “<strong>test”</strong> and put two files inside: </p>
<ul>
<li>An empty file called “<strong>__init__.py”</strong></li>
<li>And this script file called<strong> “test_generator.py”</strong></li>
</ul>
<p><script src="https://gist.github.com/JoaquinAcuna97/90648a00bdddd18a2bf5516af4e0e0a5.js"></script></p>
<p><b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/90648a00bdddd18a2bf5516af4e0e0a5"><span style="font-weight: 400;">script</span></a></p>
<p>Then, run the test file.</p>
<p><code>

(venv) python-cicd$  python -m pytest -v test/test_generator.py<br />

</code></p>
<p>You should see them passing.</p>
<figure class="wp-block-image"><img decoding="async" src="https://lh4.googleusercontent.com/wFNDhYaMR-HasKPSlXTicLdbu1XOkM4LJZzXTw_aMO9yFMUvpVAmMkTgXS8x8s0wGDjRo7HIEYllYsdI1_69DyYOzWS6E_tWv0EF-N4iwgN-G8cDCP-wjdrZtQEDm8W7VFvpSSYC=s0" alt="" /></figure>
<ol start="3">
<li>
<h3>Push your code to GitHub</h3>
</li>
</ol>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-14842" src="https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-300x114.png" alt="github - Python for CI/CD" width="376" height="143" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-300x114.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/github.png 515w" sizes="(max-width: 376px) 100vw, 376px" /></p>
<p>We chose GitHub for this article, but you can use virtually any Git provider. Let’s start by logging into GitHub (you should get an account first if you don’t have one already) and then create a new public repository called “python-cicd”.</p>
<p>Inside your project directory, create a new file called “.gitignore” containing the following:</p>
<p><code>

venv<br />
__pycache__<br />
test/__pycache__/<br />
generator/__pycache__/<br />

</code></p>
<p>This will prevent Git from adding the virtualenv or any IDE file that can cause us problems later to our repo. Now you should initialize Git locally and push your code to GitHub:</p>
<p><code>

[python-cicd] $ git init<br />
[python-cicd] $ git add *<br />
[python-cicd] $ git commit -m "Initial commit"<br />
[python-cicd] $ git remote add origin<br />
git@github.com:/python-cicd.git<br />
[python-cicd] $ git push -u origin master<br />

</code></p>
<!-- wp:list {"ordered":true,"start":4} -->
<ol start="4">
<li>
<h3>Setup GitHub Actions CI to continuously run your automated tests</h3>
</li>
</ol>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-14841" src="https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-actions-300x62.png" alt="github actions - Python for CI/CD" width="498" height="103" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-actions-300x62.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-actions-768x159.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/github-actions.png 830w" sizes="(max-width: 498px) 100vw, 498px" /></p>
<p>Go to your GitHub repository, and create the new workflow in the actions tab.</p>
<figure class="wp-block-image"><img decoding="async" src="https://lh3.googleusercontent.com/gpOTgnfGp2HJWpzQU8QSlPaOQIbLcTQEP-DkaRHEypvW_SLqs3U01hzA9fuAo9HfNpIadscwoQ4M-Dn12-3DXoR4spcMcdvZU1R-AwOsmh9b7PdzNbpV6juiKK75Wk23FJjRgMu8=s0" alt="" /></figure>
<p>This should commit a YAML file into your repository. In the .github/workflows folder, your YAML file must be similar to this: </p>
<p><script src="https://gist.github.com/JoaquinAcuna97/2ccc18b5c83fd033dbdbd7fa10c4dda8.js"></script> <b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/2ccc18b5c83fd033dbdbd7fa10c4dda8"><span style="font-weight: 400;">script</span></a></p>
<p>Remember to change the Python version to the one you are using in your project.</p>
<p>Then, try it out by making any changes to your code and pushing them; it should start a build process on the actions tabs that looks something like this: </p>
<figure class="wp-block-image"><img decoding="async" src="https://lh5.googleusercontent.com/JYqNZvGRjYQMEPPEUSUHAme6AbGrd97yb5H7_WTCgbOf3ZF7wri65XQkLAPlDZ5uUtuG60ssl7TOptKD0mE9Pw6DthAqgpJhe6keumOFeylghSHBYj75jZJbQe7EhDu304zCfJbR=s0" alt="" /></figure>
<p>Congratulations! You have successfully built your very first continuous integration pipeline</p>
<!-- wp:list {"ordered":true,"start":5} -->
<ol start="5">
<li>
<h3>Setup Wily to continuously check your code quality</h3>
</li>
</ol>
<p>Wily is a python tool that helps you keep track of the maintainability of your project, in order to write <a href="https://www.asapdevelopers.com/python-code-complexity/">simpler and more maintainable Code</a>.</p>
<p><!-- /wp:paragraph -->

<!-- wp:image --></p>
<p><img decoding="async" loading="lazy" class=" wp-image-14840 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/08/wily-300x155.png" alt="wily" width="422" height="218" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/08/wily-300x155.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/wily-768x398.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/wily.png 871w" sizes="(max-width: 422px) 100vw, 422px" /></p>
<p>In each build, we will show the evolution of your maintainability score and other metrics such as lines of code or cyclomatic complexity. </p>
<p>First, we need to install Wily. </p>
<p><code>

(venv)[python-cicd] $ pip install wily<br />

</code></p>
<p>Add Wily to your requirements.txt.</p>
<p><code>

(venv)[python-cicd] $ pip freeze &gt; requirements.txt<br />

</code></p>
<p>Then, we will add Wily to the GitHub actions pipeline by editing our YAML file. Add a new step to our pipeline file, called “Wily”, to the end of your file. </p>
<p><script src="https://gist.github.com/JoaquinAcuna97/144467c92b63ea32cc4dacfff35fd33c.js"></script></p>
<p><b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/144467c92b63ea32cc4dacfff35fd33c"><span style="font-weight: 400;">script</span></a></p>
<p>Push your changes and check the GitHub actions execution; you should see something similar to this output:</p>
<figure class="wp-block-image"><img decoding="async" src="https://lh6.googleusercontent.com/7KZV2--xWAB_0NERzZFrsP578k8MMt85st1N02gZFLEJexj-QGE09VzWKfujFsJrfew3PgRNdaRDZTYjaQQvRkMObJXuTHfhoVcEPvmkUwJbYhfjaWXxcT0kYAL9EG9-zv8TLqfM=s0" alt="" /></figure>
<ol start="6">
<li>
<h3>Turn the Python program into a web app</h3>
</li>
</ol>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-14839" src="https://www.asapdevelopers.com/wp-content/uploads/2021/08/flask-300x124.png" alt="flask web development - Python for CI/CD" width="406" height="168" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/08/flask-300x124.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/flask.png 721w" sizes="(max-width: 406px) 100vw, 406px" /></p>
<p>Great work! We already have a CI pipeline that checks for functionality and quality.</p>
<p>Since we will deploy the software to Heroku as a web app, we first need to write a little Python Flask wrapper around our movie generator to make the program respond to HTTP requests and output HTML.</p>
<p>Add the code below in a file called “app.py” in the root of your project directory:</p>
<p><script src="https://gist.github.com/JoaquinAcuna97/559fddf5a8e8a3e80b78af0dcab2a2a5.js"></script></p>
<p><b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/559fddf5a8e8a3e80b78af0dcab2a2a5"><span style="font-weight: 400;">script</span></a></p>
<!-- wp:paragraph -->
<p>Install Flask.</p>
<p><code>

(venv)[python-cicd] $ pip install flask<br />

</code></p>
<p>Add Flask to your requirements.txt. </p>
<p><code>

(venv)[python-cicd] $ pip freeze &gt; requirements.txt<br />

</code></p>
<p>You can now run the Flask application locally.</p>
<p><code>

(venv)[python-cicd] $ python app.py<br />
 * Serving Flask app 'app' (lazy loading)<br />
 * Environment: production<br />
   WARNING: This is a development server. Do not use it in a production deployment.<br />
  Use a production WSGI server instead.<br />
 * Debug mode: off<br />
* Running on all addresses.<br />
 WARNING: This is a development server. Do not use it in a production deployment.<br />
 * Running on http://192.168.1.6:5000/ (Press CTRL+C to quit)<br />

</code></p>
<p>Open the local host location and you should see the app running smoothly. </p>
<figure class="wp-block-image"><img decoding="async" class="aligncenter" src="https://lh3.googleusercontent.com/C2f0NWJYxi5w1rzYK7_81UoT5dWpFlbOCY9vISqL71ZxvV_YbiFjR98gTwSzVVm3XEXnkzvNyFoGUjSH9WHQ5lZRs73o56kNnfnY1mvts9C3nyLqYrQbbEsnQnzF9G6WqLb6AY85=s0" alt="" /></figure>
<p>Refresh it a few times, and check out the movie title ideas.</p>
<p>Push your changes and see Wily’s magic in action. </p>
<!-- wp:list {"ordered":true,"start":7} -->
<ol start="7">
<li>
<h3>Deploy the web app to Heroku</h3>
</li>
</ol>
<figure class="wp-block-image"><img decoding="async" loading="lazy" class="aligncenter" src="https://lh3.googleusercontent.com/kYcAyv-9RMzphzuLd2MsOXxpP9kMcR2ZYpnrB3PBNEQjT-3RKNt4a7p24TMSyyBS6UPkHIAKN-tZ9c5s8e5bl-oe7oIjWTe7Hj4az7gmw3DF1KlRMhcALZQGWOb3rPoiOI_w9aIX=s0" alt="Heroku-  Python for CI/CD." width="425" height="119" /></figure>
<p>Heroku is a cloud platform used to host small and scalable web applications. It offers a free plan so go to https://signup.heroku.com and sign up if you haven’t already done so.</p>
<p>Once you are in Heroku, sync your GitHub repository to the Heroku CLI, so, whenever you push new changes to your code in GitHub, Heroku will build and deploy your app automatically.</p>
<p>Start by creating a new app in Heroku and, in the deployment method option, choose “connect to GitHub.” <img decoding="async" loading="lazy" src="https://lh5.googleusercontent.com/2kCBQ4HuJUWg7fxRoyU5sEcxVCLXpUNT5raV8AqpRtpW8UQ1aOjMd5Z5_krwpzyJOn9a9ur374yHWt0bZXwPi5xJaUlAafXu-X-vTaQmqEXi0BXUByaqq00j3pa1uybESVXhDDod=s0" width="624" height="63" /></p>
<p>You may have to log into GitHub if you haven’t already, and select the repo for the project. </p>
<figure class="wp-block-image"><img decoding="async" loading="lazy" class="aligncenter" src="https://lh6.googleusercontent.com/OhtEbrm0mi1f_FIfG-f48XxhOukXaQ-yskDQNMssKlzSKrNSvl6aKGXG2FpRIKjeCBqcSG9KKJi0ZdRlZvdzjUog12vTbZ6f5BxUPNEZQC_YM9Bkm2zNeSE7E0dzv3I5JEha9qAl=s0" alt="gunicorn - Python for CI/CD." width="428" height="126" /></figure>
<p>Heroku serves Python apps with Gunicorn &#8220;Green Unicorn&#8221;, which is a Python web server that is simply implemented, light on server resources, fairly fast, and broadly compatible with a number of web frameworks.<br />First, we need to install it.</p>
<p><code>

(venv)[python-cicd] $ pip install gunicorn<br />

</code></p>
<p>Add Gunicorn to your requirements.txt.</p>
<p><code>

(venv)[python-cicd] $ pip freeze &gt; requirements.txt<br />

</code></p>
<p>In the root folder of your project, create a <strong>“Procfile”</strong> and write the following code:</p>
<p><code>

web: gunicorn wsgi:app<br />

</code></p>
<p>Then, create a <strong>“runtime.txt”</strong> file and include the Python version you are using; in our case, it’s version 3.6.14.</p>
<p><code>

python-3.6.14<br />

</code></p>
<p>Create a <strong>“wsgi.py”</strong> file and insert the following code.</p>
<p><code>

from app import app as application<br />
app = application<br />
if __name__ == "__main__":<br />
app.run()<br />

</code></p>
<p>Commit your changes and push them to Heroku. </p>
<p><code>

git push heroku master<br />

</code></p>
<p>If everything went well, you should see the movie generator rocking on the cloud! </p>
<figure class="wp-block-image"><img decoding="async" loading="lazy" class="wp-image-14849 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/08/movies-generator-300x57.png" alt="" width="669" height="127" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/08/movies-generator-300x57.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/movies-generator-768x145.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/08/movies-generator.png 840w" sizes="(max-width: 669px) 100vw, 669px" /></figure>
<p>Congrats! Now, with every change to your code, you will automatically run tests, check maintainability and deploy to Heroku! If you are facing any issues during deployment using Python for CI/CD, feel free to contact us, or check Heroku’s <a href="https://devcenter.heroku.com/categories/python-support">official Python page</a>.</p>
<p><!-- /wp:image -->

<!-- wp:paragraph --></p>

		<div id="fws_693973b4792e0"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div><p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-for-ci-cd/">Python for CI/CD</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Top 5 Python libraries for e-commerce</title>
		<link>https://www.asapdevelopers.com/5-python-libraries-for-e-commerce/</link>
		
		<dc:creator><![CDATA[Pablo Giampedraglia]]></dc:creator>
		<pubDate>Mon, 17 May 2021 19:47:22 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=14503</guid>

					<description><![CDATA[<p>Top 5 Python libraries for e-commerce Python is an extremely versatile language that can be used to develop a wide array of products such as complex websites and mobile and...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/5-python-libraries-for-e-commerce/">Top 5 Python libraries for e-commerce</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h1>Top 5 Python libraries for e-commerce</h1>



<p>Python is an extremely versatile language that can be used to develop a wide array of products such as complex websites and mobile and web apps. It can be used for scripting, backend development, web development, mobile development, machine learning, fintech, big data, and IoT. We’ve already covered <a href="https://www.asapdevelopers.com/python-backend-language/">why we chose to use this language to build our products</a>, as well as its popular web framework <a href="https://www.asapdevelopers.com/django-reasons-why/">Django</a>. Python has a large development community behind it and, therefore, plenty of tools and documentation. As e-commerce keeps getting bigger every day, in this article, we chose to focus particularly on Python libraries for e-commerce. So, let’s take a look at five of the most popular ones.</p>



<ol>
<li>
<h2><a href="https://saleor.io/">Saleor</a></h2>
</li>
</ol>



<figure class="wp-block-image"><img decoding="async" loading="lazy" class="aligncenter" src="https://lh4.googleusercontent.com/mGwjO76YtcsDkVe9Mo21jOpfhx8fE7RTIPdTqnxM2G-0MvYyJK88XA-AiF_Q_AxO-62zlcWfRZ7d6OcxczJKB8asRZ0ohIxVhsEdsXnN8XqQcUjwUd_1YCkI94V1U8k0ObALOSM" alt="Saleor - Python libraries for e-commerce" width="600" height="210" /></figure>



<p>&nbsp;</p>
<p>Saleor is an open-source e-commerce platform built with Python, GraphQL, Django and React. Its goal is to deliver dynamic, speedy and personalized shopping solutions and help you create beautiful online stores. Saleor’s most impressive features include offline shopping for PWAs, a focus on user experience, advanced payment and tax options that can integrate any payment method, and excellent SEO and analytics features.</p>



<p>When it comes to requirements, Saleor runs on Python 3.8 and Node.js 10.0+. Its current stable version is 2.11. The platform also has extensive documentation which you can find <a href="https://docs.saleor.io/docs/">here</a>. Just like with any popular Python tool, there is a large community behind Saleor that <a href="https://docs.saleor.io/docs/developer/community/contributing">you can contribute to yourself</a>.</p>



<p>Finally, this Python library for e-commerce is free for developers, but also offers three different packages for companies tailored to their needs. You can find all the details <a href="https://saleor.io/pricing/">here</a>.</p>



<ol start="2">
<li>
<h2><a href="http://oscarcommerce.com/">Oscar</a></h2>
</li>
</ol>



<p><img decoding="async" loading="lazy" class="aligncenter" src="https://lh5.googleusercontent.com/TiORBVtxFSymnr2c3IP1SzzyKKFpHgD0LkkCF4RWojnTwE-hDBC816VQShyM8ceeWn3d0VYyzvOUdhUZj0wH8bEYJEBMMCP4kqk6XndRk685rZpGKWQizCMnsy1Crlv-ZSda1lA" alt="Django Oscar - Python libraries for e-commerce" width="493" height="164" /></p>
<p>This Django domain-driven e-commerce framework allows for full customization of your project, making it highly flexible so you can meet your business needs. It also includes <a href="http://docs.oscarcommerce.com/en/latest/">comprehensive documentation</a> and an extensive test suite. Other features include customizable products, vouchers, and extension libraries for various payment gateways (such as PayPal and DataCash).</p>
<p>

</p>
<p>Moreover, Oscar is constantly working on improvements, such as adding extra payment methods, allowing sales reps to place orders for customers, and handling increasingly larger product catalogs.</p>
<p>

</p>
<p>Oscar’s latest version is version 3.0. If you’re interested in contributing to this open-source Python library for e-commerce, visit <a href="http://docs.oscarcommerce.com/en/latest/internals/contributing/index.html">this page</a> for instructions.</p>
<p>

</p>
<ol start="3">
<li>
<h2>Django-SHOP</h2>
</li>
</ol>
<p>

</p>
<figure class="wp-block-image"><img decoding="async" loading="lazy" class="aligncenter" src="https://lh5.googleusercontent.com/D82Lf-7EcFm2FWgog8v7PDbsVT5JO9hhnulQ0EOw-SsayIM8GtVL1TkUStQ1GRpvUt_fUGjgjXGoBOCDPXththzpJUTkYHvv4I2HEXwUw8gKNyOsXJkMVI-QO67Y7EsMcBl8tac" alt="django shop" width="512" height="512" /></figure>
<p>

</p>
<p>Django-SHOP describes itself as a fun, fast and easy e-commerce framework. Django-SHOP is modular, includes programmable cart modifiers and a delivery and fulfillment workflow, and lets you build your database model out of the product’s properties. Moreover, the framework is multilingual, supports multiple currencies, is based on REST and plugs in directly into the <a href="https://www.django-cms.org/en/">django-CMS</a> management solution.</p>
<p>

</p>
<p>As all of the Python libraries for e-commerce we’ve discussed so far, it also provides <a href="https://django-shop.readthedocs.io/en/latest/">extensive documentation</a> in addition to tutorials that make it easy to get started. Django-SHOP is currently on version 1.2 and is compatible with Python 2.1 onwards. The framework is currently available under a <a href="https://docs.freebsd.org/en/articles/bsdl-gpl/#three">BSD license</a>.</p>
<p>

</p>
<ol start="4">
<li>
<h2><a href="https://www.shuup.com/">Shuup</a></h2>
</li>
</ol>
<p>

</p>
<figure class="wp-block-image"><img decoding="async" loading="lazy" class="aligncenter" src="https://lh4.googleusercontent.com/SMki4dFD-_7K3nrH4xFs8nrT1G5o03In22vfVI2AbX4QTboomzA5-xc_FBCUUCrlQ823Zp6O3UCHFs6px_rVJZvngEDf_m4_-tIz8j1Br0XMXZlPoPCtlkIFj7p7nKJEpqFr2jw" alt="Shuup - Python libraries for e-commerce" width="316" height="316" /></figure>
<p>

</p>
<p>Shuup is an open-source multi-vendor marketplace software based on Python and Django. It allows you to build marketplaces like Amazon or Etsy, niche multi-seller systems, a local delivery network or even your own service economy like Fiverr. The e-commerce options are simply endless. Furthermore, Shuup includes a wide variety of integrations with tools such as Mailchimp, Google Analytics and Stripe.</p>
<p>

</p>
<p>Shuup offers free open-source access to developers, but also includes various paid <a href="https://www.shuup.com/shuup-business-package/">business</a> and <a href="https://www.shuup.com/enterprise-solutions/">enterprise packages</a> depending on your company’s needs. The platform gives you the option to build a single marketplace for all products with different vendor pages or headless e-commerce. In other words, you can build a custom network of operation platforms.</p>
<p>

</p>
<p>You can find everything you need to get started with this Python library for e-commerce <a href="https://shuup.readthedocs.io/en/latest/howto/getting_started_dev.html">here</a> and all the relevant documentation <a href="https://shuup.readthedocs.io/en/latest/">here</a>.</p>
<p>

</p>
<ol start="5">
<li>
<h2><a href="https://pypi.org/project/Cartridge/">Cartridge</a></h2>
</li>
</ol>
<p>

</p>
<p>This BSD licensed shopping cart app was built using Django. The tool is definitely simpler than the ones we’ve seen so far in this article, but no less useful as it provides a simple and clean base for e-commerce websites. Cartridge includes the most common web e-commerce features like sale pricing, promotional codes, registered or anonymous checkout, and hierarchical categories. These make it easy to customize your product. That said, it should be noted that it was designed as a plugin for <a href="http://mezzanine.jupo.org/">Mezzanine</a>, a content management platform, so it depends on it to function.</p>
<p>

</p>
<p>You can support this Python library for e-commerce by contributing, donating and reporting any issues. Some of the sites that use Cartridge include You Name It, Adrenaline and Ripe Maternity.</p>
<p>

</p>
<h2>Final thoughts on Python libraries for e-commerce</h2>
<p>

</p>
<p>As you can see, there is a wide array of Python libraries for e-commerce available to fulfill your business needs. These five alone offer diverse options depending on the size and requirements of your project, but there are definitely plenty more to choose from. We hope to have helped you find the right Python e-commerce tool for you.</p>

		<div id="fws_693973b47a037"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p></p><p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/5-python-libraries-for-e-commerce/">Top 5 Python libraries for e-commerce</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python Recommendation Systems</title>
		<link>https://www.asapdevelopers.com/python-recommendation-systems/</link>
		
		<dc:creator><![CDATA[Joaquin Acuña]]></dc:creator>
		<pubDate>Mon, 15 Mar 2021 20:50:07 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=14316</guid>

					<description><![CDATA[<p>Why python recommendation systems are important The most common and smartest way for e-commerce websites to display relevant items to their clients is to use an automated system. This system...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-recommendation-systems/">Python Recommendation Systems</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><span style="font-weight: 400;">Why python recommendation systems are important</span></h1>
<p><span style="font-weight: 400;">The most common and smartest way for e-commerce websites to display relevant items to their clients is to use an automated system. This system will be in charge of calculating the probability of similarity between items or user preferences. These systems are called recommendation systems, recommender systems or recommendation engines. A recommender system is one of the most well-known applications of data science and machine learning. In this article, we will go over Python Recommendation Systems.</span></p>
<p><span style="font-weight: 400;">In fact, almost every major tech company has applied them at some point. Amazon recommends you products, Spotify recommends you music, Google recommends you search results, and YouTube recommends you videos. It is such a common practice that, in 2009, Netflix offered a million dollars to anyone who could improve the accuracy of its movie recommendation system by 10%. </span></p>
<p><span style="font-weight: 400;">These systems help us with </span><a href="https://en.wikipedia.org/wiki/The_Paradox_of_Choice"><span style="font-weight: 400;">The Paradox of Choice</span></a><span style="font-weight: 400;">, a known problem that is caused by the rapid increase in the amount of data and the effects of this abundance: managing the information becomes more difficult and this can lead to information overload.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14326" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/data-chart-300x169.png" alt="python recommendation systems chart" width="740" height="416" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/data-chart-300x169.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/data-chart.png 763w" sizes="(max-width: 740px) 100vw, 740px" /></span></p>
<p><span style="font-weight: 400;">Recommender systems have great commercial importance; they have changed the way websites communicate with their users, increasing interaction to provide a richer experience by autonomously identifying recommendations for individual users based on the user’s past purchases and searches, as well as their behavior.</span></p>
<h2><span style="font-weight: 400;">What are the types of python recommendation systems? </span></h2>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Recommendation systems can be classified into 3 types:</span></p>
<h3><span style="font-weight: 400;">Simple recommenders</span></h3>
<p><span style="font-weight: 400;">This is the type of recommender we will build in this article. It offers generalized recommendations to each user, based on each element’s attributes. In a movie recommendation scenario, it will make recommendations to each user based on movie genre, movie rating or movie title. An example of a simple recommender is IMDd’s Top 250.</span></p>
<h3><span style="font-weight: 400;">Content-based recommenders</span></h3>
<p><span style="font-weight: 400;">These recommenders suggest similar items based on a specific one, taking into account each user’s preferences. This system uses item metadata and the general idea behind it is that if a person likes a particular item, they will also like a similar one. This does not involve other users, just each individual&#8217;s preferences. Based on what you like, the algorithm will pick items with similar content and recommend them.</span></p>
<p><span style="font-weight: 400;">It will never recommend products within categories the user has not bought or liked in the past. So, for example, if a user has watched or liked only action movies so far, that&#8217;s the only genre the system will recommend.</span></p>
<h3><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14327" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/developer-300x243.png" alt="python recommendation systems developer" width="444" height="360" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/developer-300x243.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/developer.png 557w" sizes="(max-width: 444px) 100vw, 444px" /></span></h3>
<h3><span style="font-weight: 400;">Collaborative filtering engines</span></h3>
<p><span style="font-weight: 400;">The collaborative filtering algorithm uses user behavior to select the items to be recommended. These systems are widely used and do not require item metadata like their content-based counterparts. There are different types of collaborating filtering techniques and we’ll look at them in detail below.</span></p>
<h3><img decoding="async" loading="lazy" class="aligncenter wp-image-14328" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/collabor-300x212.png" alt="Python recommendation systems similar" width="541" height="382" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/collabor-300x212.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/collabor.png 588w" sizes="(max-width: 541px) 100vw, 541px" /></h3>
<h3>User-User collaborative filtering</h3>
<p><span style="font-weight: 400;">This algorithm finds similarities between users grading a score in the process. Based on this score, it picks the most similar users and recommends products that they have previously liked or bought. Essentially, it generates a prediction for item </span><b>A</b><span style="font-weight: 400;"> based on how other users in the neighborhood rated it.</span></p>
<h3><strong><img decoding="async" loading="lazy" class="aligncenter wp-image-14329" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/user-300x157.png" alt="python recommendation systems - user to user" width="649" height="340" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/user-300x157.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/user-768x402.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/user.png 946w" sizes="(max-width: 649px) 100vw, 649px" /></strong></h3>
<h3><strong>Item-Item collaborative filtering</strong></h3>
<p><span style="font-weight: 400;">In this case, the algorithm computes the similarity between each pair of items. Similar items are identified based on how people have rated them in the past. For example, if Julia, Christian, and Vic have given 5 stars to </span><b>The Lord of the Rings</b><span style="font-weight: 400;"> and </span><b>Harry Potter</b><span style="font-weight: 400;">, the system identifies the items as similar. Therefore, if someone buys </span><b>The Lord of the Rings</b><span style="font-weight: 400;">, the system also recommends </span><b>Harry Potter</b><span style="font-weight: 400;"> to them.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14330" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/recommend-300x224.png" alt="Python recommendation systems - collaborative" width="560" height="418" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/recommend-300x224.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/recommend.png 760w" sizes="(max-width: 560px) 100vw, 560px" /></span></p>
<h2><span style="font-weight: 400;">Why Python Recommendation Systems? <img decoding="async" loading="lazy" class="alignnone wp-image-13874" src="https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-300x300.png" alt="" width="47" height="47" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-1024x1024.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-768x769.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-500x500.png 500w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-1000x1000.png 1000w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-800x800.png 800w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo.png 1512w" sizes="(max-width: 47px) 100vw, 47px" /></span></h2>
<p><span style="font-weight: 400;"> </span><span style="font-weight: 400;">You can build this system in virtually any language, but Python certainly takes the most points in this particular field. </span><a href="https://www.asapdevelopers.com/python-backend-language/"><span style="font-weight: 400;">Python offers readable code</span></a><span style="font-weight: 400;"> for complex algorithms and versatile workflows in machine learning and AI. Python allows you to put all the effort into solving a machine learning problem instead of focusing on the language itself.</span></p>
<p><span style="font-weight: 400;">Moreover, Python is easy to learn since its code is easy for people to follow, which makes it easier to build models for machine learning. </span><span style="font-weight: 400;">Python is more intuitive than other programming languages. It has many frameworks, libraries, and extensions that simplify the implementation of different functionalities. </span></p>
<p><span style="font-weight: 400;">Today, we will be using some of those libraries: </span></p>
<p><a href="http://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html"><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="alignnone wp-image-14331" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/learn-300x162.png" alt="" width="211" height="114" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/learn-300x162.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/learn.png 327w" sizes="(max-width: 211px) 100vw, 211px" />Scikit-learn: Machine Learning in Python</span></a></p>
<p><span style="font-weight: 400;">Scikit-learn offers simple and efficient tools for predictive data analysis. It is accessible to all and reusable in various contexts. It is built on NumPy, SciPy, and matplotlib. Moreover, it’s open-source and commercially available under the BSD license.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="alignnone wp-image-14332" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/pandas-300x122.png" alt="" width="261" height="106" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/pandas-300x122.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/pandas-1024x415.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/pandas-768x311.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/pandas.png 1417w" sizes="(max-width: 261px) 100vw, 261px" /></span></p>
<p><span style="font-weight: 400;">Pandas is a data analysis and manipulation tool. It was built on top of the Python programming language. This tool is fast, powerful, flexible, open-source and easy-to-use.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="alignnone wp-image-14333" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/numpy-300x108.png" alt="" width="255" height="92" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/numpy-300x108.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/numpy.png 511w" sizes="(max-width: 255px) 100vw, 255px" /></span></p>
<p><span style="font-weight: 400;">NumPy is the fundamental package for scientific computing with Python. Nearly every scientist working with Python draws on the power of NumPy. With this power comes simplicity: a solution in NumPy is often clear and elegant.</span></p>
<h2><span style="font-weight: 400;">Build a simple movie with Python recommendation system </span></h2>
<p><span style="font-weight: 400;">We will be working with Jupyter Notebooks, but you can just find the code in </span><a href="https://github.com/JoaquinAcuna97/Python_movie_recommendation_system.git"><span style="font-weight: 400;">this repository</span></a><span style="font-weight: 400;">; there you’ll find this </span><a href="https://github.com/JoaquinAcuna97/Python_movie_recommendation_system/blob/main/python_movies.ipynb"><span style="font-weight: 400;">file</span></a><span style="font-weight: 400;"> and the dataset used in this example. </span></p>
<p><span style="font-weight: 400;">According to its website, “<em>Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.</em>”</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14334 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/jupyter.png" alt="" width="344" height="141" /></span></p>
<p><span style="font-weight: 400;">First, we will import all the necessary libraries for this lab.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14335" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code1-300x68.png" alt="python recommendation systems - code1" width="745" height="169" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code1-300x68.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code1.png 736w" sizes="(max-width: 745px) 100vw, 745px" /></span></p>
<p><span style="font-weight: 400;">Then, we’ll load the dataset, which we obtained from the </span><a href="https://www.imdb.com/interfaces/"><span style="font-weight: 400;">IMDb Datasets</span></a><span style="font-weight: 400;"> of all movies uploaded in a certain period; we will use a reduced test dataset just to save computer resources.</span><span style="font-weight: 400;"><br />
</span><span style="font-weight: 400;"><br />
</span><span style="font-weight: 400;">title.basics.tsv.gz &#8211; Contains the following information for titles, as can be see in </span><a href="https://www.imdb.com/interfaces/"><span style="font-weight: 400;">IMDb’s website</span></a><span style="font-weight: 400;">:</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">tconst (string) &#8211; alphanumeric unique identifier of the title.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">titleType (string) – the type/format of the title (e.g. movie, short, tvseries, tvepisode, video, etc.).</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">primaryTitle (string) – the most popular title/the title used by the filmmakers on promotional materials at the point of release.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">originalTitle (string) &#8211; original title, in the original language.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">isAdult (boolean) &#8211; 0: non-adult title; 1: adult title.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">startYear (YYYY) – represents the release year of a title. In the case of TV Series, it is the series release year.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">endYear (YYYY) – TV Series end year. ‘\N’ for all other title types.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">runtimeMinutes – primary runtime of the title, in minutes.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">genres (string array) – includes up to three genres associated with the title.</span></li>
</ul>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14336" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code2-300x81.png" alt="python recommendation systems - code2" width="803" height="217" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code2-300x81.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code2-1024x276.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code2-768x207.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code2.png 1129w" sizes="(max-width: 803px) 100vw, 803px" /></span></p>
<p><span style="font-weight: 400;">Then, we’ll split the dataset into train and test. We will be using only 13k movies instead of all the data records, and we won’t shuffle the data so we know which movies will be in our test data.</span></p>
<p><span style="font-weight: 400;">We are also creating a new Movie_id for our test dataset which will help us later on.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14342" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code3-300x51.png" alt="python recommendation systems - code3" width="629" height="107" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code3-300x51.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code3.png 764w" sizes="(max-width: 629px) 100vw, 629px" /></span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14343 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code4.png" alt="python recommendation systems - code4" width="191" height="69" /></span></p>
<p><span style="font-weight: 400;">We’ll select the most important columns in our dataset, that is, the ones that we will use to make a movie prediction.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14344" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5-300x202.png" alt="python recommendation systems - code5" width="670" height="451" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5-300x202.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5-768x518.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5-600x403.png 600w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5-400x269.png 400w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code5.png 842w" sizes="(max-width: 670px) 100vw, 670px" /></span></p>
<p><span style="font-weight: 400;">We’ll check if there is any missing data in the most important column in our dataset; if that is the case, we will clean the data by removing all null values.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-14345" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code6-300x72.png" alt="python recommendation systems - code6" width="692" height="166" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code6-300x72.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code6.png 666w" sizes="(max-width: 692px) 100vw, 692px" /></span></p>
<p><span style="font-weight: 400;">Then, we’ll define a function that will create a new column, combining all the important column values into one string for each record in our dataset.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14346 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code7-300x90.png" alt="" width="697" height="209" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code7-300x90.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code7.png 766w" sizes="(max-width: 697px) 100vw, 697px" /></span></p>
<p><span style="font-weight: 400;">We’ll create the new column for our dataset.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14347 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code8-300x158.png" alt="" width="967" height="509" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code8-300x158.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code8-1024x540.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code8-768x405.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code8.png 1268w" sizes="(max-width: 967px) 100vw, 967px" /></span></p>
<p><span style="font-weight: 400;">We will create a new variable named cm that will contain a matrix of token counts for each important_features value.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14350 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code9-300x27.png" alt="" width="634" height="57" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code9-300x27.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code9-768x68.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code9.png 777w" sizes="(max-width: 634px) 100vw, 634px" /></span></p>
<p><span style="font-weight: 400;">Then, we’ll create a new variable named cs; this will store a matrix of the similarities between each important_features record for each movie, meaning it will include how similar each pair of movies in our dataset is.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14351 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code10-300x136.png" alt="" width="653" height="295" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code10-300x136.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code10-768x348.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code10.png 811w" sizes="(max-width: 653px) 100vw, 653px" /></span></p>
<p><span style="font-weight: 400;">This is a number between 0 and 1, we can see that the diagonal is 1 because each movie is 100% similar to itself.</span></p>
<p><span style="font-weight: 400;">We can check the size of this matrix, which will be Numbers of Movies * Numbers of Movies.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14352 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code11-300x61.png" alt="" width="541" height="110" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code11-300x61.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code11.png 498w" sizes="(max-width: 541px) 100vw, 541px" /></span></p>
<p><span style="font-weight: 400;">So, time to start the recommendation part. We will have a movie that the user has seen and we will recommend a similar movie to that one. In our example, the movie that the user has seen will be ‘</span><b>Art of Falling in Love</b><span style="font-weight: 400;">’, ID </span><b>‘12870’ </b></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14353 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code12-300x79.png" alt="" width="558" height="147" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code12-300x79.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code12.png 749w" sizes="(max-width: 558px) 100vw, 558px" /></span></p>
<p><span style="font-weight: 400;">*Notice that it has to be an existent movie in the dataset and that, if you change it, you’ll have to change the test*</span></p>
<p><span style="font-weight: 400;">Now, we will create a list of all the similarity score values for all the movies compared to the movie we’ve chosen. (Meaning get a column or a row in the cs matrix).</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14354 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code13-300x133.png" alt="" width="614" height="272" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code13-300x133.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code13-1024x454.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code13-768x341.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code13.png 1278w" sizes="(max-width: 614px) 100vw, 614px" /></span></p>
<p><span style="font-weight: 400;">Once we get it, we’ll sort it from most to least similar.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14355 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code14-300x151.png" alt="" width="645" height="325" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code14-300x151.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code14.png 837w" sizes="(max-width: 645px) 100vw, 645px" /></span></p>
<p><span style="font-weight: 400;">And we’ll show the top 10.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14356 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code15-300x145.png" alt="" width="575" height="278" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code15-300x145.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code15-1024x495.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code15-768x371.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code15.png 1032w" sizes="(max-width: 575px) 100vw, 575px" /></span></p>
<p><span style="font-weight: 400;">Great Work! </span></p>
<p><span style="font-weight: 400;">Looks like it&#8217;s working for romantic movies, but, to test it properly, we should test another genre. To do this, we’ll create a function we can call.</span></p>
<p><span style="font-weight: 400;">We actually wrote 3 functions; let&#8217;s have a look: </span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14357 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code16-300x242.png" alt="" width="614" height="495" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code16-300x242.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code16-768x619.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code16.png 881w" sizes="(max-width: 614px) 100vw, 614px" /></span></p>
<p><span style="font-weight: 400;">We are basically doing the same thing, but generalized for any movie so we can test our program, and called print a few times to make it more readable.</span></p>
<p><span style="font-weight: 400;">Let&#8217;s check how it works. </span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14358 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code17-300x81.png" alt="" width="541" height="146" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code17-300x81.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code17.png 510w" sizes="(max-width: 541px) 100vw, 541px" /></span></p>
<p><span style="font-weight: 400;">Ok, the exception looks good! </span></p>
<p><span style="font-weight: 400;">Let’s see a real result now.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14359 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code18-300x155.png" alt="" width="615" height="318" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code18-300x155.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code18-768x396.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code18.png 779w" sizes="(max-width: 615px) 100vw, 615px" /></span></p>
<p><span style="font-weight: 400;">Great! All of them are Alien/Galaxy related, looks good enough.</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14360 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code19-300x169.png" alt="" width="596" height="336" srcset="https://www.asapdevelopers.com/wp-content/uploads/2021/03/code19-300x169.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2021/03/code19.png 717w" sizes="(max-width: 596px) 100vw, 596px" /></span></p>
<p><span style="font-weight: 400;">I&#8217;m not sure all these movies are entirely similar, but this can be due to our dataset, or even our training selection. In any case, our simple recommendation system has passed the test for sure! </span></p>
<p><strong>Congratulations! You should be proud of yourself! </strong></p>
<p><span style="font-weight: 400;">What do you think? Can this be improved by collaborative filtering? </span><span style="font-weight: 400;">Would you take up the challenge? </span></p>
<h2><span style="font-weight: 400;">Final thoughts on Python Recommendation Systems</span></h2>
<p><span style="font-weight: 400;">The machine learning world can be overwhelming, but as you can see, it’s not rocket science! Anyone can build a basic system that works, and it can certainly save you time and money in your e-commerce business. Imagine recommending 1000 movies on our own! You would need an entire team to sort through the data, but with automation, it falls into the probability and statistics world, and it can be coded.</span></p>
<p><span style="font-weight: 400;">So we encourage you to delve deeper into this world, and hope this information helps you!</span></p>
<div id="fws_693973b47c673"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Mobile App Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-recommendation-systems/">Python Recommendation Systems</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Golang vs Python</title>
		<link>https://www.asapdevelopers.com/golang-vs-python/</link>
		
		<dc:creator><![CDATA[Joaquin Acuña]]></dc:creator>
		<pubDate>Mon, 28 Dec 2020 19:54:25 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=14061</guid>

					<description><![CDATA[<p>Go vs Python At some point, almost all development teams have to choose the best language to use for their software. That is why, in this article, we&#8217;ll be comparing...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/golang-vs-python/">Golang vs Python</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Go vs Python</h2>
<p><span style="font-weight: 400;">At some point, almost all development teams have to choose the best language to use for their software. That is why, in this article, we&#8217;ll be comparing <strong>Golang vs Python</strong> based on different attrasaibutes to help you decide which language is best suited for you and your team. More specifically, these are the attributes we&#8217;ll be looking at:</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Performance</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Scalability</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Applications</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Learning curve</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Rapid prototyping</span></li>
</ul>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-14073" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-300x300.png" alt="golang vs python" width="300" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-500x500.png 500w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-go.png 708w" sizes="(max-width: 300px) 100vw, 300px" /><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-14074" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-300x300.png" alt="goland vs python" width="300" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-500x500.png 500w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/vs.png 756w" sizes="(max-width: 300px) 100vw, 300px" /><img decoding="async" loading="lazy" class="alignnone size-medium wp-image-14075" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-300x300.png" alt="golang vs python" width="300" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-1021x1024.png 1021w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-768x770.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-500x500.png 500w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-1000x1000.png 1000w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python-800x800.png 800w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-python.png 1209w" sizes="(max-width: 300px) 100vw, 300px" /></span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">We&#8217;ve chosen <a href="https://golang.org/">Golang</a> vs <a href="https://www.python.org/">Python</a> as these two programming languages are often compared in the business community because they are not only good for creating web applications but also help automate business-related tasks.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14077 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/trends-300x254.png" alt="trends golang vs python" width="446" height="378" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/trends-300x254.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/trends-768x651.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/trends.png 868w" sizes="(max-width: 446px) 100vw, 446px" /></span></p>
<p><span style="font-weight: 400;">Before we get around to comparing Golang and Python, however, let us start by introducing you to these languages.</span></p>
<h2><b>Speaking of Golang (Go)</b></h2>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14078 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/go-300x193.png" alt="golang vs python" width="361" height="232" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/go-300x193.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/go.png 726w" sizes="(max-width: 361px) 100vw, 361px" /></span></p>
<p><span style="font-weight: 400;">Developed by Google back in 2009, Go was a solution to a problem. Its aim was to create a language that took away all the baggage and excesses found in languages such as C++. This gave it a performance and speed boost that makes working with it a delight. Plus, most developers picking up Go for the first time will not be left adrift since its familiar elements and ease of use lend a helping hand.</span></p>
<p><span style="font-weight: 400;">This language supports concurrent programming and also allows you to run multiple processes simultaneously.</span></p>
<h2><b>Let’s see an example….</b></h2>
<p><span style="font-weight: 400;">Imagine you run an </span><b>e-commerce</b><span style="font-weight: 400;"> store that takes orders from customers, checks inventory and charges for orders. In this case, each functionality is relatively small so, if you have a website built with Go, you can expect improved maintainability for relatively small services and an application that is easier to test and deploy effectively.</span></p>
<h2><b>A Python’s tale</b></h2>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class=" wp-image-14079 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/python-software-300x74.png" alt="python software" width="426" height="105" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/python-software-300x74.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/python-software-768x189.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/python-software.png 789w" sizes="(max-width: 426px) 100vw, 426px" /></span></p>
<p><span style="font-weight: 400;">Some developers think that Python&#8217;s where it all starts and ends. It has gained a cult-like following because it is an excellent programming language. The internet is filled with wonders that were created using Python.</span></p>
<p><span style="font-weight: 400;">Python is capable of unleashing its full potential when used in web development, machine learning and fintech. Moreover, thanks to its scalability, it is also popular among startups. </span></p>
<p><span style="font-weight: 400;">However, when looking for a tech partner who’ll help you launch your Python project, make sure they are working with Python 3 as the previous version of the language became obsolete in early 2020.</span></p>
<h2><b>Language simplicity means faster backend development </b></h2>
<p><span style="font-weight: 400;">To give you a practical example, if you were to code the same functionality using Java, it would take three to five times longer than with Python. The equation is simple here: fewer lines of code mean faster development and easier maintenance.</span></p>
<h2><b>Golang vs Python: Performance</b></h2>
<p><span style="font-weight: 400;">There are a lot of practical tests for API response time and, on this front, </span><b>Golang </b><span style="font-weight: 400;">is</span> <span style="font-weight: 400;">the absolute winner.  Python is a great language, but its performance isn&#8217;t the best for use cases such as serialization/deserialization, ranking and aggregation. There are cases with NoSQL databases such as Cassandra where it will take less time for the engine to retrieve data than for Python to turn it into objects.</span></p>
<h2><b>Golang vs Python: Scalability</b></h2>
<p><span style="font-weight: 400;">Building a truly scalable application is an art. If a system does not scale, it can be a problem for any business. </span></p>
<p><span style="font-weight: 400;">So, Google developers created Golang to help solve problems that are at Google’s scale. This involved thousands of programmers working on a large server software hosted on thousands of clusters. Therefore, Golang has support for concurrent process channeling.</span></p>
<p><span style="font-weight: 400;">Python has a really hard time with concurrency, but can implement parallelism through threads. </span></p>
<p><span style="font-weight: 400;">However, when it&#8217;s all said and done, Golang takes this one as well.</span></p>
<h2><b>Golang vs Python: Applications</b></h2>
<p><span style="font-weight: 400;">There isn’t a clear winner for this category. On one hand, Python is widely used in the field of data analytics, artificial intelligence, deep learning and web development.</span></p>
<p><span style="font-weight: 400;">This is thanks to the amazing libraries </span><b>Python</b><span style="font-weight: 400;"> offers which make developers’ lives easier. </span></p>
<p><span style="font-weight: 400;"><a href="https://pandas.pydata.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14084" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/pandas-300x188.png" alt="pandas" width="187" height="117" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/pandas-300x188.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/pandas.png 557w" sizes="(max-width: 187px) 100vw, 187px" /></a><a href="https://numpy.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14085" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/numpy-300x120.png" alt="NumPy" width="233" height="93" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/numpy-300x120.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/numpy-768x308.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/numpy-900x362.png 900w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/numpy.png 903w" sizes="(max-width: 233px) 100vw, 233px" /></a><a href="https://www.scipy.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14086" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/scipy-300x120.png" alt="scypy" width="200" height="80" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/scipy-300x120.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/scipy-768x306.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/scipy.png 793w" sizes="(max-width: 200px) 100vw, 200px" /></a><a href="https://matplotlib.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14087" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/matplo-300x72.png" alt="matplotlib" width="271" height="65" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/matplo-300x72.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/matplo-1024x246.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/matplo-768x185.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/matplo.png 1417w" sizes="(max-width: 271px) 100vw, 271px" /></a></span></p>
<p><span style="font-weight: 400;"><a href="https://scrapy.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14088" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/scrapy-300x121.png" alt="scrapy" width="240" height="97" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/scrapy-300x121.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/scrapy-1024x412.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/scrapy-768x309.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/scrapy.png 1417w" sizes="(max-width: 240px) 100vw, 240px" /></a><a href="https://flask.palletsprojects.com/en/1.1.x/"><img decoding="async" loading="lazy" class="alignnone wp-image-14089" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/flask-300x225.png" alt="flask" width="171" height="128" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/flask-300x225.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/flask-768x577.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/flask.png 945w" sizes="(max-width: 171px) 100vw, 171px" /></a><a href="https://pytorch.org/"><img decoding="async" loading="lazy" class="alignnone wp-image-14090" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/pytorch-300x95.png" alt="pytorch" width="268" height="85" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/pytorch-300x95.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/pytorch.png 394w" sizes="(max-width: 268px) 100vw, 268px" /></a></span></p>
<p><span style="font-weight: 400;">Golang, on the other hand, is mostly used for systems programming. Due to its concurrency support, it also has been used in cloud computing or clutter computing. </span><span style="font-weight: 400;">When it comes to good libraries, it also has a few interesting ones.</span></p>
<p><span style="font-weight: 400;"><a href="https://gokit.io/"><img decoding="async" loading="lazy" class="alignnone wp-image-14091" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-300x300.png" alt="logo" width="132" height="132" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/logo.png 472w" sizes="(max-width: 132px) 100vw, 132px" /></a><a href="https://gorm.io/"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-14092" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/gorm.png" alt="gorm" width="122" height="69" /></a><a href="https://github.com/tsenart/vegeta"><img decoding="async" loading="lazy" class="alignnone wp-image-14093" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/image-1-211x300.png" alt="image" width="98" height="140" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/image-1-211x300.png 211w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/image-1.png 708w" sizes="(max-width: 98px) 100vw, 98px" /></a><a href="https://github.com/sahilm/fuzzy"><img decoding="async" loading="lazy" class="alignnone wp-image-14094" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/box.png" alt="go box" width="187" height="162" /></a></span></p>
<p><span style="font-weight: 400;">But, given that Python can be used in more diverse fields, and the number of amazing libraries available for it, let&#8217;s give it this point.</span></p>
<h2><b>Golang vs Python: Learning curve</b></h2>
<p><span style="font-weight: 400;">If you’re new to coding, you may be looking at different aspects of your programming language than someone who wants to write an advanced physics simulator for wormhole experimentation. For example, you may want to learn a small language, one that does not imply learning complex syntax, or a flexible language that lets you express yourself more naturally. </span></p>
<p><span style="font-weight: 400;">Go is a small language, it doesn’t have many different ways to do the same thing and there aren’t many features built into the language to cover every possible thing you might want to do. In contrast, Python has more features: classes, lambdas, tuples, iterators and many more. </span></p>
<p><span style="font-weight: 400;">But, even though it has many more features, Python still feels natural. Just take a look at the following snippets. This first one is written in Python: </span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="alignnone wp-image-14071" src="https://www.asapdevelopers.com/wp-content/uploads/2020/12/image-300x111.png" alt="code golang vs python" width="476" height="176" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/12/image-300x111.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/12/image.png 431w" sizes="(max-width: 476px) 100vw, 476px" /></span></p>
<p><span style="font-weight: 400;">As you can see, it&#8217;s pretty straightforward. Next, let&#8217;s take a look at this other function using Go:</span></p>
<p><code>func Filter(vs []string, f func(string) bool) []string {<br />
vsf := make([]string, 0)<br />
for _, v := range vs {<br />
if f(v) {<br />
vsf = append(vsf, v)<br />
}<br />
}<br />
return vsf<br />
}</code></p>
<p><span style="font-weight: 400;">Go may be simple, but that’s not the same as easy. If this language is new to you, it can be hard to figure out what a line of code is meant to do. </span><span style="font-weight: 400;">If you&#8217;re taking your first steps in programming, Python will grant you an easier and more pleasant experience.</span></p>
<h2><b>Golang vs Python: Rapid prototyping</b></h2>
<p><span style="font-weight: 400;">Often in software development, a project&#8217;s requirements are not detailed in advance. Instead, a team may just want to get something up and running that proves the concept and gives results in a simple prototype they can show users, to get feedback and iterate over the product. </span></p>
<p><span style="font-weight: 400;">Python is excellent for this as it allows developers to get their thoughts down quickly in a form that looks almost like English, and results in a program that will probably run. Python’s dynamic typing is very forgiving as you don&#8217;t have to worry about knowing exactly what something is. </span></p>
<p><span style="font-weight: 400;">In contrast, Go is strict. It’s statically typed which means the compiler insists on verifying every file you pass to a function before executing it. This can make the programming experience feel a bit like doing paperwork just for a proof of concept. </span></p>
<h2><b>Final thoughts</b></h2>
<p><span style="font-weight: 400;"><a href="https://www.asapdevelopers.com/what-are-golang-advantages/">Golang</a> vs <a href="https://www.asapdevelopers.com/python-backend-language/">Python</a>, both deserve serious consideration. If at all possible, you should aim to have at least some level of experience in both as it will help you in any tech career, or it might even be enjoyable as a hobby.</span></p>
<p><span style="font-weight: 400;">Both have benefits, depending on what your goal is. There is still a lot more that remains to be seen regarding Go’s applicability and its potential to reach the same levels of Python in terms of industry adoption. As of now, Python continues to be the winner in terms of languages used across different industries and it is likely to continue holding this title in the near future.</span></p>
<div id="fws_693973b47e031"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/golang-vs-python/">Golang vs Python</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Flutter Login app with Python Backend</title>
		<link>https://www.asapdevelopers.com/flutter-login-app-with-python-backend/</link>
		
		<dc:creator><![CDATA[Joaquin Acuña]]></dc:creator>
		<pubDate>Mon, 16 Nov 2020 17:02:40 +0000</pubDate>
				<category><![CDATA[Flutter]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=13857</guid>

					<description><![CDATA[<p>Build a Flutter Login app with Python Backend In today’s world, businesses need to make critical choices when it comes to selecting mobile technologies and they also need to test...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/flutter-login-app-with-python-backend/">Flutter Login app with Python Backend</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Build a Flutter Login app with Python Backend</h2>
<p><span style="font-weight: 400;">In today’s world, businesses need to make critical choices when it comes to selecting mobile technologies and they also need to test and assess these technologies daily. Organizations that are unable to produce easy-to-use products and services are at risk of falling behind their competition.</span></p>
<p><span style="font-weight: 400;">Over the last few years, various mobile frameworks, such as React Native, Xamarin and AngularJS, have been developed. These make it simpler to create digital experiences. More recently, a new player has entered the game: Google Flutter.</span></p>
<p><span style="font-weight: 400;">Then, when it comes to the backend, there is Python. This language makes the learning process easier and its readability means communication is smoother for programmers working on the same project. This also makes it easier for a different programmer working on later additions to understand and work with the original code.</span></p>
<p><span style="font-weight: 400;">In this article, we’ll show you how to connect a Python Django backend with a Flutter frontend using GraphQL.</span></p>
<p><span style="font-weight: 400;">Before we get started, let’s take a look at why we choose to use these tools.</span></p>
<h2><b>Why we use Flutter</b></h2>
<p><img decoding="async" loading="lazy" class="size-medium wp-image-13646 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/10/FLUTTER-300x146.png" alt="Flutter Logo" width="300" height="146" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/10/FLUTTER-300x146.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/10/FLUTTER-1024x500.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/10/FLUTTER-768x375.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/10/FLUTTER.png 1092w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><a href="https://www.asapdevelopers.com/flutter-app-development/"><span style="font-weight: 400;">Flutter</span></a><span style="font-weight: 400;"> is a Google UI toolkit for building native apps for </span><span style="font-weight: 400;">Android</span><span style="font-weight: 400;">, </span><span style="font-weight: 400;">iOS</span><span style="font-weight: 400;">, PC and the</span> <span style="font-weight: 400;">web from a single codebase in record time. Flutter uses Dart as its programming language, a modern alternative to Javascript developed by Google. This OOP language is optimized for UI, fast on all platforms and similar to JavaScript with elements of Java. Flutter helps you develop faster, includes countless widgets, is open-source and portable, and has a great set of testing and debugging tools to optimize your app.</span></p>
<h2><b>Why we use GraphQ</b></h2>
<p><span style="font-weight: 400;">According to its </span><a href="https://graphql.org/"><span style="font-weight: 400;">website</span></a><span style="font-weight: 400;">, “GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.”</span></p>
<p><span style="font-weight: 400;">There are many advantages to using GraphQL. To start with, it creates a uniform API across an entire application without being limited by a specific storage engine. Moreover, GraphQL APIs leverage your existing data and GraphQL engines are available in many languages. Finally, GraphQL calls the functions you provide for each field in the type system with optimal concurrency.</span></p>
<h2><b>Why we use Python         </b></h2>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="aligncenter wp-image-13874" src="https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-300x300.png" alt="Python Logo" width="144" height="144" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-300x300.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-1024x1024.png 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-150x150.png 150w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-768x769.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-100x100.png 100w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-140x140.png 140w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-500x500.png 500w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-350x350.png 350w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-1000x1000.png 1000w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo-800x800.png 800w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/python-logo.png 1512w" sizes="(max-width: 144px) 100vw, 144px" /></span></p>
<p><span style="font-weight: 400;">There has</span><a href="https://www.asapdevelopers.com/python-backend-language/#:~:text=Python%20is%20great%20for%20machine%20learning&amp;text=Since%20the%20language%20is%20simple,associated%20with%20complex%20programming%20languages."> <span style="font-weight: 400;">long been a debate</span></a><span style="font-weight: 400;"> on which is the best backend language. Is it Swift? Or Java? Maybe C++? Well, although our programmers have an extensive toolkit that prepares them to tackle the most challenging problems, we do have a favorite. Python increases productivity, is platform-independent and easy to read, is great for machine learning, and has countless resources and a large community behind it.</span></p>
<h2><b>Why we use Django      </b></h2>
<p><span style="font-weight: 400;">Django is an open-source Python web framework that has been gaining a lot of popularity lately. It has been used extensively by companies such as Mozilla, Spotify and NASA, as well as</span> <a href="https://www.asapdevelopers.com/django-reasons-why/"><span style="font-weight: 400;">within our team</span></a><span style="font-weight: 400;">. Django is not only fast, secure and versatile: it’s also great for SEO, highly-scalable and portable.</span></p>
<p><span style="font-weight: 400;">Now, let’s get into our app. Here are the steps you should follow:</span></p>
<h2><b>1. Start a new Django Project</b></h2>
<p><span style="font-weight: 400;">Create the virtual env &amp; Activate it </span></p>
<p><span style="font-weight: 400;"><code>mkvirtualenv graphql-auth</code></span></p>
<p><span style="font-weight: 400;">Create the Django Project</span></p>
<p><code>pip install django<br />
django-admin startproject auth<br />
cd auth</code></p>
<p><span style="font-weight: 400;">Create the custom user model</span></p>
<p><span style="font-weight: 400;"><code>python manage.py startapp users</code></span></p>
<p><span style="font-weight: 400;">Then, create the custom user model: </span></p>
<p><script src="https://gist.github.com/joaquinacuna/302a884547e376b49f4427f4f3430478.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/302a884547e376b49f4427f4f3430478"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Add it to the settings</span></p>
<p><script src="https://gist.github.com/joaquinacuna/65a3138a4925f80bad35fea9317026f5.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/65a3138a4925f80bad35fea9317026f5"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Finally, migrate</span></p>
<p><code>python manage.py makemigrations<br />
python manage.py migrate</code></p>
<h2><b>2. Setup Graphene and GraphQL JWT</b></h2>
<p><span style="font-weight: 400;">Install Graphene</span></p>
<p><span style="font-weight: 400;"><code>pip install graphene-django django-graphql-jwt==0.3.0</code></span></p>
<p><span style="font-weight: 400;">Add the url</span></p>
<p><script src="https://gist.github.com/joaquinacuna/ae4f366767d3fe2af28a080693315160.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/ae4f366767d3fe2af28a080693315160"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Edit your settings</span></p>
<p><script src="https://gist.github.com/joaquinacuna/b2ec5e6d173fd3bba3363705e5a6bba7.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/b2ec5e6d173fd3bba3363705e5a6bba7"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Install Django-GraphQL-Auth</span></p>
<p><span style="font-weight: 400;"><code>pip install django-graphql-auth</code></span></p>
<p><script src="https://gist.github.com/joaquinacuna/f1372e39867870fa38cf0d2fe3218d93.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/f1372e39867870fa38cf0d2fe3218d93"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Run it:</span><span style="font-weight: 400;"> </span></p>
<p><span style="font-weight: 400;"><code>python manage.py migrate</code></span></p>
<h3><span style="font-weight: 400;">Setup Email Backend</span></h3>
<p><span style="font-weight: 400;">The default configuration is to send an activation email when registering users; you can set this to</span> <span style="font-weight: 400;">False</span> <span style="font-weight: 400;">on your</span> <a href="https://django-graphql-auth.readthedocs.io/en/latest/settings/"><span style="font-weight: 400;">settings</span></a><span style="font-weight: 400;">, </span><span style="font-weight: 400;">but you still need an email backend for resetting passwords.</span></p>
<p><span style="font-weight: 400;">The quickest solution for development is to set up a</span> <a href="https://docs.djangoproject.com/en/3.0/topics/email/#console-backend"><span style="font-weight: 400;">console email backend</span></a><span style="font-weight: 400;">. To do this, </span><span style="font-weight: 400;">simply add the following to your</span> <span style="font-weight: 400;">settings.py</span><span style="font-weight: 400;">.</span></p>
<p><span style="font-weight: 400;"><code>EMAIL_BACKEND ='django.core.mail.backends.console.EmailBackend'</code></span></p>
<h3><span style="font-weight: 400;">Query: </span><span style="font-weight: 400;">Create the schema</span></h3>
<p><span style="font-weight: 400;">Create a file called </span><span style="font-weight: 400;">schema.py</span><span style="font-weight: 400;"> next to your </span><span style="font-weight: 400;">settings.py</span><span style="font-weight: 400;"> with the following lines:</span></p>
<p><script src="https://gist.github.com/joaquinacuna/4ecdc34b9f1612a11b60fbbefbafd651.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/4ecdc34b9f1612a11b60fbbefbafd651"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">And add </span><a href="https://django-filter.readthedocs.io/en/master/index.html"><span style="font-weight: 400;">Django-Filter</span></a><span style="font-weight: 400;"> to the installed apps.</span></p>
<p><span style="font-weight: 400;"><code>pip install django-filter</code></span></p>
<p><span style="font-weight: 400;"># auth.settings.py</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/68af4d45d8ef801414d7d51943a04c22.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/68af4d45d8ef801414d7d51943a04c22"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<h3><span style="font-weight: 400;">Making your first query</span></h3>
<p><span style="font-weight: 400;">Start the dev server:</span></p>
<p><span style="font-weight: 400;"><code>python manage.py runserver</code></span></p>
<p><span style="font-weight: 400;">Open your browser:</span></p>
<p><span style="font-weight: 400;"><code>http://127.0.0.1:8000/graphql</code></span></p>
<p><span style="font-weight: 400;">On your</span> <span style="font-weight: 400;">GRAPHQL_JWT[</span><span style="font-weight: 400;">&#8220;JWT_ALLOW_ANY_CLASSES&#8221;</span><span style="font-weight: 400;">]</span><span style="font-weight: 400;"> setting, add the following:</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/4840556932335c78d96fa9d848eccdc4.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/4840556932335c78d96fa9d848eccdc4"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Let&#8217;s try to register a new user:</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/8852de351ed6e9bb60174565533d3742.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/8852de351ed6e9bb60174565533d3742"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Something went wrong! Now you know the response format that you can expect of all mutations</span></p>
<p><span style="font-weight: 400;">Let&#8217;s try again, this time, with a super-secret password:</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/1c9e96eae29dcbab5f8d0bef31a11c96.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/1c9e96eae29dcbab5f8d0bef31a11c96"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Check if the new user is really on the database:</span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/feb48664748c1f1cf2c6dfca92fe76e4.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/feb48664748c1f1cf2c6dfca92fe76e4"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Congratulations! You have successfully built your very first authentication system with GraphQL! Now, let&#8217;s create a beautiful frontend for it!</span></p>
<h2><b>3. Create the Flutter login app</b></h2>
<p><code>flutter create auth_frontend<br />
cd auth_frontend<br />
flutter run -d chrome</code></p>
<p><span style="font-weight: 400;">The first time you use it, you’ll see a simple app where you can press a button to increase a counter. </span><span style="font-weight: 400;"><br />
</span><span style="font-weight: 400;">For this tutorial, we have prepared a login example:</span></p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-13869 size-medium" src="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image-292x300.png" alt="flutter-login-example" width="292" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image-292x300.png 292w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image-768x788.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image.png 935w" sizes="(max-width: 292px) 100vw, 292px" /></p>
<p><span style="font-weight: 400;">So far, we have just made the following changes to our main.dart: </span></p>
<p><script src="https://gist.github.com/joaquinacuna/3fb451aa790bdedadf43bec386bc4dce.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/3fb451aa790bdedadf43bec386bc4dce"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">As you can see, a method is called when you press “register”, or “login”. Those are the functions we will implement with a simple backend call.</span></p>
<p>&nbsp;</p>
<h2><b>4. SetUp GraphQL in Flutter login</b></h2>
<p><span style="font-weight: 400;">GraphQL has many benefits, both for the client (devices will need fewer requests and, therefore, reduce data usage) and the programmer (requests are arguable, they have the same structure as the request).</span></p>
<h3><span style="font-weight: 400;">Installation</span></h3>
<p><span style="font-weight: 400;">First, add the following packages to your project&#8217;s dependencies: </span><em><span style="font-weight: 400;">pubspec.yaml</span></em></p>
<p><code>dependencies:<br />
graphql_flutter: ^3.0.0</code></p>
<p><span style="font-weight: 400;">Then, create a graphQL configuration file where you will set up the backend URL, and create the </span><span style="font-weight: 400;">GraphQLClient </span><span style="font-weight: 400;">object.</span></p>
<p><script src="https://gist.github.com/joaquinacuna/17820f4ae3eed2c4c3774de9bbcf7036.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/17820f4ae3eed2c4c3774de9bbcf7036"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">You will need another file to place your GraphQL queries:</span></p>
<p><script src="https://gist.github.com/joaquinacuna/bae2d3979b7ab26c6757df0ae5f3be30.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/bae2d3979b7ab26c6757df0ae5f3be30"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Then, modify your main.dart file to talk to the backend in Register.</span></p>
<p><span style="font-weight: 400;">First, import the necessary packages:</span></p>
<p><script src="https://gist.github.com/joaquinacuna/23926f914546489633ff0413e0ee4883.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/23926f914546489633ff0413e0ee4883"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Then, create the configuration objects in main: </span></p>
<p><script src="https://gist.github.com/joaquinacuna/130bcffdeccf369b8274139a3f37d167.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/130bcffdeccf369b8274139a3f37d167"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">In the _LoginpageState class, add the following:</span></p>
<p><script src="https://gist.github.com/joaquinacuna/ebb048262ea349500960a89f47fa72ca.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/ebb048262ea349500960a89f47fa72ca"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Then, make the </span><em><span style="font-weight: 400;">_createAccountPressed</span></em><span style="font-weight: 400;"> method async and add this code:</span></p>
<p><script src="https://gist.github.com/joaquinacuna/e264c810f63148fcf8cae80578d1fd51.js"></script><br />
<b>Link:</b> <a href="https://gist.github.com/joaquinacuna/e264c810f63148fcf8cae80578d1fd51"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Now, be sure your backend is running as it should, and try to register with a new account in your frontend server. You may see this beautiful error: </span></p>
<p><img decoding="async" loading="lazy" class=" wp-image-13871 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-error-image-300x42.png" alt="" width="489" height="68" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-error-image-300x42.png 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-error-image.png 634w" sizes="(max-width: 489px) 100vw, 489px" /></p>
<p><span style="font-weight: 400;">Blocked by CORS policy. </span><span style="font-weight: 400;">This happens because your backend does not accept requests from Flutter. There are many fixes for this, and it will depend on which environment you are deploying. For production, you should whitelist your frontend URL in the Django settings. But, for now, we will fix this in</span><span style="font-weight: 400;"> settings.py</span><span style="font-weight: 400;"> by allowing all CORS: </span></p>
<p><span style="font-weight: 400;"><code>pip install django-cors-headers</code></span></p>
<p><script src="https://gist.github.com/JoaquinAcuna97/8624de3ca6fc776994beb0390285bc4b"></script><br />
<b>Link:</b> <a href="https://gist.github.com/JoaquinAcuna97/8624de3ca6fc776994beb0390285bc4b"><span style="font-weight: 400;">script</span></a></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Finally, try to register a new user again and, if you enter a valid email, you should see a success message in the console!</span></p>
<p><span style="font-weight: 400;"><img decoding="async" loading="lazy" class="wp-image-13870 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image2-268x300.png" alt="flutter-login-app" width="458" height="513" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image2-268x300.png 268w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image2-915x1024.png 915w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image2-768x859.png 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/11/flutter-login-image2.png 1118w" sizes="(max-width: 458px) 100vw, 458px" /></span></p>
<p><span style="font-weight: 400;">Congratulations! You have built a complete web app, with both a frontend and backend! </span><span style="font-weight: 400;">Go ahead and build something amazing! </span></p>
<p><span style="font-weight: 400;">And, here is the entire project for you to download: </span><a href="https://github.com/JoaquinAcuna97/Flutter-Django-Login"><span style="font-weight: 400;">https://github.com/JoaquinAcuna97/Flutter-Django-Login</span></a><span style="font-weight: 400;"> </span></p>
<h2><b>Final thoughts on Flutter login</b></h2>
<p><span style="font-weight: 400;">Adding a widget with Flutter is really simple thanks to the </span><a href="https://flutter.dev/docs/development/ui/widgets"><span style="font-weight: 400;">official docs</span></a><span style="font-weight: 400;"> and you can find many widgets to add to your app. These include Appbars, icons, images, inputs, and animations, among many others. This, combined with the possibility to connect any backend services, including the potential of Django, is something that can bring a lot of value to your products, and keep your whole dev team happy! </span></p>
<div id="fws_693973b47f887"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/flutter-app-development/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Flutter Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/flutter-login-app-with-python-backend/">Flutter Login app with Python Backend</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python code complexity: Writing simpler and more maintainable code</title>
		<link>https://www.asapdevelopers.com/python-code-complexity/</link>
		
		<dc:creator><![CDATA[Pablo Giampedraglia]]></dc:creator>
		<pubDate>Mon, 18 May 2020 20:34:00 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.asapdevelopers.com/?p=12446</guid>

					<description><![CDATA[<p>Writing simpler and more maintainable Python  Your code is read by humans and Python makes it especially easy for people to understand. You should always aim to make what you...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-code-complexity/">Python code complexity: Writing simpler and more maintainable code</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2>Writing simpler and more maintainable Python </h2>





<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12696 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity01.jpg" alt="Python Wily" width="567" height="322" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity01.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity01-300x170.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Your code is read by humans and <a href="https://www.asapdevelopers.com/python-backend-language/">Python makes it especially easy for people to understand</a>. You should always aim to make what you are trying to achieve with that function easy to understand not just when it comes to code comments, but also in your code structure. In this article, we will focus on Python code complexity and how to ensure your code is as readable as possible.</p>



<h2>What is Python code complexity?</h2>



<p>To understand Python code complexity we can take a look at Cyclomatic Complexity (proposed by Tomas McCabe in 1976), a metric used to calculate it. This is a measure of the linearly independent paths computed using the control-flow graph of your code. The control-flow graph is a representation of all paths that might be traversed through a program during its execution.</p>







<h2><img decoding="async" loading="lazy" class="aligncenter wp-image-12735 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity14.jpg" alt="Is my Python code complicated?" width="650" height="392" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity14.jpg 650w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity14-300x181.jpg 300w" sizes="(max-width: 650px) 100vw, 650px" /></h2>
<h2>The benefits of measuring software complexity</h2>



<h3>1. Better tests</h3>



<p>By knowing how many code paths there are, you can know how many paths you have to test. As a result, you’ll have an idea of how many tests are required, at a minimum, to ensure that the code’s covered.</p>



<h3>2. Reduced Risk</h3>



<ol>
<li>It’s harder to read code than to write it and code is read far more than it is written.</li>
<li>A good software developer should never be assessed by the lines of code they’ve written (or changed), but by the quality of the code they’ve maintained.</li>
</ol>



<h3>3. Lower costs</h3>





<h2><img decoding="async" loading="lazy" class="aligncenter wp-image-12707 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity03.jpg" alt="The Relative cost of fixing bugs" width="523" height="323" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity03.jpg 523w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity03-300x185.jpg 300w" sizes="(max-width: 523px) 100vw, 523px" /></h2>
<h2>How do we measure Python code complexity?</h2>



<p>Well, here is were <a href="https://pypi.org/project/wily/">Wily</a> comes in handy. </p>



<p>But let’s understand how to measure it first&#8230;</p>



<p>Cyclomatic complexity equals the number of decisions in the source code. The higher the count, the more complex the code. </p>



<p>Let’s take a look at an <a href="https://gist.github.com/joaquinacuna/5cb2a2675b508c1557d7b99fe59646cb">example in this code</a>: </p>

<p><script src="https://gist.github.com/joaquinacuna/5cb2a2675b508c1557d7b99fe59646cb.js"></script></p>
<!-- /wp:embed -->
<p>&nbsp;</p>
<!-- wp:paragraph -->
<p>Every time there is an if block in Python, code cyclomatic complexity increases by 1. This code has 3, which means it is not that complex. Another way to see Python code complexity is by turning your code on its side and drawing a line around the white spaces, which will look like this:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12706 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity04.jpg" alt="code block in Python" width="567" height="517" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity04.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity04-300x274.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Basically, the higher the curves, the higher the Python code Cyclomatic complexity.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let’s take a look at some math that Wily applies to better understand the metrics:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Operands = number of values + number of variables:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12705 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity05.jpg" alt="Python code complexity" width="567" height="134" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity05.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity05-300x71.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Operators = number of built-in syntax:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12704 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity06.jpg" alt="Python code complexity" width="341" height="107" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity06.jpg 341w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity06-300x94.jpg 300w" sizes="(max-width: 341px) 100vw, 341px" /></p>
<p>Length = number of operands + number of operators:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12703 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity07.jpg" alt="Python code complexity" width="567" height="114" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity07.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity07-300x60.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Vocabulary = unique operands + unique operators:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12702 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity08.jpg" alt="Python code complexity" width="567" height="102" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity08.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity08-300x54.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Volume = length * Log(Vocabulary): (better indicator than Lines of code)</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12701 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity09.jpg" alt="Python code complexity" width="545" height="121" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity09.jpg 545w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity09-300x67.jpg 300w" sizes="(max-width: 545px) 100vw, 545px" /></p>
<p>Difficulty (D):</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12700 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity10.jpg" alt="Python code complexity" width="567" height="219" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity10.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity10-300x116.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>We can obtain all these metrics from our code just by using <a href="https://pypi.org/project/radon/">Radon</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12699 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity11.jpg" alt="Radon command" width="567" height="388" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity11.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity11-300x205.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>And finally, by combining all of these numbers, we can obtain our maintainability index: </p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12698 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity12.jpg" alt="Maintainability index" width="567" height="285" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity12.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity12-300x151.jpg 300w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>The maintainability index is the “rank” of how maintainable each file in your code is, and you should aim to improve this number to reduce the costs of maintaining your code.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Willy will save you time and money by presenting you with cool reports like this one for python cyclomatic complexity analysis:</p>
<!-- /wp:paragraph -->

<!-- wp:image --><!-- /wp:image -->

<!-- wp:paragraph -->
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12697 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity13.jpg" alt="Python code report" width="567" height="608" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity13.jpg 567w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/PythonCodeComplexity13-280x300.jpg 280w" sizes="(max-width: 567px) 100vw, 567px" /></p>
<p>Moreover, Wily will help you see and track the evolution of your project’s cyclomatic complexity index with your version control systems so you can keep your code clean and simple.  </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2><img decoding="async" loading="lazy" class="aligncenter wp-image-12524 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/05/wily-thumb.jpg" alt="Python code complexity: Writing simpler and more maintainable Python " width="600" height="403" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/05/wily-thumb.jpg 600w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/wily-thumb-300x202.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/05/wily-thumb-400x269.jpg 400w" sizes="(max-width: 600px) 100vw, 600px" /></h2>
<h2>Final thoughts on Python code complexity</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>As you can see, Wily is a very powerful tool that will help you write maintainable code, make other programmers happy, and make you a happier programmer when it comes to reading your and your team’s code. It is definitely worth a try.</p>

		<div id="fws_693973b4811f4"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Services</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>&nbsp;</p>
<!-- /wp:paragraph --><p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/python-code-complexity/">Python code complexity: Writing simpler and more maintainable code</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Django: Top 9 reasons why you should use it</title>
		<link>https://www.asapdevelopers.com/django-reasons-why/</link>
		
		<dc:creator><![CDATA[S-Mirazoqui]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 15:38:26 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">http://3.86.5.166/?p=12312</guid>

					<description><![CDATA[<p>Why you should use Django Django is an open-source Python web framework that has been gaining a lot of popularity lately. It has been used extensively by companies such as...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/django-reasons-why/">Django: Top 9 reasons why you should use it</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2><em><strong>Why you should use Django</strong></em></h2>





<p>Django is an open-source Python web framework that has been gaining a lot of popularity lately. It has been used extensively by companies such as Mozilla, Spotify and NASA, as well as within our team. This framework was built by experienced developers and aims at using automation wherever possible to speed up web development and let developers focus on the important stuff. It is fast, secure and versatile. In this article, we will be focusing on the top 9 reasons why we think you should be using it.</p>



<h2><strong><em>1. Built with Python</em></strong></h2>



<p>Because it was built with Python, the Django framework inherits some of this programming language’s most interesting benefits. As we’ve mentioned in <a href="https://www.asapdevelopers.com/python-backend-language/">a previous article</a>, some of Python’s main advantages are that it’s widely adopted, it’s considered to be quite easy to both read and use, and it’s ideal for machine learning. So, if you’re already coding with Python, Django will be easy to learn. And, even if you’re not, it shouldn’t really pose a challenge either. As an added bonus, Django being built on Python also means that, if you’re in the market for new developers, it should not be difficult to find some that are proficient in this framework.</p>





<p><strong><em><img decoding="async" loading="lazy" class="size-medium wp-image-10609 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-300x300.jpg" alt="Python Logo" width="300" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-300x300.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-150x150.jpg 150w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-100x100.jpg 100w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-140x140.jpg 140w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-500x500.jpg 500w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01-350x350.jpg 350w, https://www.asapdevelopers.com/wp-content/uploads/2019/12/Python3Roadmap01.jpg 602w" sizes="(max-width: 300px) 100vw, 300px" /></em></strong></p>
<h2><strong><em>2. Excellent community</em></strong></h2>



<p>As expected with most open-source projects, Django has a great community of users and backers. Therefore, there is a massive amount of material and resources on it (everything from documentation and tutorials to videos and articles), as well as meetups and workshops. This means that if you happen to come across any issues, someone has probably tackled it before, and will be willing to help you out. You can take a look at Django’s official community <a href="https://www.djangoproject.com/community/">here</a>.</p>



<h2><strong><em>3. Highly secure</em></strong></h2>



<p>This is a major selling point for the framework, as it is quite hard to find any security loopholes. Django has strong encryption packages and protection against common attacks (like XSS attacks and Clickjacking), as well as a solid user authentication system. Moreover, it hides your website’s source code and notifies developers of various common security mistakes.</p>





<h2><strong><em>4. Great set of libraries</em></strong></h2>



<p>Another great advantage of stemming from Python and its wonderful community is that Django has numerous useful libraries. Some of the most popular ones include the <a href="https://www.django-rest-framework.org/">Django REST framework</a>–aimed at building application programming interfaces–, and the <a href="https://www.django-cms.org/en/">Django CMS</a>–focused on website content management.</p>



<h2><strong><em><img decoding="async" loading="lazy" class="size-medium wp-image-12425 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2020/04/django001-300x104.jpg" alt="django" width="300" height="104" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/04/django001-300x104.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/django001-600x208.jpg 600w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/django001.jpg 602w" sizes="(max-width: 300px) 100vw, 300px" /></em></strong></h2>
<h2><strong><em>5. Good for SEO</em></strong><img alt="" /></h2>





<p>Search engine optimization (SEO) is an essential piece of web marketing and, therefore, it is something you should always keep in mind. It is a good thing, then, that Python’s human-readable code gives it an advantage when it comes to search result rankings. Moreover, Django has several SEO tools, including a module called <a href="https://django-seo.readthedocs.io/en/latest/introduction/tutorial.html">Django SEO framework</a> that helps you reduce page loading times.</p>



<h2><strong><em>6. Highly scalable</em></strong></h2>



<p>Scalability is rather important when it comes to developing web apps. Django includes a series of default components that can be unplugged and replaced for more specific solutions, making scalability effortless. The framework also has the ability to handle traffic and mobile app API usage for a whopping 400 million users, therefore maximizing scalability and minimizing web hosting costs. What is more, Django lets you use plugins to extend your web app, and there are countless packages available to help you scale up your product.</p>



<h2><strong><em>7. Based on the DRY principle</em></strong></h2>



<p><img alt="" />The DRY (don’t repeat yourself) principle encourages developers to reuse existing code, thus reducing errors and simplifying maintenance. This makes Django time-efficient and perfect for high load systems.</p>





<h2><strong><em>8. </em></strong><strong><em>Django </em></strong><strong><em>Default admin panel</em></strong></h2>



<p>Django includes a default admin panel to help you manage your application. As well as saving you a considerable amount of time, the panel makes the work dynamics between developers and non-technical staff much smoother as they can immediately start working together on content and processes. You can, of course, modify and adapt the panel to fit your needs.</p>



<h2><strong><em><img decoding="async" loading="lazy" class="aligncenter wp-image-12313 size-large" src="https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django-1024x320.jpg" alt="Top 9 reasons why you should use Django" width="1024" height="320" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django-1024x320.jpg 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django-300x94.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django-768x240.jpg 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django-1536x480.jpg 1536w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/Top-9-reasons-why-you-should-use-Django.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></em></strong></h2>
<h2><strong><em>9. </em></strong><strong><em>Django </em></strong><strong><em>Portability</em></strong></h2>



<p>As Python runs on virtually any platform, such as Mac, PC and Linux, so does Django. Therefore, no development or production environment is left unsupported. If that wasn’t enough for you, Django also includes an <a href="https://blog.bitsrc.io/what-is-an-orm-and-why-you-should-use-it-b2b6f75f5e2a?gi=cdc0c829f115">ORM</a> (object-relational mapper)—a layer between developer and database—that makes it possible to move projects between databases by merely changing a line of code.</p>
<h2><strong><em>Final thoughts on Django</em></strong></h2>



<p>Detractors of Django might be quick to point out that it is not well-suited for small-scale projects, is monolithic, and does not include default support for real-time web apps, but we think the pros far outweigh the cons. As we’ve seen, Django has countless major advantages and access to a never-ending supply of resources, making it a wonderful framework when it comes to web app development. If you aren’t using it already, we hope we were able to at least make you a bit curious about trying it out.</p>

		<div id="fws_693973b4821e9"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/django-reasons-why/">Django: Top 9 reasons why you should use it</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PyCon 2020: All you need to know</title>
		<link>https://www.asapdevelopers.com/pycon-2020-need-to-know/</link>
		
		<dc:creator><![CDATA[S-Mirazoqui]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 15:28:34 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">http://3.86.5.166/?p=12297</guid>

					<description><![CDATA[<p>All you need to know about PyCon 2020 Over the last few weeks, we have been focusing on Python, one of our favorite backend languages. In this article, we’d like...</p>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/pycon-2020-need-to-know/">PyCon 2020: All you need to know</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><em><strong>All you need to know about PyCon 2020</strong></em></h2>
<p>Over the last few weeks, we have been focusing on Python, one of our <a href="https://www.asapdevelopers.com/python-backend-language/">favorite backend languages</a>. In this article, we’d like to give you an overview of the largest Python-related conference out there: PyCon 2020. With the <a href="https://us.pycon.org/2020/">2020 edition</a> just a few months away, there’s a lot you should know, and we&#8217;ll try to cover some of the basics here.</p>
<h2><strong><em>What is PyCon?</em></strong></h2>
<p>PyCon has taken place every year since 2003 starting in Washington D.C. and touring other cities like Chicago, Santa Clara and Cleveland. In 2003, only 200 people attended PyCon. Since then, it has become the largest gathering for the Python community with over 3000 attendees last year. The conference was created by the <a href="https://us.pycon.org/2020/psf/">Python Software Foundation</a>, an NPO that aims to advance and promote Python. PyCon 2020 is also sponsored by dozens of <a href="https://us.pycon.org/2020/sponsors/">big companies</a> including Microsoft Azure, Facebook, Slack, JetBrains, Duolingo, Amazon Web Services and Google.</p>
<p>Last year’s edition was held in Cleveland back in May and its keynote speakers included the founder of <a href="https://beeware.org/">BeeWare</a>, Russell Keith-Magee, the founder and CTO of <a href="https://pilot.com/">Pilot</a>, Jessica McKellar, and the <a href="https://realpython.com/lessons/python-steering-council/">Python Steering Council</a>. This year, the conference will be held in Pittsburgh at the David. L. Lawrence Convention Center on April 15-23. These nine days will be jam-packed with tutorials, conferences and developer sprints. The registration rates are $125 for students, $400 for individuals and $700 for companies. Moreover, there are some events that come with an extra cost as well as some free-of-cost events we’ll detail below. You can find more information regarding rates, accommodation and travel <a href="https://us.pycon.org/2020/registration/">in this link</a>.</p>
<h2><strong><em><img decoding="async" loading="lazy" class="size-medium wp-image-10524 aligncenter" src="https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-300x300.jpg" alt="Python Logo" width="300" height="300" srcset="https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-300x300.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-150x150.jpg 150w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-100x100.jpg 100w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-140x140.jpg 140w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-500x500.jpg 500w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001-350x350.jpg 350w, https://www.asapdevelopers.com/wp-content/uploads/2019/11/Python001.jpg 602w" sizes="(max-width: 300px) 100vw, 300px" /></em></strong></h2>
<h2><strong><em>Why should you attend PyCon 2020?</em></strong></h2>
<p>If you&#8217;re unsure about whether PyCon 2020 is for you, here are some reasons to get you excited.</p>
<ol>
<li>You’ll be updated on everything related to Python, getting the latest scoop and data.</li>
<li>You’ll get to network with industry professionals, as well as potential employers or employees.</li>
<li>You don’t just get a chance to attend the many exciting events listed below, but you also get the chance to be more actively involved by proposing a talk, a tutorial, a poster or a mentorship.</li>
<li>You can take part in the <a href="https://us.pycon.org/2020/hatchery/">hatchery</a> program aimed at introducing new tracks, summits and demos to the conference.</li>
<li>You’ll get a chance to schedule informal presentations or discussions by making use of PyCon’s Open Spaces.</li>
<li>You&#8217;ll get to do all of this while keeping it environmentally friendly thanks to PyCon&#8217;s focus on <a href="https://us.pycon.org/2020/about/sustainability/">sustainability</a>.</li>
</ol>
<h2><strong><em><img decoding="async" loading="lazy" class="aligncenter wp-image-12298 size-large" src="https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020-1024x320.jpg" alt="PyCon 2020: All you need to know" width="1024" height="320" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020-1024x320.jpg 1024w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020-300x94.jpg 300w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020-768x240.jpg 768w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020-1536x480.jpg 1536w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></em></strong></h2>
<h2><strong><em>What should you expect this year?</em></strong></h2>
<p>Although the detailed schedule will be released in February, we already have an idea of what PyCon 2020 will look like. Here are the events we think you should look out for:</p>
<ul>
<li>Tutorial days: the place to be if you want to learn something new. To be held on April 15 and 16, these are intense 3-hour sessions during the day followed by some more relaxed networking in the evenings.</li>
<li>Conference days: these will take place from April 17 to 19 and will revolve around what’s new in the world of Python. They will give you a chance to share your knowledge, make contacts and discuss projects. They include:
<ol>
<li>Scheduled talks with one keynote speaker followed by several talks and panels covering a wide range of topics. There are even <a href="https://us.pycon.org/2020/speaking/charlas/">PyCon Charlas</a> for Spanish-speakers interested in talking or attending events in this language.</li>
<li>Open spaces where you can schedule informal presentations or discussions.</li>
<li>Five-minute lightning talks held at the end of each day.</li>
<li>A poster session on the last day where academics, developers, community members and hobbyists answer questions and show off their work with, you guessed it, graphic posters.</li>
<li>The <a href="https://us.pycon.org/2020/events/auction/">PyLadies Auction</a>, including over 55 items provided by sponsors to support the PyLadies community.</li>
</ol>
</li>
<li>The <a href="https://us.pycon.org/2020/sponsors/exhibit-hall/">Expo Hall</a>: the Expo Hall will hold several activities during PyCon 2020. The action starts with the opening reception on April 16. Then, on April 18 and 19, it will be filled with <a href="https://www.asapdevelopers.com/python-development-company/">Python development companies</a> running in parallel to the conference. Finally, the Job Fair will also be held here on April 19.</li>
<li><a href="https://us.pycon.org/2020/events/sprints/">Development sprints</a>: these will be held from April 20 to 23 and give contributors of open-source projects a chance to meet and share learning and development experiences. Participation is free and everybody is welcome, even if they’re not taking part in the talks and events.</li>
<li>Summits: if all of these events weren’t enough, two summits will be held during the tutorials days. These are the Python Language Summit and the <a href="https://us.pycon.org/2020/events/edusummit/">Python Education Summit</a>. The Python Language Summit is aimed at those developers who work on Python implementations and wish to share information or discuss problems while working towards solving them. The Python Education Summit taking place on April 16 brings teachers and educators together to tackle coding literacy.</li>
<li>Job fair: a chance for potential employers and employees to connect, this space will be open to the public on April 19 from 10 am to 1 pm.</li>
<li>Social events: there will also be plenty of opportunities to socialize, such as the opening reception on the 16, evening dinners on conference days, and a <a href="https://us.pycon.org/2020/events/5k/">5k run/walk</a> early on Sunday, 19.</li>
</ul>
<p>You can also browse around the website for the <a href="https://us.pycon.org/2019/">2019 edition</a> to get a clearer picture of the activities and an idea of what the schedule might look like or take a look at some <a href="https://realpython.com/must-watch-pycon-talks/">past talks</a>.</p>
<h2><strong><em>Why Pittsburgh?</em></strong></h2>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-12403 size-full" src="https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020_01.jpg" alt="Pittsburgh - PyCon 2020" width="606" height="343" srcset="https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020_01.jpg 606w, https://www.asapdevelopers.com/wp-content/uploads/2020/04/PyCon2020_01-300x170.jpg 300w" sizes="(max-width: 606px) 100vw, 606px" /></p>
<p>This Pennsylvania city has become quite the tech hub in recent years, with many calling it <a href="https://www.post-gazette.com/business/tech-news/2019/12/12/Brookings-Institution-upmc-university-pittsburgh-carnegie-mellon-startup-economy/stories/201912100133">the next Silicon Valley</a>. It has plenty of academic and research resources and is currently 9th on the Brookings Metropolitan Policy Program’s list of potential growth centers. This is probably why Google, Uber and Facebook are just some of the companies that have set up offices in this city, so PyCon 2020 attendants should feel right at home.</p>
<h2><strong><em>PyCon 2020 Final thoughts</em></strong></h2>
<p>As you can see, if you are a Python developer, PyCon 2020 is full of opportunities for you to learn and socialize around the language. We believe this conference can really be worth your while but warn you not to get too ambitious if you decide to attend. With so many events over nine days, you’ll probably have to prioritize. We hope after reading this article you’ll be looking forward to the February release of the full schedule as much as we are!</p>
<div id="fws_693973b4832dc"  data-column-margin="default" data-midnight="dark"  data-bg-mobile-hidden="" class="wpb_row vc_row-fluid vc_row standard_section "  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-overlay="false"><div class="inner-wrap"><div class="row-bg"  style=""></div></div><div class="row-bg-overlay" ></div></div><div class="col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-t-w-inherits="default" data-border-radius="none" data-shadow="none" data-border-animation="" data-border-animation-delay="" data-border-width="none" data-border-style="solid" data-border-color="" data-bg-cover="" data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-hover-bg="" data-hover-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" ><div class="column-bg-overlay-wrap" data-bg-animation="none"><div class="column-bg-overlay"></div></div>
			<div class="wpb_wrapper">
				<a class="nectar-button large regular accent-color has-icon  wpb_animate_when_almost_visible wpb_bounce bounce regular-button"  style="margin-top: 40px; color: #ffffff; "  href="https://www.asapdevelopers.com/python-development-company/" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Python Web Development Company</span><i style="color: #ffffff;"  class="icon-button-arrow"></i></a>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a rel="nofollow" href="https://www.asapdevelopers.com/pycon-2020-need-to-know/">PyCon 2020: All you need to know</a> appeared first on <a rel="nofollow" href="https://www.asapdevelopers.com">asap developers</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
