Cours de Développment Vertopal PDF
Document Details
Uploaded by DesirableStanza
Tags
Summary
Ce document est un cours de programmation Python. Il présente les concepts de base comme les variables, les types de données et les opérations. Des exercices pratiques sont inclus. Les exercices aident les lecteurs à appliquer les concepts et à améliorer leurs compétences en Python.
Full Transcript
Les variables variable = "valeur" print(variable) valeur var_utilisateur = input("Entrez une valeur : ") print(var_utilisateur) Entrez une valeur : hello hello Types de données variable = "valeur" nb_eleves = 32 progression = 0.01 # Numérique, float nom_cours = "Atelier dév" # Chaîne de caractè...
Les variables variable = "valeur" print(variable) valeur var_utilisateur = input("Entrez une valeur : ") print(var_utilisateur) Entrez une valeur : hello hello Types de données variable = "valeur" nb_eleves = 32 progression = 0.01 # Numérique, float nom_cours = "Atelier dév" # Chaîne de caractères, string cours_termine = False # Booléen, bool print(cours_termine) False Les opérations addition = 1 + 2 soustraction = 1 - 2 multiplication = 1 * 2 division = 1 / 2 modulo = 3 % 2 print(addition) print(modulo) 3 1 debut_phrase = "j'adore le " fin_phrase = "python" phrase = debut_phrase + fin_phrase print(phrase) phrase = debut_phrase + fin_phrase + " !!!" print(phrase) j'adore le python j'adore le python !!! Exercice Demandez à l'utilisateur quel âge a t'il, multipliez par 2 son âge, puis, affichez "Le double de votre age est de..." Si vous obtenez une erreur, copiez la sur Google et vous trouverez sûrement la réponse var_utilisateur = input("Entrez une valeur : ") age = int(var_utilisateur) mult_age = age * 2 print("Le double...") print(mult_age) print("Le double..." + str(mult_age)) Entrez une valeur : 12 Le double... 24 Le double...24 Les variables ma_liste = [1, 2, 3, 4, 5] ma_liste = ["a", "b", "c", "d", "e"] ma_liste_vide = [] print(ma_liste) a print(ma_liste) # a ma_liste = "uwu" print(ma_liste) # ["a", "b", "uwu", "d", "e"] a ['a', 'b', 'uwu', 'd', 'e'] ma_liste = ["Pierre", "Paul", "Jacques"] ma_liste.append("Marie") print(ma_liste) # ["Pierre", "Paul", "Jacques", « Marie »] ma_liste.sort() print(ma_liste) # ["Jacques", "Marie", "Paul", "Pierre"] ma_liste.remove("Paul") print(ma_liste) # ["Pierre", "Jacques", « Marie"] ['Pierre', 'Paul', 'Jacques', 'Marie'] ['Jacques', 'Marie', 'Paul', 'Pierre'] ['Jacques', 'Marie', 'Pierre'] Exercice Créez une liste nommée fruits qui contient les éléments suivants : "Pomme", "Bannnane", "Cerise", "Orange". Affichez le premier et le dernier élément de la liste Ajoutez "Raisin" à la fin de la liste Corrigez le mot "Bannnane" Insérez "Fraise" à la deuxième position de la liste Retirez "Banane" de la liste Triez la liste en ordre alphabétique Affichez la liste S'il vous est demandé quelque chose que vous ne savez pas faire et que vous ne l'avez pas vu non plus en cours, tapez ce que vous souhaitez faire (si possible en anglais), sur Google, suivi du mot-clé "Python" Les variables mon_dico = {"prenom": "Pierre", "nom": "Dupont"} print(mon_dico["prenom"]) # "Pierre" Pierre mon_dico["age"] = 18 print(mon_dico) # {"prenom": "Pierre", "nom": "Dupont", "age": 18} mon_dico["age"] = 19 print(mon_dico) # {"prenom": "Pierre", "nom": "Dupont", "age": 19} del mon_dico["age"] print(mon_dico) # {"prenom": "Pierre", "nom": "Dupont"} {'prenom': 'Pierre', 'nom': 'Dupont', 'age': 18} {'prenom': 'Pierre', 'nom': 'Dupont', 'age': 19} {'prenom': 'Pierre', 'nom': 'Dupont'} Exercice Créez un dictionnaire vide Demandez à l'utilisateur de renseigner un nom puis une note Ajoutez ces variables dans un dictionnaire contenant les clés "nom" et "note" Ajoutez ensuite un point à la note rentrée Les structures conditionnelles mon_age = 19 if mon_age > 18: print("Vous êtes majeur") Vous êtes majeur mon_age = 19 if mon_age > 18: print("Vous êtes majeur") else: print("Vous êtes mineur") Vous êtes majeur mon_age = 77 if mon_age > 18: print("Vous êtes majeur") elif mon_age > 32: print("Vous êtes trop agé") elif mon_age < 13: print("Vous êtes trop jeune") else: print("Vous êtes mineur") Vous êtes majeur Les opérateurs if not cours_termine: print("Le cours n'est pas terminé") if mon_age > 18 and mon_age < 32: print("Vous êtes majeur et jeune") mon_os = "MacOS" if mon_os == "Windows" or mon_os == "MacOS": print("Vous utilisez Windows ou MacOS") Le cours n'est pas terminé Vous utilisez Windows ou MacOS # a == 1 # strictement égal à # a != 1 # différent de # a > 1 # strictement supérieur à # a >= 1 # supérieur ou égal à # a < 1 # strictement inférieur à # a 13) and (mon_age < 18): print("ado") # on vérifie si pair ou impair if (mon_age % 2 == 0): # % = reste de la division par ; donc 13%2 == 1, 12%2 == 0 print("pair") else: print("impair") else: print("adulte") Entrez votre âge :15 ado impair Les structures itératives for i in range(5): print(i) while not cours_termine: print("Le cours n'est pas terminé") cours_termine = True 0 1 2 3 4 Le cours n'est pas terminé ma_liste = ["Pierre", "Paul", "Jacques"] for eleve in ma_liste: print(eleve) Pierre Paul Jacques Exercice Créez une liste contenant les nombres de 1 à 10 Créez une liste vide Créez une boucle qui permet d'afficher chaque nombre de la première liste Parcourez la première liste et ajoutez tous les nombres pairs à la liste vide créée Demandez à l'utilisateur de renseigner un nombre de son choix Créez une boucle tant que qui vérifie si le nombre est supérieur ou égal à 9 et inférieur à 19 ; puis, demandez à nouveau à l'utilisateur de saisir un nombre jusqu'à que la condition soit vérifiée Les fonctions def dire_bonjour(nom): print("Bonjour " + nom + " !") dire_bonjour("Pierre") # Bonjour Pierre ! def ajoute(nb): return nb + 1 nouveau_nb = ajoute(2) print(nouveau_nb) Bonjour Pierre ! 3 Exercice Créez une fonction qui prend en entrée une liste de nombres, puis, qui va venir retourner la moyenne de cette liste Créez une liste de notes : 10, 12, 18, 8, 7 ; puis utilisez la fonction codée pour récupérer puis afficher la moyenne Les librairies import random nombre = random.randint(0, 100) print(nombre) 73 !pip install fuzzywuzzy from fuzzywuzzy import fuzz Collecting fuzzywuzzy Downloading fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB) Installing collected packages: fuzzywuzzy Successfully installed fuzzywuzzy-0.18.0 /usr/local/lib/python3.10/dist-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python- Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') ratio = fuzz.ratio("vitalik buterin", "vitalik butherin") print(ratio) 97 Exercice Importez la librairie random Générez un nombre aléatoire Demandez à l'utilisateur de rentrer un nombre Indiquez à l'utilisateur si le nombre qu'il a entré est plus petit, plus grand, ou égal au nombre aléatoire Indiquez également la distance du nombre entré par rapport au nombre aléatoire (ex : 8 est à 4 de distance de 12) \En utilisant la librairie https://pypi.org/project/Faker/, créez, puis affichez, une fausse identité (nom, prénom, adresse, etc.) Exploitez des sources de données Télechargez le fichier csv https://altab.fr/partage/cours_btc.csv puis téleversez le dans le Colab import csv with open('cours_btc.csv') as csv_file: csv_reader = csv.reader(csv_file, delimiter=';') line_count = 0 for row in csv_reader: print(row) ['symbole', 'date', 'ouverture', 'haut', 'bas', 'cloture', 'volume'] ['BTCUSD', '01/09/2023', '25934,021', '26125,869', '25362,609', '25800,725', '0'] ['BTCUSD', '04/09/2023', '25968,17', '26081,525', '25657,025', '25812,416', '0'] ['BTCUSD', '05/09/2023', '25814,957', '25858,375', '25589,988', '25779,982', '0'] ['BTCUSD', '06/09/2023', '25783,932', '25953,016', '25404,359', '25753,236', '0'] ['BTCUSD', '07/09/2023', '25748,313', '26409,303', '25608,201', '26240,195', '0'] ['BTCUSD', '08/09/2023', '26245,209', '26414,006', '25677,48', '25905,654', '0'] ['BTCUSD', '11/09/2023', '25831,715', '25883,947', '24930,297', '25162,654', '0'] ['BTCUSD', '12/09/2023', '25160,658', '26451,939', '25133,078', '25833,344', '0'] ['BTCUSD', '13/09/2023', '25837,555', '26376,113', '25781,123', '26228,324', '0'] ['BTCUSD', '14/09/2023', '26228,277', '26774,623', '26171,451', '26539,674', '0'] ['BTCUSD', '15/09/2023', '26533,818', '26840,498', '26240,701', '26608,693', '0'] ['BTCUSD', '18/09/2023', '26532,994', '27414,734', '26415,516', '26754,281', '0'] ['BTCUSD', '19/09/2023', '26760,852', '27488,764', '26681,605', '27211,117', '0'] ['BTCUSD', '20/09/2023', '27210,229', '27379,506', '26864,082', '27132,008', '0'] ['BTCUSD', '21/09/2023', '27129,84', '27152,939', '26389,301', '26567,633', '0'] ['BTCUSD', '22/09/2023', '26564,057', '26726,078', '26495,533', '26579,568', '0'] ['BTCUSD', '25/09/2023', '26253,775', '26421,508', '26011,469', '26298,48', '0'] ['BTCUSD', '26/09/2023', '26294,758', '26389,885', '26090,713', '26217,25', '0'] ['BTCUSD', '27/09/2023', '26209,498', '26817,842', '26111,465', '26352,717', '0'] ['BTCUSD', '28/09/2023', '26355,813', '27259,5', '26327,322', '27021,547', '0'] ['BTCUSD', '29/09/2023', '27024,842', '27225,938', '26721,764', '26911,721', '0'] Télechargez le fichier csv https://altab.fr/partage/bourse.json puis téleversez le dans le Colab import json with open('bourse.json', 'r') as fichier_json: donnees_json = json.load(fichier_json) print(donnees_json) [{'company': '3M', 'description': '3M, based in Minnesota, may be best known for its Scotch tape and Post-It Notes, but it also produces sand paper, adhesives, medical products, computer screen filters, food safety items, stationery products and many products used in automotive, marine, and aircraft industries.', 'initial_price': 44.28, 'price_2002': 56.27, 'price_2007': 95.85, 'symbol': 'MMM'}, {'company': 'Amazon.com', 'description': 'Amazon.com, Inc. is an online retailer in North America and internationally. The company serves consumers through its retail Web sites and focuses on selection, price, and convenience. It also offers programs that enable sellers to sell their products on its Web sites, and their own branded Web sites. In addition, the company serves developer customers through Amazon Web Services, which provides access to technology infrastructure that developers can use to enable virtually various type of business. Further, it manufactures and sells the Kindle e- reader. Founded in 1994 and headquartered in Seattle, Washington.', 'initial_price': 89.38, 'price_2002': 17.01, 'price_2007': 93.43, 'symbol': 'AMZN'}, {'company': 'Campbell Soup', 'description': 'Campbell Soup is a worldwide food company, offering condensed and ready-to-serve soups; broth, stocks, and canned poultry; pasta sauces; Mexican sauces; canned pastas, gravies, and beans; juices and beverages; and tomato juices. Its customers include retail food chains, mass discounters, mass merchandisers, club stores, convenience stores, drug stores and other retail, and commercial and non- commercial establishments. Campbell Soup Company was founded in 1869 and is headquartered in Camden, New Jersey.', 'initial_price': 37.0, 'price_2002': 22.27, 'price_2007': 36.4, 'symbol': 'CPB'}, {'company': 'Disney', 'description': 'The Walt Disney Company, founded in 1923, is a worldwide entertainment company, with movies, cable networks, radio networks, movie production, musical recordings and live stage plays. Disney also operates Walt Disney World in Florida and Disneyland in California, Disney Cruise Line, and international Disney resorts. Disney owns countless licenses and literary properties and publishes books and magazines.', 'initial_price': 40.68, 'price_2002': 15.24, 'price_2007': 35.47, 'symbol': 'DIS'}, {'company': 'Dow Chemical', 'description': 'The Dow Chemical Company manufactures raw materials that go into consumer products and services. These materials include food and pharmaceutical ingredients, electronic displays, semiconductor packaging, water purification, insulation, adhesives, pest control, polyurethane, polystyrene (goes into plastics), and crude-oil based raw materials. Dow was founded in 1897 and is based in Midland, Michigan.', 'initial_price': 38.83, 'price_2002': 27.65, 'price_2007': 44.67, 'symbol': 'DOW'}, {'company': 'Exxon Mobil', 'description': 'Exxon Mobil engages in the exploration and production of crude oil and natural gas, and manufacture of petroleum products. The company manufactures commodity petrochemicals. The company has operations in the United States, Canada/South America, Europe, Africa, Asia, and Australia/Oceania. Exxon Mobil Corporation was founded in1870 and is based in Irving, Texas.', 'initial_price': 39.0, 'price_2002': 32.82, 'price_2007': 91.36, 'symbol': 'XOM'}, {'company': 'Ford', 'description': 'Ford Motor Co. develops, manufactures, sells and services vehicles and parts worldwide. Ford sells cars and trucks primarily under the Ford and Lincoln brands. It sells to consumers (through retail dealers) and to rental car companies, leasing companies, and governments. Ford also provides maintenance and repair services. Ford also offers financing to vehicle purchasers. Ford was founded in 1903 and is based in Dearborn, Michigan.', 'initial_price': 27.34, 'price_2002': 9.63, 'price_2007': 8.37, 'symbol': 'F'}, {'company': 'The Gap', 'description': 'The Gap, Inc. sells retail clothing, accessories and personal care products globally under the brand names Gap, Old Navy, Banana Republic, Piperlime, Athleta and Intermix. Products include sports apparel, casual clothing, sleepwear, footwear and infants’ and children’s clothing. The company has company-owned stores as well as franchise stores, online stores and catalogs. The Gap was founded in 1969 and is headquartered in San Francisco, California.', 'initial_price': 46.0, 'price_2002': 11.56, 'price_2007': 18.9, 'symbol': 'GPS'}, {'company': 'General Mills', 'description': 'General Mills manufactures and sells consumer foods worldwide. Products include cereals, frozen vegetables, dough, dessert and baking mixes, frozen pizzas, grains, fruits, ice creams and organic products. It sells to grocery stores as well as commercial food service distributors, restaurants and convenience stores. General Mills was founded in 1928 and is based in Minneapolis, Minnesota.', 'initial_price': 15.59, 'price_2002': 22.1, 'price_2007': 28.76, 'symbol': 'GIS'}, {'company': 'Hewlett Packard', 'description': 'Hewlett-Packard designs and sells products, technologies, software and IT services to consumers, businesses, government and education sectors worldwide. HP offers storage and server products, PCs, calculators, printers, scanners, network infrastructure products, video products (under the Halo brand), and Palm smartphones. HP was founded in 1939 and is headquartered in Palo Alto, California.', 'initial_price': 66.28, 'price_2002': 12.03, 'price_2007': 50.9, 'symbol': 'HPQ'}, {'company': 'IBM', 'description': 'IBM is an international IT company. IBM offers infrastructure and technology services, software for business integration and information management, data warehousing, identity management software, data security, Lotus software for collaboration, messaging and social networking, business intelligence software, servers, and storage systems. IBM was founded in 1910 and is based in Armonk, New York.', 'initial_price': 118.37, 'price_2002': 60.36, 'price_2007': 116.3, 'symbol': 'IBM'}, {'company': 'Johnson & Johnson', 'description': 'Johnson & Johnson develops and manufactures health care products for sale worldwide. J&J products include the brands Johnson’s, Aveeno, Clean & Clear, Neutrogena, Lubriderm, Listerine, Reach, BandAid, Tylenol, Sudafed, Motrin and more. J&J products are used in skin care, baby care, and therapeutic medical care, including inflammatory diseases, arthritis, psoriasis, HIV/AIDS, schizophrenia, spinal care, and diabetes. The company was founded in 1886 and is based in New Brunswick, New Jersey.', 'initial_price': 35.13, 'price_2002': 52.3, 'price_2007': 66.25, 'symbol': 'JNJ'}, {'company': 'Microsoft', 'description': 'Microsoft develops, manufactures, licenses, and supports a range of software products and services for various computing devices worldwide. Products include Windows OS, Windows Live and Internet Explorer. Microsoft also provides training and tech support, online products such as Bing and MSN portals, and software including Microsoft Office, Microsoft SharePoint, Xbox 360, PC software games, online games, and Zune digital music. Microsoft was founded in 1975 and is headquartered in Redmond, Washington.', 'initial_price': 55.72, 'price_2002': 22.62, 'price_2007': 29.84, 'symbol': 'MSFT'}, {'company': 'Monsanto', 'description': 'Monsanto provides agricultural products for farmers in the United States and internationally. It operates in two segments, Seeds and Genomics, and Agricultural Productivity. The Seeds and Genomics segment produces corn, soybean, canola, and cotton seeds, as well as vegetable seeds, including tomato, pepper, eggplant, melon, cucumber, pumpkin, squash, beans, broccoli, onions, and lettuce seeds. The Agricultural Productivity segment offers herbicides for agricultural, industrial, and residential use. Brands include Roundup, Roundup Ready, YieldGard, and Dekalb. Monsanto focuses on high-yielding crops and crops that tolerate adverse conditions. The current company was founded in 2000 (name dates to 1901) and is based in St. Louis, Missouri.', 'initial_price': 11.47, 'price_2002': 7.2, 'price_2007': 86.93, 'symbol': 'MO'}, {'company': 'PepsiCo', 'description': 'PepsiCo, Inc. manufactures, markets, and sells various foods, snacks, and carbonated and non-carbonated beverages worldwide. Pepsi products include Pepsi beverages, Mountain Dew, Gatorade, Aquafina and Tropicana beverages as well as Frito-Lay snacks, Ruffles, Doritos, Tostitos, Rold Gold pretzels, Sun Chips, Crackerjack, Quaker Oats, Aunt Jemima mixes, Life Cereal, and Rice-a-Roni. The company was founded in 1898 and is headquartered in Purchase, New York.', 'initial_price': 34.13, 'price_2002': 36.69, 'price_2007': 73.74, 'symbol': 'PEP'}, {'company': 'Starbucks', 'description': 'Starbucks Corp. provides specialty coffee and tea beverages, packaged and ground coffee beans, single-serve products, juices and food offerings worldwide. Starbucks sells licensed products through grocery stores and other food service outlets as well as running company stores that sell coffees, pastries, breakfast sandwiches and lunch items. Starbucks sells products under the brand names Starbucks, Teavana, Tazo, Seattle’s Best, La Blange and Verismo. Starbucks was founded in 1985 and is based in Seattle, Washington.', 'initial_price': 6.23, 'price_2002': 10.5, 'price_2007': 26.84, 'symbol': 'SBUX'}, {'company': 'Texas Instruments', 'description': 'Texas Instruments designs and sells semiconductors to electronics designers and manufacturers worldwide. The company has four segments: Analog, Embedded Processing, Wireless and Other. The Other segment provides handheld graphing and scientific calculators and licenses technologies to other electronic companies. The company was founded in 1938 and is headquartered in Dallas, Texas.', 'initial_price': 53.88, 'price_2002': 15.58, 'price_2007': 36.54, 'symbol': 'TXN'}, {'company': 'Time Warner', 'description': 'Time Warner is a media and entertainment company in the United States and internationally. It operates in three segments: Networks, Filmed Entertainment, and Publishing. Networks provides HBO, Cinemax, TNT, TBS, and CNN. Filmed Entertainment produces movies, TV shows, animation, videogames, and home video products. Publishing includes magazines (People, Sports Illustrated, Time), books, and websites. The company was founded in 1985 and is based in New York, New York.', 'initial_price': 221.25, 'price_2002': 36.36, 'price_2007': 57.18, 'symbol': 'TWX'}, {'company': 'United Health', 'description': 'UnitedHealth Group provides healthcare services in the United States. Its Health Benefits segment offers consumer-oriented health benefit plans and services to national employers, public sector employers, mid-sized employers, small businesses, and individuals; and non- employer based insurance options for purchase by individuals. It also provides health services to individuals aged 50 and older through a network of 730,000 physicians and other professionals and 5,300 hospitals. The company also provides financial products, data management services, and pharmacy management. The company was founded in 1974 and is based in Minnetonka, Minnesota.', 'initial_price': 7.66, 'price_2002': 21.85, 'price_2007': 47.7, 'symbol': 'UNH'}, {'company': 'Walmart', 'description': 'Walmart operates retail stores, warehouse clubs, online stores and small markets worldwide. Walmart stores sell a huge variety of items, from food and clothing to electronics, hardware, appliances, automotive accessories and pet supplies. Some stores include banks, restaurants and gas stations. Walmart was founded in 1945 and is headquartered in Bentonville, Arkansas. ', 'initial_price': 56.5, 'price_2002': 50.51, 'price_2007': 47.53, 'symbol': 'WMT'}, {'company': 'Whirlpool', 'description': 'Whirlpool manufactures and sells home appliances worldwide. Its principal products include laundry appliances, refrigerators, cooking appliances, dishwashers, mixers, and other small household appliances. The company also produces hermetic compressors for refrigeration systems. It markets and distributes its products under various brand names, which include Whirlpool, Maytag, KitchenAid, Jenn-Air, Roper, Estate, Admiral, Magic Chef, and Amana. The company was founded in 1906 and is based in Benton Harbor, Michigan.', 'initial_price': 58.25, 'price_2002': 46.82, 'price_2007': 94.29, 'symbol': 'WHR'}, {'company': 'Xerox', 'description': 'Xerox Corporation engages in the development, manufacture, marketing, service, and finance of document equipment, software, solutions, and services worldwide. The company operates in three segments: Technology, Services, and Other. The Technology segment provides multifunction printers, copiers, digital printing presses, light production devices, and desktop monochrome and color printers for office users. Other services include human resources, IT, card fare payment solutions, network outsourcing, commercial printing and electronic presentation systems. Xerox Corporation was founded in 1906 and is headquartered in Norwalk, Connecticut.', 'initial_price': 20.87, 'price_2002': 5.26, 'price_2007': 17.54, 'symbol': 'XRX'}] import requests from pprint import pprint url = ("https://recherche-entreprises.api.gouv.fr/search" "?categorie_entreprise=PME,ETI" "&departement=83&per_page=1") donnees = requests.get(url).json() pprint(donnees) {'page': 2, 'per_page': 1, 'results': [{'activite_principale': '93.13Z', 'annee_categorie_entreprise': '2022', 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': None, 'categorie_entreprise': 'ETI', 'complements': {'collectivite_territoriale': None, 'convention_collective_renseignee': True, 'egapro_renseignee': True, 'est_association': False, 'est_bio': False, 'est_entrepreneur_individuel': False, 'est_entrepreneur_spectacle': False, 'est_ess': False, 'est_finess': False, 'est_organisme_formation': False, 'est_qualiopi': False, 'est_rge': False, 'est_service_public': False, 'est_siae': False, 'est_societe_mission': False, 'est_uai': False, 'identifiant_association': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'statut_entrepreneur_spectacle': None, 'type_siae': None}, 'date_creation': '2013-10-23', 'date_fermeture': None, 'date_mise_a_jour': '2024-10-13T16:19:08', 'date_mise_a_jour_insee': '2024-10-12T05:13:04.238', 'date_mise_a_jour_rne': '2024-05-19T16:49:33', 'dirigeants': [{'denomination': 'ERNST & YOUNG AUDIT', 'qualite': 'Commissaire aux comptes titulaire', 'siren': '344366315', 'type_dirigeant': 'personne morale'}, {'denomination': 'AUDITEX', 'qualite': 'Commissaire aux comptes suppléant', 'siren': '377652938', 'type_dirigeant': 'personne morale'}, {'denomination': 'BASIC FIT INTERNATIONAL BV', 'qualite': 'Président de SAS', 'siren': None, 'type_dirigeant': 'personne morale'}], 'etat_administratif': 'A', 'finances': {'2022': {'ca': 396898946, 'resultat_net': 6745363}}, 'matching_etablissements': [{'activite_principale': '93.13Z', 'adresse': '75 AVENUE DE ' "L'UNIVERSITE 83160 LA " 'VALETTE-DU- VAR', 'ancien_siege': False, 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'code_postal': '83160', 'commune': '83144', 'date_creation': '2017-07- 31', 'date_debut_activite': '2017-08-01', 'date_fermeture': None, 'epci': '248300543', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83144_0895_00075', 'latitude': '43.137099', 'libelle_commune': 'LA ' 'VALETTE-DU-VAR', 'liste_enseignes': ['BASIC FIT II'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '6.003711', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301101441', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '02'}, {'activite_principale': '93.13Z', 'adresse': '194 AVENUE COLONEL ' 'FABIEN 83000 TOULON', 'ancien_siege': False, 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'code_postal': '83000', 'commune': '83137', 'date_creation': '2017-07- 31', 'date_debut_activite': '2017-08-01', 'date_fermeture': None, 'epci': '248300543', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83137_1740', 'latitude': '43.122697', 'libelle_commune': 'TOULON', 'liste_enseignes': ['BASIC FIT II'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '5.940193', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301101490', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '02'}, {'activite_principale': '93.13Z', 'adresse': '573 AVENUE MARECHAL DE ' 'LATTRE DE TASSIGNY ' '83600 FREJUS', 'ancien_siege': False, 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'code_postal': '83600', 'commune': '83061', 'date_creation': '2019-04- 15', 'date_debut_activite': '2019-07-01', 'date_fermeture': None, 'epci': '200035319', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83061_1415_00573', 'latitude': '43.432348', 'libelle_commune': 'FREJUS', 'liste_enseignes': ['BASIC FIT II'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '6.749758', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301103256', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '02'}, {'activite_principale': '93.13Z', 'adresse': '344 AV MARCEL PAUL ' '83500 LA SEYNE SUR MER', 'ancien_siege': False, 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'code_postal': '83500', 'commune': '83126', 'date_creation': '2019-07- 01', 'date_debut_activite': '2019-07-01', 'date_fermeture': None, 'epci': '248300543', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83126_devfi7', 'latitude': '43.109054', 'libelle_commune': 'LA SEYNE SUR ' 'MER', 'liste_enseignes': ['BASIC FIT II'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '5.854248', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301103454', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '02'}, {'activite_principale': '93.13Z', 'adresse': 'BOULEVARD COLONEL ' 'DESSERT 83480 ' 'PUGET-SUR- ARGENS', 'ancien_siege': False, 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'code_postal': '83480', 'commune': '83099', 'date_creation': '2020-03- 02', 'date_debut_activite': '2020-06-22', 'date_fermeture': None, 'epci': '200035319', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83099_0143', 'latitude': '43.453198', 'libelle_commune': 'PUGET- SUR-ARGENS', 'liste_enseignes': ['BASIC FIT'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '6.692173', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301104403', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '03'}, {'activite_principale': '93.13Z', 'adresse': 'ZAC DE FRAY CHEMIN DE ' 'LA FONTAINE DE RICAUD ' '83136 ROCBARON', 'ancien_siege': False, 'annee_tranche_effectif_salarie': None, 'caractere_employeur': 'O', 'code_postal': '83136', 'commune': '83106', 'date_creation': '2023-06- 12', 'date_debut_activite': '2023-09-18', 'date_fermeture': None, 'epci': '200068104', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83106_0091', 'latitude': '43.318058', 'libelle_commune': 'ROCBARON', 'liste_enseignes': ['BASIC FIT'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '6.077179', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301107844', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': None}, {'activite_principale': '93.13Z', 'adresse': 'RUE DU MURIER 83000 ' 'TOULON', 'ancien_siege': False, 'annee_tranche_effectif_salarie': None, 'caractere_employeur': 'O', 'code_postal': '83000', 'commune': '83137', 'date_creation': '2023-09- 11', 'date_debut_activite': '2024-01-22', 'date_fermeture': None, 'epci': '248300543', 'est_siege': False, 'etat_administratif': 'A', 'geo_id': '83137_5360', 'latitude': '43.12053', 'libelle_commune': 'TOULON', 'liste_enseignes': ['BASIC FIT'], 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '5.935141', 'nom_commercial': 'BASIC FIT II', 'region': '93', 'siret': '79823301108065', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': None}], 'nature_juridique': '5710', 'nom_complet': 'BASIC-FIT FRANCE', 'nom_raison_sociale': 'BASIC-FIT FRANCE', 'nombre_etablissements': 889, 'nombre_etablissements_ouverts': 880, 'section_activite_principale': 'R', 'siege': {'activite_principale': '93.11Z', 'activite_principale_registre_metier': None, 'adresse': '4EME ETAGE HALL C 40 RUE DE LA VAGUE 59491 ' 'VILLENEUVE D ASCQ', 'annee_tranche_effectif_salarie': '2022', 'caractere_employeur': 'O', 'cedex': None, 'code_pays_etranger': None, 'code_postal': '59491', 'commune': '59009', 'complement_adresse': '4EME ETAGE HALL C', 'coordonnees': '50.64345,3.149551', 'date_creation': '2015-12-31', 'date_debut_activite': '2021-04-19', 'date_fermeture': None, 'date_mise_a_jour': None, 'date_mise_a_jour_insee': '2024-05- 14T05:10:51', 'departement': '59', 'distribution_speciale': None, 'epci': '200093201', 'est_siege': True, 'etat_administratif': 'A', 'geo_adresse': '40 Rue de la Coutume 59650 ' "Villeneuve-d'Ascq", 'geo_id': '59009_3850_00040', 'indice_repetition': None, 'latitude': '50.64345', 'libelle_cedex': None, 'libelle_commune': 'VILLENEUVE D ASCQ', 'libelle_commune_etranger': None, 'libelle_pays_etranger': None, 'libelle_voie': 'DE LA VAGUE', 'liste_enseignes': None, 'liste_finess': None, 'liste_id_bio': None, 'liste_id_organisme_formation': None, 'liste_idcc': ['2511'], 'liste_rge': None, 'liste_uai': None, 'longitude': '3.149551', 'nom_commercial': None, 'numero_voie': '40', 'region': '32', 'siret': '79823301100492', 'statut_diffusion_etablissement': 'O', 'tranche_effectif_salarie': '22', 'type_voie': 'RUE'}, 'sigle': None, 'siren': '798233011', 'statut_diffusion': 'O', 'tranche_effectif_salarie': '51'}], 'total_pages': 10000, 'total_results': 10000} La documentation est disponible ici : https://api.gouv.fr/documentation/api-recherche- entreprises Exercice En vous basant sur l'exemple précédent pour les fichiers CSV, trouvez le jour où le cours à la cloture est le plus bas, puis affichez le Vous rencontrerez plusieurs problèmes, voici quelques indices : basez vous et développez le "line_count" utilisez Google [ce que je veux faire] + "Python" En vous basant sur l'exemple précédent pour les fichiers JSON, trouvez l'action qui a vu son cours le plus baisser entre 2002 et 2007 et affichez son symbole et sa variation En vous basant sur l'exemple exploitant une API, parcourez la documentation et : affichez, une par une, les entreprises dont l'activité principale est le "Conseil en systèmes et logiciels informatiques" affichez ensuite, une par une, les code postaux des sites de l'entreprise qui correspondent à la recherche ("matching_etablissements") Pensez à explorer les résultats de la requête petit à petit avec des prints, print un ensemble, le parcourir ensuite avec une boucle, etc. Attention, il y a un système de pagination à prendre en compte ! Pour aller plus loin, rendez-vous sur https://datalab.sspcloud.fr/, vous pouvez créer un compte à l'aide de votre adresse mél universitaire. Vous pouvez installer en un clic un serveur dédié aux notebooks, des bases de données (particulièrement Elastic pour du noSQL ou PostgreSQL pour du SQL) et surtout des systèmes de visualisation (Metabase, Superset ou Kibana installé avec Elastic). Vous pouvez explorer ces solutions de votre côté ou suivre les tutoriels proposés sur la même plateforme. Si vous décidez de partir de votre côté, travaillez sur les API (par exemple, celle du gouvernement vue précédemment), exploitez les données, téleversez-les vers une base de donnée puis créez des visualisations.