steering_docs/python-tech/metadata.md
Generate documentation metadata files that integrate with AWS Documentation pipeline for snippet extraction and cross-referencing.
.doc_gen/metadata/
├── {service}_metadata.yaml # Service metadata file
CRITICAL: Always read scenarios/basics/{service}/SPECIFICATION.md first for metadata requirements.
Look for the metadata table:
## Metadata
|action / scenario |metadata file |metadata key |
|--- |--- |--- |
|`CreateDetector` |{service}_metadata.yaml |{service}_CreateDetector |
|`GetDetector` |{service}_metadata.yaml |{service}_GetDetector |
|`Service Basics Scenario` |{service}_metadata.yaml |{service}_Scenario |
NEVER create custom metadata keys when specification defines them. Use the exact keys from the specification table.
# .doc_gen/metadata/{service}_metadata.yaml
{service}_CreateResource:
title: Create a &{ServiceAbbrev}; resource
title_abbrev: Create a resource
synopsis: create a &{ServiceAbbrev}; resource.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/{service}
excerpts:
- description:
snippet_tags:
- python.example_code.{service}.CreateResource
services:
{service}: {CreateResource}
{service}_GetResource:
title: Get a &{ServiceAbbrev}; resource
title_abbrev: Get a resource
synopsis: get a &{ServiceAbbrev}; resource.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/{service}
excerpts:
- description:
snippet_tags:
- python.example_code.{service}.GetResource
services:
{service}: {GetResource}
{service}_Scenario:
title: Get started with &{ServiceAbbrev}; resources
title_abbrev: Get started with resources
synopsis: learn the basics of &{ServiceAbbrev}; by creating resources and managing them.
category: Scenarios
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/{service}
excerpts:
- description: Create a {Service} wrapper class to manage operations.
snippet_tags:
- python.example_code.{service}.{Service}Wrapper
- description: Run an interactive scenario demonstrating {Service} basics.
snippet_tags:
- python.example_code.{service}.{Service}Scenario
services:
{service}: {CreateResource, GetResource, ListResources, DeleteResource}
{service}_Hello:
title: Hello &{ServiceAbbrev};
title_abbrev: Hello &{ServiceAbbrev};
synopsis: get started using &{ServiceAbbrev};.
category: Hello
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/{service}
excerpts:
- description:
snippet_tags:
- python.example_code.{service}.Hello
services:
{service}: {ListResources}
All code must include proper snippet tags that match metadata:
# snippet-start:[python.example_code.{service}.{ActionName}]
def action_method(self):
"""Action implementation"""
pass
# snippet-end:[python.example_code.{service}.{ActionName}]
# snippet-start:[python.example_code.{service}.{Service}Wrapper]
class {Service}Wrapper:
"""Wrapper class implementation"""
pass
# snippet-end:[python.example_code.{service}.{Service}Wrapper]
# snippet-start:[python.example_code.{service}.{Service}Scenario]
class {Service}Scenario:
"""Scenario class implementation"""
pass
# snippet-end:[python.example_code.{service}.{Service}Scenario]
# snippet-start:[python.example_code.{service}.Hello]
def hello_{service}():
"""Hello implementation"""
pass
# snippet-end:[python.example_code.{service}.Hello]
Common service abbreviations for metadata:
Individual service operations (CreateResource, GetResource, etc.)
Multi-step workflows demonstrating service usage
Simple introduction examples
Examples spanning multiple AWS services
# Validate metadata with writeme tool
cd .tools/readmes
python -m writeme --languages Python:3 --services {service}