Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb
Project description
Catastro to Mongodb
Migration Script from Catastro files ( Catalog CP Backup - dBASE IV ) to Mongodb
Installation
$ pip install catastro-to-mongodb
Usage
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
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: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file catastro-to-mongodb-1.0.1.tar.gz
.
File metadata
- Download URL: catastro-to-mongodb-1.0.1.tar.gz
- Upload date:
- Size: 4.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c4636eeb33cd62558e0c4d45e070e90a66c70fa4341ca130cf19d6ed8324192 |
|
MD5 | e649d49012db933a6b65bb85bd4b7139 |
|
BLAKE2b-256 | 4392abc0f7872cd612b57adc7784132e85357ba0dabb3d83e8b639e80e02ae95 |
File details
Details for the file catastro_to_mongodb-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: catastro_to_mongodb-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a48f19adbf56861687c589f5186c9ffe335902c52d3723a59fc426354d6360 |
|
MD5 | 36a2e5d17e0aa5db4b408e6d8a49fe17 |
|
BLAKE2b-256 | 4b8bc8b09991f7bbd13447c2493559f576624e55dbe14625bd3cab6e76d5623d |