SimReady Asset Search Library
Project description
Asset Search Library (simready.search)
Python library for loading a SimReady project's asset metadata cache and performing filter-based searches.
Initialization
Construct an instance of the AssetLibrary class.
Use one or more of these async methods to add a search source:
add_cache_sourcefor local project_config.tomladd_s3_sourcefor S3 project_config.tomladd_service_sourcefor web-hosted search serviceadd_indexed_sourcefor either local or S3 directories without caches- Only the
SearchFilterPathContainswill work to find files indexed this way, since the indexing will discover only file paths, no metadata.
- Only the
import asyncio
from simready.search import (
AssetLibrary,
AssetLibraryNetworkError,
SearchFilterArbitraryDictValue,
SearchFilterClass,
SearchFilterCountry,
SearchFilterFeature,
SearchFilterHeight,
SearchFilterPathContains,
SearchFilterScenePOI,
)
async def main():
# Option 1: initialize with project_config.toml referring to a workspace_cache.json
project_config_path = "d:/simready_foundations/sample_content/project_config.toml"
asset_library = AssetLibrary()
await asset_library.add_cache_source(project_config_path)
# Option 2: no project_config, just index some directories
asset_library = AssetLibrary()
await asset_library.add_indexed_source("d:/some_content/", "local")
await asset_library.add_indexed_source("d:/some_more_content/", "local")
# Option 3: strict network error handling
asset_library = AssetLibrary(raise_on_network_error=True)
asyncio.run(main())
AssetLibrary constructor args:
log_func(defaultNone): callback for library log messages.raise_on_network_error(defaultFalse): whenTrue, raisesAssetLibraryNetworkErrorfor service/S3 failures.
When raise_on_network_error=False, network failures are logged and the library returns safe empty/partial results.
Searching
AssetLibrary.search(...) takes 4 keyword arguments, each an optional list of search filters:
- include_all: include an asset if it passes all of these filters
- include_any: include an asset if it passes any one of these filters
- exclude_all: exclude an asset if it passes all of these filters
- exclude_any: exclude an asset if it passes any one of these filters
The return value is a list of AssetData objects for assets which were included and not excluded.
Examples
Example 1: find really tall props which are neither structures nor trees
matches = asset_library.search(
include_all=[SearchFilterClass("prop"), SearchFilterHeight(minimum=25)],
exclude_any=[SearchFilterPathContains("structures"), SearchFilterPathContains("vegetation")],
)
for asset_data in matches:
print(asset_data.asset_path)
Example 2: find red American signs
matches = asset_library.search(
include_all=[
SearchFilterArbitraryDictValue(["factory", "sign", "panel_color"], "red"),
SearchFilterCountry("usa"),
]
)
for asset_data in matches:
print(asset_data.asset_path)
Example 3: find people (or people-height objects), except for Chinese signs
matches = asset_library.search(
include_any=[SearchFilterClass("character"), SearchFilterHeight(minimum=1.55, maximum=1.95)],
exclude_all=[SearchFilterCountry("china"), SearchFilterClass("sign")],
)
for asset_data in matches:
print(asset_data.asset_path)
Querying all values for a filter
Example 4: query all possible values for Scene Point Of Interest (POI) tags
poi_tags = asset_library.get_all_values(SearchFilterScenePOI)
print(sorted(poi_tags))
Example 4a: find scenes that contain both parking and speed bumps
matches = asset_library.search(
include_all=[SearchFilterScenePOI("parking"), SearchFilterScenePOI("speedbump")],
)
for asset_data in matches:
print(asset_data.asset_path)
Feature validation filter
Example 5: find assets validated to have feature FET_005 with version 1.0.0
matches = asset_library.search(
include_all=[SearchFilterFeature("FET_005", version="1.0.0")], # version is optional
)
for asset_data in matches:
print(asset_data.asset_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simready_search-2026.4.2-py3-none-any.whl.
File metadata
- Download URL: simready_search-2026.4.2-py3-none-any.whl
- Upload date:
- Size: 44.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10193fabfe7a3cf56c93a559eb31069ccfb1d9fd6d162ffc2a2eb7318591f2e1
|
|
| MD5 |
b38e9bfae627f9d5626dc0433112bec2
|
|
| BLAKE2b-256 |
a71bf880cd2662ec1e4f40d307f2e9262a53bcdd71e3f7da0242bcd937001042
|