This is commonly done with instance
An EC2 instance can have any number of tags in key:value format. They are often used liberally to help further processes identify instance roles/types/environments/etc
Since you mentioned Python, I assume you're using BOTO. Check the boto documentation, you can even filter on certain tags: https://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_instances
Noted on that doc page:
tag :key =*value* - The key/value combination of a tag assigned to the resource. Specify the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag Purpose=X, specify tag:Purpose for the filter name and X for the filter value.
Furthering the example from the docs:
Other than BOTO, many other AWS interaction utilities will often have a similar filter or query system based on instance tagging. Like Ansible, etc.
Screenshot of the instance tags panel in the EC2 console: