Skip to content
MARIO
Get started
  • Installation
  • Table formats
  • Scenarios
Docs
  • Data sources
  • Working with a database
  • Calculations and analysis
  • Transformations and scenarios
  • Configuration
  • Examples
  • API reference
Resources
  • Database explorer
  • Projects & Publications
  • Teaching
  • Downloadable material

Documentation

  • Overview
  • Data sources
  • Working with a database
  • Calculations and analysis
  • Transformations and scenarios
  • Configuration
  • Examples
  • API reference
    • Parsing and Data Loading
    • Downloads
    • Inspection and Data Access

      Query and Block Access

      • mario.Database.query
      • mario.Database.get_data
      • mario.CoreModel.get_block
      • mario.CoreModel.get_block_as_pandas
      • mario.CoreModel.get_block_as_table
      • mario.CoreModel.get_block_as_matrix
      • mario.CoreModel.set_block
      • mario.CoreModel.has_block
      • mario.CoreModel.has_matrix
      • mario.CoreModel.list_matrices
      • mario.CoreModel.matrices
      • mario.CoreModel.available_matrices
      • mario.CoreModel.available_blocks
      • mario.Database.DataFrame

      Custom Blocks and Operators

      • mario.CoreModel.get_block_spec
      • mario.CoreModel.register_block_spec
      • mario.CoreModel.list_custom_block_specs
      • mario.CoreModel.register_operator
      • mario.CoreModel.list_custom_operators

      Sets, Metadata and Scenarios

      • mario.CoreModel.get_index
      • mario.CoreModel.get_concordances
      • mario.CoreModel.available_concordances
      • mario.CoreModel.get_aggregation
      • mario.CoreModel.available_aggregations
      • mario.CoreModel.database_profile
      • mario.get_database_profile
      • mario.CoreModel.search
      • mario.CoreModel.sets
      • mario.CoreModel.units
      • mario.CoreModel.table_type
      • mario.CoreModel.tech_assumption
      • mario.CoreModel.scenarios
      • mario.CoreModel.baseline_scenario_name
      • mario.CoreModel.directory
      • mario.CoreModel.meta_history
      • mario.CoreModel.save_meta
      • mario.CoreModel.add_note
      • mario.Database.clusters
      • mario.Database.default_clusters
      • mario.Database.available_clusters
      • mario.Database.copy
      • mario.Database.backup

      Diagnostics

      • mario.CoreModel.GDP
      • mario.CoreModel.is_balanced
      • mario.CoreModel.is_hybrid
      • mario.CoreModel.is_multi_region
      • mario.CoreModel.is_chenerymoses
      • mario.CoreModel.is_isard
    • Sets and indices
    • Calculations
    • Transformations and Scenarios
    • Exports
    • Templates and Workbooks
    • Visualization
    • Settings and Utilities
