Skip to content

Commit

Permalink
acto.get_actos()
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Jun 28, 2015
1 parent 00a141d commit fc8a4c0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
7 changes: 6 additions & 1 deletion bormeparser/borme.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def _set_actos(self, actos):
if acto_name not in ACTO.ALL_KEYWORDS:
logger.warning('Invalid acto found: %s\n' % acto_name)
#raise BormeInvalidActoException('Invalid acto found: %s' % acto_name)
del actos[acto_name]

# FIXME
try:
del actos['Datos registrales']
except KeyError:
pass
self.actos = actos

def get_datos_registrales(self):
Expand Down
31 changes: 25 additions & 6 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ es una instancia de Borme:
Borme y BormeActo
-----------------

De la instancia BORME puedes obtener información básica como la fecha, la sección, la provincia...

.. code-block:: python
>>> borme.num
Expand All @@ -89,6 +91,10 @@ Borme y BormeActo
>>> borme.seccion
'SECCIÓN PRIMERA'
Y lo más importante: los actos mercantiles.

.. code-block:: python
>>> for acto in borme.get_actos():
... print(acto)
...
Expand All @@ -113,12 +119,25 @@ Borme y BormeActo
<BormeActo(223988) JEWELLERY THEATRE IBERIA SL. (3)>
<BormeActo(223989) AF ASESORIA DE EMPRESAS SL. (1)>
[...]
>>> acto = borme.get_acto(223978)
>>> acto
<BormeActo(223978) DISTRIBUIDORA MALAGUEÑA DE EXPLOSIVOS SL. (1)>
>>> acto.get_actos()
{'Nombramientos': [('Apoderado', {'GRACIAN ALCAIDE ALBERTO JAVIER'})]}
El segundo número entre paréntesis indica el número de cambios que contiene dicho acto.

Para analizar un acto mercantil en concreto, podemos obtenerlo de la instancia Borme a través de su id:

.. code-block:: python
>>> acto = borme.get_acto(223988)
>>> acto.get_datos_registrales()
'T 1728, L 641, F 141, S 8, H MA 22254, I/A 10 (21.05.15).'
'T 5367, L 4274, F 64, S 8, H MA126720, I/A 2 (22.05.15).'
>>> acto.get_actos()
{'Ceses/Dimisiones': [('Adm. Unico', {'MARTINEZ MORALES IVAN KARIM'})], 'Nombramientos': [('Adm. Unico', {'NIKOLAEKO MARIA'})], 'Cambio de domicilio social': 'URB PUEBLO MARINERO DE RIBERA S/N 9C - EDF. DE LA (MARBELLA).'}
>>> import pprint
>>> actos = acto.get_actos()
>>> pprint.pprint(actos)
{'Cambio de domicilio social': 'URB PUEBLO MARINERO DE RIBERA S/N 9C - EDF. DE LA (MARBELLA).',
'Ceses/Dimisiones': [('Adm. Unico', {'MARTINEZ MORALES IVAN KARIM'})],
'Nombramientos': [('Adm. Unico', {'NIKOLAEKO MARIA'})]}

0 comments on commit fc8a4c0

Please sign in to comment.