HG-map
GIS, dev & data

Menu

  • Blog
  • Tutos
  • Astuces
  • À propos de moi
  • Réalisations
  • Contact
Tomcat Open Street Map NodeJS Open Dbase Joomla DKIM Geoserver Géomatique Regex Linux Newsletter Web-service Digital marketing MySQL API Google Map openpyxl Multi-sites KML GeOrchestra matplotlib
  • Identifiant oublié ?
  • Mot de passe oublié ?

Data management with Python, Pandas, Matplotlib and Openpyxl

Détails
19 janvier 2023
40891
  • Python
  • Excel
  • matplotlib
  • openpyxl

Pandas logoPandas is an excellent Python librarie to manage data. Matplotlib allows to create advanced charts and Openpyxl is very usefull to read/write Excel files. These 3 tools, combined with other classic Python features, allow to do data analysis and engineering.

First install or check Python and Pip, then the 3 libraries:

pip install pandas
pip install matplotlib
pip install openpyxl

Data management with Python, Pandas, Matplotlib and Openpyxl

Installer Postgres 15 et son extension GIS sous Windows

Détails
2 décembre 2022
313

...et afficher quelques données géographiques PostGIS sous QGIS 

Salut toi ! Prêt à bénéficier de toute la puissance de Postgres 15 ? Tu as bien mis ta ceinture de sécurité ?

Maîtrise tes tremblements, bien compréhensibles face à ce déluge de technologies aux performances abyssales, et prépare-toi à entrer dans un monde nouveau, où l'imagination est la seule limite !

🤖🤟🌐💪🧭🐘

Installer Postgres 15 et son extension GIS sous Windows

Tutoriel avancé QGIS et Python

Détails
16 novembre 2022
46934

Qgis3PythonInteropérabilité Python/QGIS - Principaux concepts de Python, indentation, itération, variable, méthode, boucle, fonction, condition, liste, tuple, paramètre, argument, chaîne formatée, importation - Fonctions géométriques - Écriture de fichiers - Fonctions SIG - Génération de cartes - Standalone - Milieu alpin

Sources et liens divers :

  • Tutoriel d'initiation à Python dans QGIS3 (débutant) : http://www.qgistutorials.com/fr/docs/3/getting_started_with_pyqgis.html
  • Blog spécialisé d'Underdark, aka Anita Graser : https://anitagraser.com/
  • Documentation QGIS : https://docs.qgis.org/3.10/en/docs/
  • Documentation Python : https://docs.python.org/fr/3/
  • Documentation ArcGIS/Python : https://desktop.arcgis.com/search/?q=python&language=fr
  • Processing providers and algorithms : https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/
  • OSMDownloader : https://github.com/lcoandrade/OSMDownloader
  • QuickOSM : https://github.com/3liz/QuickOSM
  • Wikidata : https://www.wikidata.org/
  • Landscape Archaeology : https://landscapearchaeology.org/
  • AppDividend : https://appdividend.com/
  • OpenSourceOptions: https://opensourceoptions.com/
  • webgeodatavore : https://webgeodatavore.com/
  • QGIS StackExchange : https://gis.stackexchange.com

Tutoriel écrit sur QGIS 3.14 'Py' et Python 3.8, mais j'ai pu constater qu'il fonctionne de façon assez similaire sur des versions précédentes, ainsi que sur QGIS 3.16.

Sur des versions plus récentes comme QGIS 3.2 il semble que certaines API n'aient pas encore été portées (wikipedia et wikidata), mais cela ne posera pas de problème pour 99% du tutoriel.

Tutoriel avancé QGIS et Python

Quelques regex sur Notepad

Détails
19 septembre 2022
38884
  • Database
  • SQL
  • Data mining
  • Web scraping
  • Notepad
  • Regex

Les expressions régulières (regex) sur Notepad++ sont très pratiques pour standardiser un fichier de données avant import par exemple, récupérer des données, corriger des chaînes particulières, avec des conditions, etc...

Ici quelques astuces propres à mon usage personnel.

Quelques regex sur Notepad

Auto submit a form with Python, Selenium and Chromium

Détails
22 mai 2022
3602
  • Database
  • Access
  • XML
  • Python
  • Digital marketing
  • Excel
  • Selenium
  • Chromium

SeleniumHere a simple Selenium example where we go to fill then submit a form from data previously converted in XML.

I choose XML because this flat format is easy to grab with Python, and it can be created from an Excel file with Access for example. Morever, if the auto-submit crashs during the execution (it is possible even with a good code, depending on the website providing the form), Chromium will stop on the last record and you could remove the begining of the XML before to re-execute the same code (to avoid duplicates).

For those in a hurry (🧐) my code is here on GitHub. But for a full understanding just see below.

Auto submit a form with Python, Selenium and Chromium

Web scraping with Python and BeautifulSoup

Détails
25 avril 2021
2434
  • Data mining
  • Python
  • Web scraping
  • Digital marketing
  • BeautifulSoup

Beautiful SoupLet's go web scraping with Python and BeautifulSoup! Here BeautifulSoup will be able to extract formatted data from HTML and its CCS code. For confidentiality reasons, we will not name the parsed website, but a lot are built like that: pages containing record from a database use their ID in the URL. So you will to adapt the codes below to your own website and purposes.

We will use a complex website as example, where the IDs to guess are listed in a large pagination.

First, we will get the links to articles (with IDs in URLs) from all pages of the pagination, then we will store data in a CSV file, if interesting (we search emails). So we will do a loop in a loop, with a condition, but if the website you want to parse is simpler (without pagination), you will not need the first loop.

Libraries and receptacle

We start by importing some necessary libraries and creating the receptacle file for our data.

from bs4 import BeautifulSoup
import requests
import re
import csv
 
# CSV file to receive data
out_file = open('C:/python_projects/webscraping/email.csv', 'w', encoding='cp1252')
out_file.write("email" + "\n")

Web scraping with Python and BeautifulSoup

  1. Récupération de données sur le web
  2. Acymailing, mass sending et bonnes pratiques
  3. Cryptage d'emails en MD5 - exemples d'utilisation en marketing digital
  4. Zones de chalandise avec QGIS, Python, l'API ORS et les données OSM, IGN et INSEE

Page 1 sur 6

  • 1
  • 2
  • 3
  • 4
  • ...
  • 6

Haut de page

© 2023 HG-Map