libredte 4.2.1__tar.gz → 4.4.0__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.1
2
2
  Name: libredte
3
- Version: 4.2.1
3
+ Version: 4.4.0
4
4
  Summary: Cliente para realizar la integración con los servicios web de LibreDTE desde Python.
5
5
  Home-page: https://github.com/LibreDTE/libredte-api-client-python
6
6
  Author: LibreDTE
@@ -54,13 +54,11 @@ class ApiClient:
54
54
  :param bool raise_for_status: Si se debe lanzar una excepción automáticamente para respuestas de error HTTP. Por defecto es True.
55
55
  :raises ApiException: Si el hash del usuario no es válido o está ausente.
56
56
  """
57
- username = self.__validate_hash(hash)
58
- password = 'X'
57
+ self.set_hash(hash)
59
58
  self.url = self.__validate_url(url)
60
59
  self.headers = self.__generate_headers()
61
60
  self.version = version or self.__DEFAULT_VERSION
62
61
  self.raise_for_status = raise_for_status
63
- self.http_auth = requests.auth.HTTPBasicAuth(username, password)
64
62
  self.set_ssl()
65
63
  self.set_contribuyente()
66
64
  self.set_ambiente_sii()
@@ -151,6 +149,21 @@ class ApiClient:
151
149
  self.rut = rut
152
150
  return self.rut
153
151
 
152
+ def set_hash(self, hash):
153
+ """
154
+ Configura la autenticación HTTP básica usando un hash proporcionado.
155
+
156
+ Este método toma un hash, lo valida (o transforma) en un nombre de usuario mediante
157
+ `__validate_hash` y establece la autenticación HTTP básica para su uso en futuras
158
+ solicitudes HTTP. La contraseña se establece como un valor predeterminado 'X'.
159
+
160
+ :param str hash: Un hash que se valida y se usa para configurar el nombre de usuario
161
+ en la autenticación HTTP básica.
162
+ """
163
+ username = self.__validate_hash(hash)
164
+ password = 'X'
165
+ self.http_auth = requests.auth.HTTPBasicAuth(username, password)
166
+
154
167
  def set_ambiente_sii(self, ambiente=None):
155
168
  """
156
169
  Establece el ambiente del Servicio de Impuestos Internos (SII) para las solicitudes de la API.
@@ -51,6 +51,18 @@ class Dte(ApiBase):
51
51
  """
52
52
  filtros = '' if filtros is None else urlencode(filtros)
53
53
  return self.client.get(f'/dte/dte_tmps/info/{receptor}/{dte}/{codigo}/{emisor}?{filtros}')
54
+
55
+ def delete_dte_temporal(self, receptor, dte, codigo, emisor):
56
+ """
57
+ Elimina un DTE temporal específico.
58
+
59
+ :param str receptor: RUT del receptor.
60
+ :param str dte: Tipo de DTE.
61
+ :param str codigo: Código del DTE temporal.
62
+ :param str emisor: RUT del emisor.
63
+ :return: Respuesta JSON con un boolean que retorna verdadero si se eliminó el DTE temporal.
64
+ """
65
+ return self.client.get(f'/dte/dte_tmps/eliminar/{receptor}/{dte}/{codigo}/{emisor}')
54
66
 
55
67
  def emitir_dte_real(self, dte_real, filtros=None):
56
68
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libredte
3
- Version: 4.2.1
3
+ Version: 4.4.0
4
4
  Summary: Cliente para realizar la integración con los servicios web de LibreDTE desde Python.
5
5
  Home-page: https://github.com/LibreDTE/libredte-api-client-python
6
6
  Author: LibreDTE
@@ -34,7 +34,7 @@ setup(
34
34
  name='libredte',
35
35
 
36
36
  # Versions should comply with PEP440
37
- version='4.2.1',
37
+ version='4.4.0',
38
38
 
39
39
  description='Cliente para realizar la integración con los servicios web de LibreDTE desde Python.',
40
40
  long_description="\n"+long_description,
File without changes
File without changes
File without changes
File without changes