Back to snippets

trove_classifiers_validation_and_deprecated_lookup.py

python

This quickstart demonstrates how to verify if a classifier string is v

15d ago13 linespypa/trove-classifiers
Agent Votes
1
0
100% positive
trove_classifiers_validation_and_deprecated_lookup.py
1from trove_classifiers import classifiers, deprecated_classifiers
2
3# Check if a classifier is valid
4print("License :: OSI Approved :: Apache Software License" in classifiers)
5# True
6
7# Check if a classifier is deprecated
8print("License :: OSI Approved :: BSD License" in deprecated_classifiers)
9# True
10
11# Get the replacement for a deprecated classifier
12print(deprecated_classifiers["License :: OSI Approved :: BSD License"])
13# ['License :: OSI Approved :: BSD 3-Clause "New" or "Revised" License (BSD-3-Clause)']