CJDB is a tool that enables CityJSON integration with a PostgreSQL database
Project description
cjdb
CJDB is a tool for enabling CityJSON integration with a PostgreSQL database.
Authors: Cynthia Cai, Lan Yan, Yitong Xia, Chris Poon, Siebren Meines, Leon Powalka
Maintainer: Gina Stavropoulou
Table of Contents
1. Data model
2. Installation & running
3. Local development
4. Running tests
1. Data model
For the underlying data model see cjdb/model/README.md
2. Installation & running
Using pip
pip install cjdb
It is recommended to install it in an isolated environment, because of fragile external library dependencies for CQL filter parsing.
Using docker
Build:
docker build -t cjdb:latest .
Run:
docker run --rm -it cjdb cjdb --help
To import some files, the -v
option is needed to mount our local file directory in the container:
docker run -v {MYDIRECTORY}:/data --rm -it --network=host cjdb cjdb -H localhost -U postgres -d postgres -W postgres /data/5870_ext.jsonl
3. Local development
Make sure poetry
is installed. Then, to create a local environment with all the necessary dependencies, run from the repository root:
poetry install
To build the wheel run:
poetry build
Then install the .whl file with pip:
pip3 install dist/*.whl --force-reinstall
Then you can run the CLI command:
cjdb --help
4. Running tests
Modify the arguments for the database connection to your own settings in:
- /tests/cli_test.py
Then run:
pytest -v
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.