Sitemap
Jose Apablaza

Jose Apablaza

#1 My python journey

3 min readSep 21, 2018

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

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

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 ;)

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.

Get Jose Apablaza’s stories in your inbox

Join Medium for free to get updates from this writer.

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.

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 ;)

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.

# ===CODE====

import requests
url_test = ‘https://api.github.com'
respuesta = requests.get(url_test)
num = respuesta.status_code
status = respuesta.json()
print(type(respuesta))
print(type(status))
print(num)
if num == 200:
print(‘All good with this API’)
else:
print(‘It seems that the server is down’)

# ===Output====

<class ‘requests.models.Response’>
<class ‘dict’>
200
All good with this API

Next post I will try to dissect the Output above and move to the next level with APIs and Python.

--

--