Skip to content

Commit

Permalink
* Agrego función para generar ids de distribuciones en catálogos que …
Browse files Browse the repository at this point in the history
…nos los tienen (compatibilidad con perfil 1.0)

* Agrega función para eliminar todos los datastets federados de un catálogo que se encuentren en un CKAN
* Implemento fallback que busca un theme por identifier primero o por label después (si falla)
* Agrego excepciones a los chequeos de formato vs. extensión
* Agrego paramétros a la función title_to_name() para establecer una longitud máxima del resultado de la transformación en caracteres
  • Loading branch information
abenassi committed Apr 24, 2018
1 parent f22c5d6 commit 2d8351c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
@@ -1,6 +1,9 @@
Versiones
=========

0.4.9 (2018-04-18)
-------------------

0.4.8 (2018-04-18)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion pydatajson/__init__.py
Expand Up @@ -12,4 +12,4 @@

__author__ = """Datos Argentina"""
__email__ = 'datos@modernizacion.gob.ar'
__version__ = '0.4.8'
__version__ = '0.4.9'
11 changes: 9 additions & 2 deletions pydatajson/validation.py
Expand Up @@ -28,7 +28,7 @@
ABSOLUTE_PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
ABSOLUTE_SCHEMA_DIR = os.path.join(ABSOLUTE_PROJECT_DIR, "schemas")
DEFAULT_CATALOG_SCHEMA_FILENAME = "catalog.json"
EXTENSIONS_EXCEPTIONS = ["zip", "php"]
EXTENSIONS_EXCEPTIONS = ["zip", "php", "asp", "aspx"]


def create_validator(schema_filename=None, schema_dir=None):
Expand Down Expand Up @@ -277,6 +277,12 @@ def iter_custom_errors(catalog):
if len(dups) > 0:
yield ce.ThemeIdRepeated(dups)

# chequea que un dataset no use un theme que no exista en la taxonomía
# TODO: hay que implementarlo

# chequea que un dataset no use theme con id esté repetido en taxonomía
# TODO: hay que implementarlo

# chequea que la extensión de fileName, downloadURL y format sean
# consistentes
for dataset_idx, dataset in enumerate(catalog["dataset"]):
Expand All @@ -291,7 +297,8 @@ def iter_custom_errors(catalog):
# distribuciones
urls = []
for dataset in catalog["dataset"]:
urls += [distribution['downloadURL'] for distribution in dataset['distribution']
urls += [distribution['downloadURL']
for distribution in dataset['distribution']
if distribution.get('downloadURL')]
dups = _find_dups(urls)
if len(dups) > 0:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -18,7 +18,7 @@

setup(
name='pydatajson',
version='0.4.8',
version='0.4.9',
description="Paquete en python con herramientas para generar y validar metadatos de catálogos de datos en formato data.json.",
long_description=readme + '\n\n' + history,
author="Datos Argentina",
Expand Down

0 comments on commit 2d8351c

Please sign in to comment.