Core (harp)

The Core (harp) package is the root namespace of the Harp framework.

It mostly contains a reference to the Config class, because it’s the only object you need to start using Harp using the python API (you don’t need to use this API, configuration files should be enough for most use cases, but if you want to, this is the starting point).

For convenience, the run() function is also available, which is a simple way to start the default server implementation for your configuration object.

Example usage:

from harp import Config, run

config = Config()
config.add_defaults()

if __name__ == "__main__":
    run(config)

You can find more information about how configuration works in the harp.config module.

Contents

get_logger(name, *args, **initial_values)[source]
Parameters:
  • args (Any)

  • initial_values (Any)

Return type:

Any

run(builder)[source]

Run the default server using provided configuration.

Parameters:

builder (_ConfigurationBuilder) – Config

Returns:

DEBUG: bool = False

Debug mode flag. When enabled, HARP will output additional debugging information that may not be safe for production environments (e.g., exception tracebacks in error responses). Set via HARP_DEBUG or DEBUG environment variables.

Submodules