Skip to main content

Python consumer for the WPPBAV Fount API.

Project description

BAV API Python SDK

CI status coverage release status docs status 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.6
  • pandas >= 0.16.2
  • pydantic >= 2.0
  • tqdm >= 4.62
  • typing-extensions >= 3.10 for Python < 3.10

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 Fount API. Extended support for the audiences, brands, brandscape-data and studies endpoints.
    • Other endpoints are available via the raw_query functions and methods.
  • Validates query parameters are of the correct types.
    • Provides type hints for better IDE support.
  • Retrieve multiple pages of data simultaneously.
    • Monitors and prevents 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-0.8.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

wpp_bavapi-0.8.1-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wpp-bavapi-0.8.1.tar.gz
Algorithm Hash digest
SHA256 92de0121c97b6ef03ec299601c478193638b717a174fd1d39ab2ea02b66efb05
MD5 d3f5cbf57d8a8630394135f5e59e1e57
BLAKE2b-256 e6619fa29a68def688c825d3a0acdda7f7efec5497b7bf419d3ca31f5c11f6ee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wpp_bavapi-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cde76adfae236c7cd9077f28eb6aad0ac4255cd1e470dbb3e6472b4cfa39379
MD5 cbce95f4fe46272d440ffc6dd23b77ad
BLAKE2b-256 488a1b486d0a452ca596ca3aaeb15926d58cbe9f2b28a5764fcdae6ae68bf480

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