<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jose Apablaza on Medium]]></title>
        <description><![CDATA[Stories by Jose Apablaza on Medium]]></description>
        <link>https://medium.com/@japablaza?source=rss-ac9d4b309ac7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eRlGD2sOHbNS6bJZ</url>
            <title>Stories by Jose Apablaza on Medium</title>
            <link>https://medium.com/@japablaza?source=rss-ac9d4b309ac7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:04:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@japablaza/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[#3 Lessons learned]]></title>
            <link>https://medium.com/@japablaza/3-lessons-learned-98e133a0b330?source=rss-ac9d4b309ac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/98e133a0b330</guid>
            <category><![CDATA[chicago-python]]></category>
            <category><![CDATA[chip-monks-stories]]></category>
            <category><![CDATA[chipy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chipy-mentor-ship]]></category>
            <dc:creator><![CDATA[Jose Apablaza]]></dc:creator>
            <pubDate>Mon, 10 Dec 2018 17:33:23 GMT</pubDate>
            <atom:updated>2018-12-10T17:33:23.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*y1CC9_FXrV-a5XABh5MJpw.jpeg" /></figure><p>In the previous posts. I have reviewed the GET request using python and then how to call the API website endpoint like the one from openweathermap.org. The next goal was adding some web interface and functionality with nutrition (almost there). In the next paragraphs, I will describe how I started using the information from a JSON file and navigate through the information until I got the pieces that will help me to construct the next GET request to another API endpoints.</p><p>After spending most of the time researching and studding I finally was able to create a sequence of calls using the information from other API request. Also, I was able to group the calls and create a function from each one. That came useful when I have to display the data using Flask. Since Python treats everything as an Object it took me significantly a lot of time to grasp that concept and take advantage of it. After couple sessions with my mentor and eating pages and pages of Python documentation, books, examples, etc. I got to the point that all the functions created for each API can be reused as a variable in Flask decorators !!!. That is a concept that still blows my mind :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrKPVb6vhmlrvjuDcsZm2g.png" /><figcaption>API project for ChiPy Mentorship program</figcaption></figure><h3>Lesson learned</h3><ul><li>Time and a plan before coding. I feel this is something I read and/or hear before. If life takes your plan to the end of the list and reduces it to cero, then find a plan B. Suggestion, take all those <em>dead times</em> like during the commute, waiting in line, etc and read documentation or websites with examples.</li><li>Keep your files in one single repository. Losing your laptop or storage will send you back to the start line. Gitlab or any other service will do the trick.</li><li>Keep your SECRET_KEY in a SECRET place and do not include them in your code. In my case, I used <strong><em>os.environ.get. </em></strong>First, You must export the variable in your OS.</li><li>Save all those links that help you with your project. You can sync your account with the browser, in the case you have multiples laptops</li><li>Create a virtual environment for every project and test. This might be tedious once you hit a large number of project. The key here is find a naming convention. Once you find it, stick to it</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98e133a0b330" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#2 Navigating the Python ocean]]></title>
            <link>https://medium.com/@japablaza/2-navigating-the-python-ocean-8508ba559a93?source=rss-ac9d4b309ac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8508ba559a93</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[chip-monks-stories]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Jose Apablaza]]></dc:creator>
            <pubDate>Fri, 19 Oct 2018 05:00:18 GMT</pubDate>
            <atom:updated>2018-10-19T06:11:58.376Z</atom:updated>
            <content:encoded><![CDATA[<p>#2 Navigating the Python ocean</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*LgX61xw8YUvF1OrTaBDBmw.png" /></figure><p>In the previous post, I finished it with an example of how to GET the data from an API endpoint and print some result coming from the data. In this post, I will unfold the project I am working on and why APIs are important for it.</p><p><strong>The APIs and the GET request.</strong></p><p>Today’s websites and online applications are reachable using their API (Application Program Interface) and APIs are build, generally in JSON format. Like HTML is the language to build websites for humans, JSON is the language to build websites for computers. The cool part of Python is the libraries out of the box ready to connect and process APIs and its data. One of the goals of my project is working with the data coming from one API, take some pieces from it and use it to create the next request in a second API.</p><p>For example, <a href="https://openweathermap.org/">https://openweathermap.org/</a> will provide the coordinates (Latitude and Longitude) that later I can use with <a href="https://foursquare.com/">https://foursquare.com/</a> and determine some places to eat, have a coffee or an iced tea. By then I will know the temperature and I can choose whether I want something hot or cold. Getting the data from the first API, store it in a list, and then using that data for other purposes took me quite a long time (days and nights). But it is paying off since this is allowing me to understand the way how a programming language like Python works and manage data.</p><p>At this point, one of the things that my mentor recommended was breaking the code in small pieces and build a function from each piece. The cool part of doing that enable me to understand the meaning of functions itself and recycling the code by calling the function instead re-writing it.</p><p><strong>What I have learned so far?</strong></p><p>Reading and using examples codes available in the official documentation of Python and in each library helps but in my case gave me 10% to 20% of understanding what I just read and did.</p><p>Reading different approach about the same topic in books gave me another 10% to 20% of understanding.</p><p>Having a dedicated space with a whiteboard where I can add notes and example code add another 10%.</p><p>Identify the logic or code you are repeating, then find the way to build a function out of it and call it every time you need it. This added another 20%</p><p>Constantly re-read the code and find the way to improve it or include pieces like documentation or comments that could help you to understand what is the purpose of the code, and what is expecting. The documentation is like the terminator from the future, but in this case, it will save your time.</p><p><strong>What is next in the project?</strong></p><p>Add a web interface and storing meals data. Here the goal is having some visual interface for an easy request and testing. The stored data will be used for analysis on calories and nutrition from each item by day, week, month. This information can be obtained with another API :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8508ba559a93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My python journey]]></title>
            <link>https://medium.com/@japablaza/python-journey-21f54507d2a1?source=rss-ac9d4b309ac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/21f54507d2a1</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[chipy-mentor-ship]]></category>
            <category><![CDATA[chicago]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Jose Apablaza]]></dc:creator>
            <pubDate>Fri, 21 Sep 2018 04:34:49 GMT</pubDate>
            <atom:updated>2018-09-21T04:57:34.218Z</atom:updated>
            <content:encoded><![CDATA[<h3>#1 My python journey</h3><p>My first blog for Chicago Python (ChiPy) Mentorship program. The mentorship program is part of the Python community in Chicago and if you want to learn more about the community and python, a good place to start is</p><p><a href="http://www.chipy.org/">Welcome</a></p><p>There you can find the schedule, places where we meet and since we are in the Internet era you can request access to the different flavors of communication we have available. You can follow us in</p><p><a href="https://twitter.com/chicagopython">ChiPy (@ChicagoPython) | Twitter</a></p><p>I bit about me. I am from Santiago, Chile and I move to Chicago 2 years ago. I live in the South suburbs and I enjoy the all the seasons, especially winter ;)</p><p>So now back to the ChiPy mentorship program. The first time I heard about it was about 4 months ago when my brother in law (Sebastian) was helping me with my first steps with Python. We accomplished quite a bit by requesting the API data and creating a dictionary out of it. From there adding some block code to determine the status of devices. Quite good for a beginner but not quite. My knowledge in Python extended to ‘print(‘hello ’ + name), where the name is a variable that holds my name like this ‘name = ‘Jose’’ When I saw that in the output I thought ‘I can do anything’ … mmmm again not quite. First I will have to learn the ways of Python, then use them and master my own. I knew that online tutorials, free PDFs and books will help, but there always was a gap that I carry after and increasing during the time… I should try something different and then again, Sebastian told me about the mentorship program. Quite a good timing he mentioned, since I had about a month before the application process closed. I did make it and I got in the program. I met all the mentees and mentor and the most important I met my own mentor, Eli. With him, in this journey, I can foresee that things are taking a new direction.</p><p>I can say that the program is well structured, the administrator and people behind it are professionals that create the right atmosphere for all of us that participate in the program and others that are interested in learning python can get involved really quickly.</p><p>Now back to Python and the program. I would like to share what I have done with python and next steps. The first thing is getting an open API so we can request the data in JSON and save it in a python dictionary. From then the request would be calling the values and do some test. Finally, print a message in the console so we can test our first logic. For this example, I am using python 3.6.5 and Linux Mint 18.3. As a text editor, I am using Atom with couple packages like ‘linter’, ‘linter-flake-8’, among other that makes my life easier during writing code. Thanks, Eli for those tips ;)</p><p>Now if you copy and paste the next code in Atom, save it as python file and run it from your terminal you should get an output like the one under the code.</p><p># ===CODE====</p><blockquote>import requests<br>url_test = ‘<a href="https://api.github.com&/#39;">https://api.github.com&#39;</a><br>respuesta = requests.get(url_test)<br>num = respuesta.status_code<br>status = respuesta.json()<br>print(type(respuesta))<br>print(type(status))<br>print(num)<br>if num == 200:<br> print(‘All good with this API’)<br>else:<br> print(‘It seems that the server is down’)</blockquote><p># ===Output====</p><blockquote>&lt;class ‘requests.models.Response’&gt;<br>&lt;class ‘dict’&gt;<br>200<br>All good with this API</blockquote><p>Next post I will try to dissect the Output above and move to the next level with APIs and Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21f54507d2a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>