Sitelet https://github.com/google/merchant-api-alpha-client#python
Skip to content

About

Google Merchant API Alpha Client Libraries

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Merchant API Alpha Client Libraries

Introduction

This repository contains the alpha version of the Merchant API. It is intended for testing and demonstration purposes to showcase experimental features and changes.

For more information on the API, please refer to the documentation for the Merchant API.

Disclaimer

Please be aware that contributions are not accepted through GitHub. For any feedback, suggestions, or support, please direct them to the Merchant API Support Form.

How to use the Alpha Libraries

The alpha client libraries are provided as tarballs within their respective API directories, under the path google/shopping/merchant/<api>/v1alpha, where <api> is the API name (e.g., reviews).

Below are instructions on how to install and use these libraries locally in your project. Replace <api> and <Api-Capitalized> with the actual values for the library you are using.

C# (.NET)

Option 1: Local NuGet Package (Recommended)

  1. Extract the tarball:
    tar -xf google/shopping/merchant/<api>/v1alpha/google-cloud-merchant-<api>-v1alpha-csharp.tar.gz
  2. Pack the project:
    cd google-cloud-merchant-<api>-v1alpha-csharp/Google.Shopping.Merchant.<Api-Capitalized>.V1Alpha
    dotnet pack -c Release -o ./nupkg
  3. Add the package to your project pointing to the local source:
    dotnet add package Google.Shopping.Merchant.<Api-Capitalized>.V1Alpha -s ./nupkg

Option 2: Direct Project Reference

If you prefer to reference the project directly in your .csproj:

<ItemGroup>
  <ProjectReference Include="path/to/extracted/google-cloud-merchant-<api>-v1alpha-csharp/Google.Shopping.Merchant.<Api-Capitalized>.V1Alpha/Google.Shopping.Merchant.<Api-Capitalized>.V1Alpha.csproj" />
</ItemGroup>

Go

Since these libraries are designed to be part of the google-cloud-go monorepo, you need to merge them into a local clone:

  1. Clone the public Go client library repository:
    git clone https://github.com/googleapis/google-cloud-go
    export CLOUD_GO=`pwd`/google-cloud-go
  2. Extract the alpha library tarball and copy the sources to your clone:
    tar -xf google/shopping/merchant/<api>/v1alpha/gapi-cloud-merchant-<api>-v1alpha-go.tar.gz
    cp -r ./cloud.google.com/go/* $CLOUD_GO/
  3. In your project's go.mod, redirect the dependency to your local clone:
    replace cloud.google.com/go => /path/to/local/google-cloud-go

Java

  1. Extract the tarball:
    tar -xf google/shopping/merchant/<api>/v1alpha/google-cloud-merchant-<api>-v1alpha-java.tar.gz
  2. Generate the Gradle wrapper and build and install to your local Maven cache (~/.m2). This requires a local Gradle installation:
    cd google-cloud-merchant-<api>-v1alpha-java
    gradle wrapper --gradle-version 7.6.4
    ./gradlew publishToMavenLocal
  3. Add the dependency to your project:
    • For Maven (pom.xml):
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>gapic-google-cloud-merchant-<api>-v1alpha-java</artifactId>
        <version>0.0.0-SNAPSHOT</version>
      </dependency>
    • For Gradle (build.gradle):
      implementation 'com.google.cloud:gapic-google-cloud-merchant-<api>-v1alpha-java:0.0.0-SNAPSHOT'

Node.js (TypeScript)

NPM supports local installs via the tarball package. Since the source may need compilation:

  1. Extract the tarball:
    tar -xf google/shopping/merchant/<api>/v1alpha/merchant-<api>-v1alpha-nodejs.tar.gz
  2. Build and pack the library:
    cd merchant-<api>-v1alpha-nodejs
    npm install
    npm pack
    This will generate a .tgz file (e.g., google-cloud-<api>-0.1.0.tgz or similar, check the output of npm pack).
  3. Install the generated .tgz in your target project:
    npm install /path/to/merchant-<api>-v1alpha-nodejs/<generated-file>.tgz

PHP

  1. Extract the tarball:
    tar -xf google/shopping/merchant/<api>/v1alpha/google-cloud-merchant-<api>-v1alpha-php.tar.gz
  2. Move the extracted folder into your PHP project.
  3. Configure your composer.json to require GAX and use classmap for autoloading:
    {
      "require": {
        "google/gax": "^1.34"
      },
      "autoload": {
        "classmap": [
          "google-cloud-merchant-<api>-v1alpha-php/src",
          "google-cloud-merchant-<api>-v1alpha-php/proto/src"
        ]
      }
    }
  4. Run composer update to regenerate the autoloader.

Python

You can install the library directly from the tarball using pip:

pip install google/shopping/merchant/<api>/v1alpha/merchant-<api>-v1alpha-py.tar.gz

Ruby

  1. Extract the tarball:
    tar -xf google/shopping/merchant/<api>/v1alpha/google-cloud-merchant-<api>-v1alpha-ruby.tar.gz
  2. Build and install the gem locally:
    cd google-cloud-merchant-<api>-v1alpha-ruby
    gem build google-cloud-merchant-<api>-v1alpha.gemspec
    gem install google-cloud-merchant-<api>-v1alpha-*.gem

About

Google Merchant API Alpha Client Libraries

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors