Skip to content

Instantly share code, notes, and snippets.

@pigreco
Last active January 23, 2023 17:56
Show Gist options
  • Save pigreco/2b2ad2eb12d17c4370b09635ae1470b4 to your computer and use it in GitHub Desktop.
Save pigreco/2b2ad2eb12d17c4370b09635ae1470b4 to your computer and use it in GitHub Desktop.
# Korto19 2022
from qgis.core import QgsExpression
#numero totale espressioni
nro_tot = len(QgsExpression.Functions())
#creo due dizionari
gruppi_funzioni = {}
gruppi = {}
#popolo il primo con le coppie funzione, gruppo
#ed il secondo con gruppo e contatore
for i in range(0, nro_tot):
gruppi[QgsExpression.Functions()[i].group()] = 1
gruppi_funzioni[QgsExpression.Functions()[i].name()] = QgsExpression.Functions()[i].group()
#uso il secondo gruppo per classificare il primo e conto
for key, value in gruppi_funzioni.items():
#print(key, ' : ', value)
gruppi[value] = gruppi[value] + 1
#stampo il risultato
print(gruppi)
print ('nro totale espressioni: ',nro_tot)
@pigreco
Copy link
Author

pigreco commented Feb 2, 2022

output dev 3.23

{'Math': 27, 'GeometryGroup': 143, 'Conversions': 16, 'Conditionals': 6, 'Aggregates': 24, 'Arrays': 36, 'Date and Time': 17, 'String': 22, 'Fuzzy Matching': 5, 'Color': 18, 'Files and Paths': 10, 'deprecated': 2, 'Record and Attributes': 15, 'Map Layers': 3, 'General': 8, 'Rasters': 3, 'Maps': 15, 'Layout': 3, 'Processing': 2, 'Form': 3, 'Custom': 23, 'Lat Lon Tools': 21, 'Atlas': 2, 'Time': 4}
nro totale espressioni: 404

@pigreco
Copy link
Author

pigreco commented Jan 23, 2023

output dev 3.29

{'Math': 27, 'GeometryGroup': 150, 'Conversions': 16, 'Conditionals': 6, 'Aggregates': 24, 'Arrays': 37, 'Date and Time': 17, 'String': 22, 'Fuzzy Matching': 5, 'Color': 18, 'Files and Paths': 10, 'deprecated': 2, 'Record and Attributes': 18, 'Map Layers': 4, 'General': 8, 'Rasters': 4, 'Maps': 17, 'Layout': 3, 'Processing': 2, 'Form': 3, 'HfcQGIS': 23, 'Custom': 12, 'DataPlotly': 2, 'Lat Lon Tools': 21}
nro totale espressioni: 427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment