Skip to content

Commit e0e5ce2

Browse files
feat: Add support for the v2 API (#11566)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent a971664 commit e0e5ce2

40 files changed

Lines changed: 10315 additions & 19 deletions

packages/google-cloud-language/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-language/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ We support:
236236

237237
Supported versions can be found in our ``noxfile.py`` `config`_.
238238

239-
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
239+
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-language/noxfile.py
240240

241241

242242
**********

packages/google-cloud-language/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-language/README.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps:
3636
Installation
3737
~~~~~~~~~~~~
3838

39-
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
40-
create isolated Python environments. The basic problem it addresses is one of
41-
dependencies and versions, and indirectly permissions.
39+
Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
40+
creates isolated Python environments. These isolated environments can have separate
41+
versions of Python packages, which allows you to isolate one project's dependencies
42+
from the dependencies of other projects.
4243

43-
With `virtualenv`_, it's possible to install this library without needing system
44+
With `venv`_, it's possible to install this library without needing system
4445
install permissions, and without clashing with the installed system
4546
dependencies.
4647

47-
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
48+
.. _`venv`: https://docs.python.org/3/library/venv.html
4849

4950

5051
Code samples and snippets
5152
~~~~~~~~~~~~~~~~~~~~~~~~~
5253

53-
Code samples and snippets live in the `samples/` folder.
54+
Code samples and snippets live in the `samples/`_ folder.
55+
56+
.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-language/samples
5457

5558

5659
Supported Python Versions
@@ -77,21 +80,19 @@ Mac/Linux
7780

7881
.. code-block:: console
7982
80-
pip install virtualenv
81-
virtualenv <your-env>
83+
python3 -m venv <your-env>
8284
source <your-env>/bin/activate
83-
<your-env>/bin/pip install google-cloud-language
85+
pip install google-cloud-language
8486
8587
8688
Windows
8789
^^^^^^^
8890

8991
.. code-block:: console
9092
91-
pip install virtualenv
92-
virtualenv <your-env>
93-
<your-env>\Scripts\activate
94-
<your-env>\Scripts\pip.exe install google-cloud-language
93+
py -m venv <your-env>
94+
.\<your-env>\Scripts\activate
95+
pip install google-cloud-language
9596
9697
Next Steps
9798
~~~~~~~~~~

packages/google-cloud-language/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2021 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

packages/google-cloud-language/docs/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ API Reference
2222
language_v1beta2/services
2323
language_v1beta2/types
2424

25+
API Reference
26+
-------------
27+
.. toctree::
28+
:maxdepth: 2
29+
30+
language_v2/services
31+
language_v2/types
32+
2533

2634
Changelog
2735
---------
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
LanguageService
2+
---------------------------------
3+
4+
.. automodule:: google.cloud.language_v2.services.language_service
5+
:members:
6+
:inherited-members:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Services for Google Cloud Language v2 API
2+
=========================================
3+
.. toctree::
4+
:maxdepth: 2
5+
6+
language_service
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Types for Google Cloud Language v2 API
2+
======================================
3+
4+
.. automodule:: google.cloud.language_v2.types
5+
:members:
6+
:show-inheritance:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from google.cloud.language_v2 import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
20+
21+
from .services.language_service import LanguageServiceAsyncClient, LanguageServiceClient
22+
from .types.language_service import (
23+
AnalyzeEntitiesRequest,
24+
AnalyzeEntitiesResponse,
25+
AnalyzeSentimentRequest,
26+
AnalyzeSentimentResponse,
27+
AnnotateTextRequest,
28+
AnnotateTextResponse,
29+
ClassificationCategory,
30+
ClassifyTextRequest,
31+
ClassifyTextResponse,
32+
Document,
33+
EncodingType,
34+
Entity,
35+
EntityMention,
36+
ModerateTextRequest,
37+
ModerateTextResponse,
38+
Sentence,
39+
Sentiment,
40+
TextSpan,
41+
)
42+
43+
__all__ = (
44+
"LanguageServiceAsyncClient",
45+
"AnalyzeEntitiesRequest",
46+
"AnalyzeEntitiesResponse",
47+
"AnalyzeSentimentRequest",
48+
"AnalyzeSentimentResponse",
49+
"AnnotateTextRequest",
50+
"AnnotateTextResponse",
51+
"ClassificationCategory",
52+
"ClassifyTextRequest",
53+
"ClassifyTextResponse",
54+
"Document",
55+
"EncodingType",
56+
"Entity",
57+
"EntityMention",
58+
"LanguageServiceClient",
59+
"ModerateTextRequest",
60+
"ModerateTextResponse",
61+
"Sentence",
62+
"Sentiment",
63+
"TextSpan",
64+
)

0 commit comments

Comments
 (0)