Get started¶
Prerequisites¶
To use Kingfisher Summarize, you need:
Access to a Unix-like shell (some are available for Windows)
Install¶
Open a shell, and run:
git clone https://github.com/open-contracting/kingfisher-summarize.git
cd kingfisher-summarize
pip install -r requirements.txt
All instructions in this documentation assume that you have changed to the kingfisher-summarize
directory (the cd
command above).
Configure¶
Database¶
The database connection is configured by setting the KINGFISHER_SUMMARIZE_DATABASE_URL
environment variable to the connection URI of the database used by Kingfisher Process.
It can be set on the command line. For example:
export KINGFISHER_SUMMARIZE_DATABASE_URL=postgresql://user:password@localhost:5432/dbname
Or, it can be set in a .env
file in the kingfisher-summarize
directory. For example:
KINGFISHER_SUMMARIZE_DATABASE_URL=postgresql://user:password@localhost:5432/dbname
If you prefer not to store the password in the .env
file, you can use the PostgreSQL Password File, ~/.pgpass
.
The database user must have the CREATE privilege on the database used by Kingfisher Process. For example, for the default database connection settings:
psql ocdskingfisher -U ocdskingfisher -c 'GRANT CREATE ON DATABASE ocdskingfisher TO ocdskingfisher;'
Optionally, you can configure Kingfisher Summarize to grant to a SQL role the USAGE
privilege on the schemas it creates and the SELECT
privilege on all tables in the schemas. To do so, set the KINGFISHER_SUMMARIZE_READONLY_ROLE
environment variable.
Logging¶
Note
This step is optional.
Logging from the Command-line interface can be configured with a logging.json
file in a configuration directory appropriate to your operating system. Set the KINGFISHER_SUMMARIZE_LOGGING_JSON
environment variable to override the default path. Read more about Reading logs.
You’re now ready to use Kingfisher Summarize.