pdnd-python-client 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdnd-python-client
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Client Python per autenticazione e interazione con le API della Piattaforma Digitale Nazionale Dati (PDND).
5
5
  Author-email: Francesco Loreti <francesco.loreti@isprambiente.it>
6
6
  License-Expression: MIT
@@ -34,9 +34,16 @@ class PDNDClient:
34
34
  self.api_url = api_url
35
35
  return True
36
36
 
37
- # Questo metodo imposta i filtri da utilizzare nelle richieste API.
37
+ # Imposta i filtri da utilizzare nelle richieste API.
38
+ # Se viene fornita una stringa, la converte in un dizionario.
38
39
  def set_filters(self, filters) -> bool:
39
- self.filters = filters
40
+ if isinstance(filters, str):
41
+ # Analizza la stringa nel formato "chiave1=val1&chiave2=val2"
42
+ self.filters = dict(pair.split("=", 1) for pair in filters.split("&") if "=" in pair)
43
+ elif isinstance(filters, dict):
44
+ self.filters = filters
45
+ else:
46
+ raise ValueError("I filtri devono essere una stringa o un dizionario.")
40
47
  return True
41
48
 
42
49
  # Questo metodo imposta la modalità di debug, che controlla se stampare un output dettagliato.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdnd-python-client
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Client Python per autenticazione e interazione con le API della Piattaforma Digitale Nazionale Dati (PDND).
5
5
  Author-email: Francesco Loreti <francesco.loreti@isprambiente.it>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pdnd-python-client"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "Client Python per autenticazione e interazione con le API della Piattaforma Digitale Nazionale Dati (PDND)."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"