Search code examples
pythongoogle-cloud-platformenumsgoogle-cloud-visiongoogle-cloud-python

How in Python do i use a GCP enum?


How do I use the GCP enum Text​Annotation.​Types.​Detected​Break.​Types.​Break​Type in my python code? I assume I import it somehow, but do not know how.


Solution

  • It looks like you're linking to the .NET docs, but asking about Python. If you want to use these enums from Python, you'll first need to install the Google Cloud Vision client library from PyPI:

    $ pip install google-cloud-vision
    

    Then you can access the enums like this:

    >>> from google.cloud import vision
    >>> vision.TextAnnotation.DetectedBreak.BreakType
    <enum 'BreakType'>