Documentation pagesPages
  • Overview
  • Data sources
  • Working with a database
  • Calculations and analysis
  • Transformations and scenarios
  • Configuration
  • Examples
  • API reference
    • Parsing and Data Loading
    • Downloads
    • Inspection and Data Access

      Query and Block Access

      • mario.Database.query
      • mario.Database.get_data
      • mario.CoreModel.get_block
      • mario.CoreModel.get_block_as_pandas
      • mario.CoreModel.get_block_as_table
      • mario.CoreModel.get_block_as_matrix
      • mario.CoreModel.set_block
      • mario.CoreModel.has_block
      • mario.CoreModel.has_matrix
      • mario.CoreModel.list_matrices
      • mario.CoreModel.matrices
      • mario.CoreModel.available_matrices
      • mario.CoreModel.available_blocks
      • mario.Database.DataFrame

      Custom Blocks and Operators

      • mario.CoreModel.get_block_spec
      • mario.CoreModel.register_block_spec
      • mario.CoreModel.list_custom_block_specs
      • mario.CoreModel.register_operator
      • mario.CoreModel.list_custom_operators

      Sets, Metadata and Scenarios

      • mario.CoreModel.get_index
      • mario.CoreModel.get_concordances
      • mario.CoreModel.available_concordances
      • mario.CoreModel.get_aggregation
      • mario.CoreModel.available_aggregations
      • mario.CoreModel.database_profile
      • mario.get_database_profile
      • mario.CoreModel.search
      • mario.CoreModel.sets
      • mario.CoreModel.units
      • mario.CoreModel.table_type
      • mario.CoreModel.tech_assumption
      • mario.CoreModel.scenarios
      • mario.CoreModel.baseline_scenario_name
      • mario.CoreModel.directory
      • mario.CoreModel.meta_history
      • mario.CoreModel.save_meta
      • mario.CoreModel.add_note
      • mario.Database.clusters
      • mario.Database.default_clusters
      • mario.Database.available_clusters
      • mario.Database.copy
      • mario.Database.backup

      Diagnostics

      • mario.CoreModel.GDP
      • mario.CoreModel.is_balanced
      • mario.CoreModel.is_hybrid
      • mario.CoreModel.is_multi_region
      • mario.CoreModel.is_chenerymoses
      • mario.CoreModel.is_isard
    • Sets and indices
    • Calculations
    • Transformations and Scenarios
    • Exports
    • Templates and Workbooks
    • Visualization
    • Settings and Utilities
Docs/ API reference/ API reference

mario.CoreModel.search

CoreModel.search(item=None, search=None, ignore_case=True, *, region=None, flat=False)#

Search index values matching a pattern within one set or across all sets.

Parameters:
  • item – Optional set name to search in, such as Region or Sector. When omitted, search every set and return grouped matches.

  • search – Regular-expression fragment matched against the labels.

  • ignore_case – When True, perform a case-insensitive search.

  • region – Optional region to search. Each matching set then returns a list. Mutually exclusive with flat=True.

  • flat – When True, search the union of distinct labels and return a list for each matching set, including regional classifications.

Returns:

Matching labels in their stored order for a common classification, or {region: matching_labels} for a regional classification. Regions without matches are omitted. With region or flat=True, return a list. Global searches always return a dictionary keyed by matching set, using these same value types.

Return type:

list | dict

Searching one set normally returns an ordered list. In the special case of regional classifications, the result is a dictionary whose keys are only the regions containing matches:

db.search("Activity", "^A_ADVERT$")
# {"IT": ["A_ADVERT"], "DE": ["A_ADVERT"], ...}

Explicitly request the ordered union of distinct matching labels, or limit the search to one region:

db.search("Activity", "^A_ADVERT$", flat=True)
# ["A_ADVERT"]

db.search("Activity", "^A_ADVERT$", region="IT")
# ["A_ADVERT"]

region and flat=True are mutually exclusive. A regional set with no matches returns {}; a list-shaped search with no matches returns []. The default result shape depends on the classification before filtering, even if the matching lists happen to be identical in every region.

Global searches keep their outer grouping by set and use the same result shapes inside each group:

db.search("^A_ADVERT$")
# {"Activity": {"IT": ["A_ADVERT"], "DE": ["A_ADVERT"], ...}, ...}

db.search("^A_ADVERT$", flat=True)
# {"Activity": ["A_ADVERT"], ...}

Set aliases, regular expressions, case matching and existing positional arguments retain their previous behavior. Searches read materialized index views without computing matrices.

On this page

  • CoreModel.search()
MARIO

Multifunctional Analysis of Regions through Input-Output

Get startedDocsResources Changelog GitHubPyPI

© 2026, Lorenzo Rinaldi, Mohammad Amin Tahavori, Nicolo Golinucci AI disclosure. This documentation and its database explorer were written and built with AI agents, then reviewed by the MARIO team, who remain responsible for their content. Spotted an error? Tell us on GitHub Issues.

Esc

    Use the arrow keys to move and Enter to open.