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.

Source Distribution

gaql-builder-1.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

gaql_builder-1.0.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page