I may be misremembering but is there a versio nof ...
# questions
a
I may be misremembering but is there a versio nof https://docs.kedro.org/en/0.18.0/get_started/standalone_use_of_datacatalog.html that provides exmples of how to access the catalog datasets outside of notebook magic? Like say from just a script?
I'm getting some fairly convoluted looking example from ChatGPT:
Copy code
from kedro.framework.hooks import _create_hook_manager
from kedro.config import ConfigLoader
from kedro.context import KedroContext, KedroContextError
from kedro.framework.hooks import _create_hook_manager
from kedro.framework.hooks import _create_hook_manager
from kedro.config import ConfigLoader
from kedro.framework.hooks import _create_hook_manager
from <http://kedro.io|kedro.io> import DataCatalog
from pathlib import Path

class ProjectContext(KedroContext):
    project_name = "your_project"

context = ProjectContext(Path.cwd())

# Load Kedro configuration
conf_source = context.config_loader.get("source*")
conf_catalog = context.config_loader.get("catalog*")

# Load data catalog
catalog = DataCatalog.from_config(conf_catalog)

# Load your dataset
data = catalog.load("raw_data")
y
It is even simpler in 0.19, because the OmegaConfigLoader defaults have changed and you don't need to specify all the arguments in the example, they are the default now.
It's basically the same that what ChatGPT suggests, but you can create the config loader directly without all the stuff about creating a fake project context just for accessing the configloader
👍 1
a
Thanks for catching me up there @Yolan Honoré-Rougé - I need to get up to speed with omega
n
"outside of a notebook", do you still have a kedro project or you just having some configuration files?. If the former you can always use
bootstrap_project
(which is what the notebook magic do behind the scene). Otherwise what @Yolan Honoré-Rougé suggested is the way to go.
a
yes, there is kedro project
is there a good overview of
bootstrap_project
usage?
n
@Andrew Stewart https://github.com/kedro-org/kedro/pull/3470 Would this help? should I add more details?
👀 1
a
Thanks @Nok Lam Chan I'll give that a read!