Skip to main content

CJDB is a tool that enables CityJSON integration with a PostgreSQL database

Project description

cjdb

MIT badge   PyPI

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


Download files

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

Source Distribution

cjdb-1.1.0.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

cjdb-1.1.0-py3-none-any.whl (23.2 kB view hashes)

Uploaded Python 3

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