Skip to main content

Generating GAQL tool

Project description

GAQL Builder Version MIT License

Generating GAQL (Google Ads Query Language) tool, it is not official library. Would you like to build GAQL string more easier, you can use this tool, but it would not be validated entirely for all of posible pairing.

Please follow official documentation.

Requirements

  • Python 2.7.13+ / 3.5.3+
  • pip

Installation

  $ pip instal gaql-builder

Usage

If you want to generate the following query string,

SELECT
 campaign.id,
 campaign.name
FROM
 campaign
WHERE
 campaign.resource_name = 'customers/1234567/campaigns/987654'

you can use functional call to make it out.

    builder = GAQLBuilder()
    builder.select(['campaign.id', 'campaign.name'])
    builder.resource_from('campaign')
    builder.where("campaign.resource_name = 'customers/1234567/campaigns/987654'")
    builder.to_string()

also, you can use add_where function to add condition.

    builder = GAQLBuilder()
    builder.select(['campaign.id', 'campaign.name'])
    builder.resource_from('campaign')
    builder.add_where(
        field='campaign.resource_name',
        operator='=',
        value="'customers/1234567/campaigns/987654'"
    )

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gaql-builder, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size gaql_builder-1.0.1-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gaql-builder-1.0.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page