# ask-ai

Rudy Jariwala

03/11/2024, 3:08 AM
is there a way in python code to retrieve all asset groups in all code locations?


03/11/2024, 3:08 AM
The documentation does not explicitly provide a method for retrieving all asset groups in all code locations directly through Python code. However, the concept of asset groups is closely related to how assets are organized and loaded within Dagster, and typically, asset groups are defined implicitly by the structure of your code and the way you load assets. If you need to work with asset groups programmatically, you might consider using the
function, which constructs a list of assets and source assets from given modules. This function could potentially be used to load and organize assets in a way that reflects your groupings, but it does not directly provide a list of asset groups. For more complex scenarios, you might need to implement custom logic to inspect your codebase and identify the asset groups based on how you've structured your assets and their dependencies. This could involve analyzing the modules where your assets are defined and extracting the relevant grouping information. If you have a specific use case or further questions on how to approach this within the constraints of your Dagster project, please provide more details, and I can offer more targeted advice or follow-up questions to help you find a solution.