Microservice that fetches data from REST repository endpoints on Github I have code in Python 3 where I fetch data from the GitHub API, and I want some advice on the architecture of this code.
import urllib.request, urllib.parse, urllib.error
import json
import sys
from collections import Counter
from datetime import datetime, timedelta, date
from tabulate import tabulate
from LanguagesRepoCounter import LanguagesCounter
from RepoListLanguages import RepoListLanguages


#getting the date of one mounth ago from today
One_Mouth_ago_date = datetime.date(datetime.now()) - timedelta(days=30)

url = 'https://api.github.com/search/repositories?q=created:%3E'+One_Mouth_ago_date.isoformat()+'&amp;sort=stars&amp;order=desc&amp;page=1&amp;per_page=100'

data_connection_request  = urllib.request.urlopen(url)

unicoded_data = data_connection_request.read().decode()

try:
    json_data = json.loads(unicoded_data)
except:
    json_data = None
# testing retrieaved data
if not json_data or json_data[&quot;total_count&quot;]&lt;1:
    print(json_data)
    sys.exit('######## Failure To Retrieve ########')



#Counting the number of repo using every language
Lang_Dic_Count = LanguagesCounter(json_data)

# Getting the list of repo using every language
DicDataList = RepoListLanguages(json_data, Lang_Dic_Count)

# Displaye the repo's urls for every language
for key in DicDataList:
    print(key, ' language used in')
    for i in range(len(DicDataList[key])):
        print(&quot;                           &quot;, DicDataList[key][i])


# Displaye the number of repos using every language in a table
table = []
for key in Lang_Dic_Count:
    under_table=[]
    under_table.append(key)
    under_table.append(Lang_Dic_Count[key])
    table.append(under_table)
print(tabulate(table, headers=('Language', 'number of Repo using it'), tablefmt=&quot;grid&quot;))

and the first function is :
def LanguagesCounter(Data):
    ''' Count how many times every programming language is used in the 100 most starred repos created in the last 30 days given in a parameter as json object, return a dict with languages as a keys and number of repo using this language as a value
    '''
    Languages_liste = []
    for i in range(len(Data[&quot;items&quot;])):
        Languages_liste.append(Data[&quot;items&quot;][i][&quot;language&quot;])
    Lang_Dic_Count ={i:Languages_liste.count(i) for i in Languages_liste}
    return Lang_Dic_Count

the third function is:
def RepoListLanguages(Data, list):
    '''
    return the list of repositories from Data parameter for every programming language in the list parameter as a dictionary with the programming language as key and a list of repositories as value
    '''
    languagesRepo = {}
    for key in list:
        languagesRepo[key]= []
        for repo in range(len(Data[&quot;items&quot;])):
            if (key == Data[&quot;items&quot;][repo][&quot;language&quot;]):
                languagesRepo[key].append(Data[&quot;items&quot;][repo][&quot;html_url&quot;])

    return languagesRepo

The code fetches the most starred repos from GitHub API that were created in the last 30 days, counts how many repos use every programming language, and lists the repo links for every language.
The two functions you broke out (LanguagesCounter, and RepoListLanguages) both could be simplified significantly using list comprehension. You seem to be thinking in terms of loops and appending to lists instead of generating them in one go which is more pythonic. Add in the Counter function from collections and RepoListLanguages becomes a relatively trivial one liner.
Those are both at the top of the rewrite below so you can see them in action.
Beyond that, the only real changes I made were using lower_camel_case per pep8 guidelines, changing a few variable names for clarity, and pulling the messy code at the bottom into functions. Functions and clear structure make reading the code much easier for anyone who needs to even if they don't change how it works.
import urllib.request, urllib.parse, urllib.error
import json
import sys
from collections import Counter
from datetime import datetime, timedelta, date
from tabulate import tabulate

from collections import Counter


def language_counter(data):
     return Counter(repo[&quot;language&quot;] for repo in data[&quot;items&quot;])


def repo_languages(data, list):
    return {
        key: [
            repo[&quot;html_url&quot;] for repo in data[&quot;items&quot;]
            if key == repo[&quot;language&quot;]
        ]
        for key in list
    }


def new_url():
    last_month = datetime.date(datetime.now()) - timedelta(days=30)

    return 'https://api.github.com/search/repositories?q=created:%3E' + last_month.isoformat(
    ) + '&amp;sort=stars&amp;order=desc&amp;page=1&amp;per_page=100'


def get_data(url):
    data_connection_request = urllib.request.urlopen(url)

    unicoded_data = data_connection_request.read().decode()

    try:
            json_data = json.loads(unicoded_data)
    except:
            json_data = None

    return json_data


def validate_or_quit(json_data):
    if not json_data or json_data[&quot;total_count&quot;] &lt; 1:
        print(json_data)
        sys.exit('######## Failure To Retrieve ########')


def pretty_print_list(data):
    for key in data:
        print(key, ' language used in')
        for _, item in enumerate(data[key]):
            print(&quot; &quot; * 27, item)


def pretty_print_dict(data):
    data_list = [[key, value] for key, value in data.items()]
    print(
            tabulate(
                    data_list,
                    headers=('Language', 'number of Repo using it'),
                    tablefmt=&quot;grid&quot;)
    )


if __name__ == &quot;__main__&quot;:
    json_data = get_data(new_url())
    validate_or_quit(json_data)

    lang_counts = language_counter(json_data)
    repo_langs = repo_languages(json_data, lang_counts)

    pretty_print_list(repo_langs)
    pretty_print_dict(lang_counts)