Skip to content

Project Configuration Options

The following table lists the available project configuration options for Alchemist. These options can be set in a YAML configuration file or passed as command-line arguments.

Field Description Default Value Environment Variable
project_name Name of the project. alc_project ALC_PROJECT_NAME
source_dialect_code Dialect code of the source (used for parsing and analysis). sas ALC_SOURCE_DIALECT_CODE
target_dialect_code Dialect code of the target (used for conversion). None. Must be set for Conversion ALC_TARGET_DIALECT_CODE
source_paths Project source paths.

Usually passed via CLI. A list of paths to source files or directories.
None
source_root_path Common root path for all sources, used to determine "stable" relative paths to source files. Computed, see tips below ALC_SOURCE_ROOT_PATH
output_path Path to the root of the output directory for all operations.

Defaults to current working directory.
Current working directory ALC_OUTPUT_PATH
report_format Format to use for reports.

If not set, no results are written to disk.
skip
ui_max_code_chunk_length Maximum length of code chunk to display in UI. 20000
notifications Notification configuration. NotificationConfig
parser Parser configuration. ParserConfig
analyzer Analyzer configuration. AnalyzerConfig
converter Converter configuration. ConverterConfig
src_non_utf_encoding Encoding to use for non-UTF source files.

If not set, the default system encoding is tried. For text sources also auto-detection is tried.

This option accepts any value that Python accepts
system default ALC_SOURCE_NON_UTF_ENCODING

Tips on source_root_path

It is highly recommended to explicitly set this value if you are running Alchemist on batches of sources. This way the entire source tree structure may be properly preserved in the analysis results across multiple runs.

If the value is provided in the config, all source paths must be relative to it.

If not provided, Alchemist will try to determine common root using the following logic:

  • if all sources are relative to current working directory, the root will be set to it, unless all sources start in src directory, in which case the root will be set to src directory. Using single src directory as Alchemist source is the recommended way to use Alchemist.

  • if an absolute single path is provided, and it is not relative to the current working dir, it will be used as root (or the path parent folder if it is a file).

  • if multiple absolute source paths are provided, some of which are not relative to the current working directory, an attempt to find the closest common parent is made. On *nix systems it may become root (which is not recommended) and on Windows such common root may not exist if sources are on different drives.

Tips on src_non_utf_encoding

You can run the following command to get the list of available encodings:

sh python3 -c "import encodings.aliases; print('\n'.join(sorted(set(encodings.aliases.aliases.values()))))"

Example YAML Configuration File

Below is an example YAML configuration file with non-default values:

project_name: my_project
source_dialect_code: sas
target_dialect_code: dbr
source_paths:
  - /path/to/source/1
  - /path/to/source/2
output_path: /path/to/output
report_format: xlsx
ui_max_code_chunk_length: 500
parser:
    treat_numeric_cols_wo_format_as_double: true
    export_embedded_user_written_code: true
analyzer:
  sensitive: obfuscate
resolver:
    ... # reserved for future use. Currently resolver has no configuration
converter:
    default_output_extension: ".sql"
    user_template_paths:
        - /path/to/your/templates/folder
    template_configs:
        ... # see template.md for more information
    template_tag_filter:
        exclude: ["runtime"]
    node_filter:
        ... # see node_filter.md for more information