Dev zone/Reports

From Nasqueron Agora
Revision as of 12:52, 14 September 2025 by Dereckson (talk | contribs) (Created page with "The Nasqueron internal reports repository is a monorepo containing SQL queries and tools to produce reports about Nasqueron internal data. == Python tools == === Configure PYTHONPATH === Python allows to develop several packages at the same time providing all the src/ folders to your PYTHONPATH variables. First, ensure you don't have any module installed through .whl running <code>pip freeze</code>. If you see something like <code>nasqueron-reports==0.1.0</code>, it co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Nasqueron internal reports repository is a monorepo containing SQL queries and tools to produce reports about Nasqueron internal data.

Python tools

Configure PYTHONPATH

Python allows to develop several packages at the same time providing all the src/ folders to your PYTHONPATH variables.

First, ensure you don't have any module installed through .whl running pip freeze. If you see something like nasqueron-reports==0.1.0, it comes from package auto detection and it's fine and will use your local code. What is not fine is a long line with wheel archive.

Then, include every tools/*/src include in your path. The environment script takes care of that.

Environment script

You can use this environment configuration script for sh, bash and zsh:

#!/bin/sh

# Not intended to contain actual credentials, but it allows to validate env config
export DB_USERNAME=someuser
export DB_PASSWORD=somepass

# shellcheck disable=SC2044
for dir in $(find tools -type d -name src); do
    if [ "$PYTHONPATH" = "" ]; then
        export PYTHONPATH="$dir"
    else
        export PYTHONPATH="$PYTHONPATH:$dir"
    fi
done

export VAULT_ADDR=https://localhost:8200

If you call it .env, you can use source .env, but your IDE will complain it contains shell stuff. Override file type as shell script or save it under another name.