Skip to main content

Python consumer for the WPPBAV Fount API.

Project description

BAV API Python SDK

CI status release status docs status coverage PyPI PyPI - Python Version

bavapi is a Python SDK for the WPP BAV API.

It is published on PyPI as wpp-bavapi.

With bavapi you can access the full BAV data catalog, the largest and most comprehensive database of brand data in the world.

Queries are validated automatically thanks to pydantic and retrieved asynchronously via the httpx package.

For more information about the API, go to the WPPBAV Developer Hub.

Prerequisites

bavapi requires Python 3.8 or higher to run.

If you don't have Python installed, you can find it from the official website or via Anaconda.

You will also need a BAV API token. For more information, go to the Authentication section of the API documentation.

Dependencies

  • httpx >= 0.20
  • nest-asyncio >= 1.5
  • pandas >= 1.0
  • pydantic >= 2.0
  • tqdm >= 4.62
  • typing-extensions >= 4.6 for Python < 3.12

Installation

bavapi can be installed using pip:

pip install wpp-bavapi

Installing from source

To install from source, clone the GitHub repository into your local machine:

git clone https://github.com/wppbav/bavapi-sdk-python.git

Go into the cloned directory and install bavapi:

cd bavapi-sdk-python
pip install .

Usage

Once you have acquired a token, you can start using this library directly in python or in a Jupyter Notebook:

>>> import bavapi
>>> result = bavapi.brands("TOKEN", name="Swatch")  # Replace `"TOKEN"` with your BAV API token
>>> result
sector_id sector_name id name ...
0 233 Apparel & Accessories 8635 Swatch ...
... ... ... ... ... ...

Features

  • Support for all endpoints in the WPPBAV Fount API.
    • Extended support for the following endpoints:
      • audiences
      • brand-metrics
      • brand-metric-groups
      • brands
      • brandscape-data
      • categories
      • cities
      • collections
      • companies
      • countries
      • sectors
      • studies
      • years
    • Other endpoints are available via the raw_query functions and methods.
  • Validates query parameters are of the correct types and provides type hints for better IDE support.
  • Retrieve multiple pages of data simultaneously, monitoring and preventing exceeding API rate limit.
  • Both synchronous and asynchronous APIs for accessing BAV data.

Documentation

Read more about bavapi in the documentation.

Issues

Please file an issue on GitHub here.

Contributing

Please see the Contributing section of the documentation for more information.

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

wpp-bavapi-1.0.3.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

wpp_bavapi-1.0.3-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file wpp-bavapi-1.0.3.tar.gz.

File metadata

  • Download URL: wpp-bavapi-1.0.3.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for wpp-bavapi-1.0.3.tar.gz
Algorithm Hash digest
SHA256 038d215865d0815a613d9ae471a809d0b1a2e248ce4450483d88923dd31f33d7
MD5 70820ca3fb01bb2df9aa548b12b44949
BLAKE2b-256 f18c34fe1f1ba1f451360b8f176034582b17650d24096af39d31b591f277b506

See more details on using hashes here.

File details

Details for the file wpp_bavapi-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: wpp_bavapi-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for wpp_bavapi-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d476624f97e094160a27d486797b6699fb665020b95a6ee5c6e89e9da343e1f
MD5 2f99a18ed5edec254759c56b25ced37b
BLAKE2b-256 15a619a2a8f6c4570aff2bfddd6796a7f536ad9ec38b617c4bc52b16ef33df50

See more details on using hashes here.

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