Skip to main content

Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb

Project description

Catastro to Mongodb

PyPi release Downloads Traducción :es:

Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb

Installation

$ pip install catastro-to-mongodb

Usage

Usage capture

Usage: catastro_to_mongodb.py [OPTIONS] CAT_FILE

  Import a CAT FILE to MongoDB

  Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb
  More info: https://github.com/dcervantes/catastro-to-mongodb

Options:
  -h, --help           Show this message and exit.
  -v, --version        Show the version and exit.
  -d, --database name  Database name.  [default: catastro]
  -H, --host host      Host name.  [default: 0.0.0.0]
  -p, --port port      Port number.  [default: 27017]
  -t, --timeout sec    Connection timeout (seconds).  [default: 5]

Examples

Change database name

Import catastro.CAT to test database:

$ catastro-to-mongodb --database test ./catastro.CAT
$ catastro-to-mongodb -d test ./catastro.CAT

Change host and port

Import catastro.CAT to test database with host: test.xyz:16014 and port: 16014:

$ catastro-to-mongodb --database test --host test.xyz --port 16014 ./catastro.CAT
$ catastro-to-mongodb -d test -H test.xyz -p 16014 ./catastro.CAT

Sources

Structure definition of CAT file: http://www.catastro.minhap.es/documentos/formatos_intercambio/catastro_fin_cat_2006.pdf

How to download CAT file: http://www.catastro.minhap.es/ayuda/manual_descargas_cat.pdf

UnicodeDecodeError decode byte 0xd1

This error is caused by try to read the Ñ character encoded in ISO-8859-1 format instead of UTF-8 format. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1

Runing iconv we can fix the CAT file encoding.

$ iconv -f ISO-8859-1 -t UTF-8 ./catastro.CAT > ./catastro_fixed.CAT

Catastro a Mongodb

PyPi release Downloads Translation :gb:

Script de migración de datos del Catastro (en formato Catalog CP Backup - dBASE IV) a Mongodb

Instalación

$ pip install catastro-to-mongodb

Uso

Usage capture

Usage: catastro_to_mongodb.py [OPTIONS] CAT_FILE

  Import a CAT FILE to MongoDB

  Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb
  More info: https://github.com/dcervantes/catastro-to-mongodb

Options:
  -h, --help           Show this message and exit.
  -v, --version        Show the version and exit.
  -d, --database name  Database name.  [default: catastro]
  -H, --host host      Host name.  [default: 0.0.0.0]
  -p, --port port      Port number.  [default: 27017]
  -t, --timeout sec    Connection timeout (seconds).  [default: 5]

Ejemplos

Cambiar nombre de la base de datos

Importar catastro.CAT a la base de datos test :

$ catastro-to-mongodb --database test ./catastro.CAT
$ catastro-to-mongodb -d test ./catastro.CAT

Cambiar host y puerto

Importar catastro.CAT a la base de datos test con host: test.xyz y puerto: 16014:

$ catastro-to-mongodb --database test --host test.xyz --port 16014 ./catastro.CAT
$ catastro-to-mongodb -d test -H test.xyz -p 16014 ./catastro.CAT

Fuentes

Definición de estructura del fichero CAT: http://www.catastro.minhap.es/documentos/formatos_intercambio/catastro_fin_cat_2006.pdf

Como descargar el fichero CAT: http://www.catastro.minhap.es/ayuda/manual_descargas_cat.pdf

UnicodeDecodeError decode byte 0xd1

Este error lo produce al intentar leer el caracter Ñ en formato ISO-8859-1 en vez de en formato UTF-8.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1

Ejecutando iconv podemos arreglar el fichero CAT.

$ iconv -f ISO-8859-1 -t UTF-8 ./catastro.CAT > ./catastro_fixed.CAT

License (Licencia)

GPL-3.0 License David Cervantes Caballero

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catastro-to-mongodb-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

catastro_to_mongodb-1.0.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file catastro-to-mongodb-1.0.0.tar.gz.

File metadata

  • Download URL: catastro-to-mongodb-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for catastro-to-mongodb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2d266cf5f5fcbf1929e02b9fd663865225f39ae08d28e8acc9dd56d195b42428
MD5 8e9136bc9cb354167a633d0172a12ded
BLAKE2b-256 d19d882e7cfc9c40c0164d11023f0419cf2b4f66f21eb028d95bb541575d379b

See more details on using hashes here.

File details

Details for the file catastro_to_mongodb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: catastro_to_mongodb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for catastro_to_mongodb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84c9cfd43f1ca9b46f58a7b2ebb9f342d8c6a0e2b14b8064ecc4f585a6f1a71a
MD5 25822606dbfc82bf6a1302bfd37c26e8
BLAKE2b-256 39578c364ac4b64407482a9c193a2a4c7c53f56834685288eff2ba3f80103e9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page