Python consumer for the WPPBAV Fount API.
Project description
BAV API Python SDK
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.
- Extended support for the following endpoints:
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wpp-bavapi-1.0.4.tar.gz
.
File metadata
- Download URL: wpp-bavapi-1.0.4.tar.gz
- Upload date:
- Size: 48.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822f51a28ae1ed4ff5c60794f2a3a5054dc813e9111d13e97b7fdab7abe310cb |
|
MD5 | e9b6d5e2c16c2f67ea9bac1eb7ab3960 |
|
BLAKE2b-256 | 8af5d5a0a4cda0f5b34f772f8da6bc96855a43cf8a5a6ff3b7dbef2dbcc6c2cd |
File details
Details for the file wpp_bavapi-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: wpp_bavapi-1.0.4-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 408113f99ba6e706f52c7883cd9b5a4b32b4189e5f74a90b52de8020c63ac7e9 |
|
MD5 | 9a30dbe2d4bae20ea36d75b62eb18374 |
|
BLAKE2b-256 | 3bf43c6c9b611b2f3ba6f42573ff5c728bc4f9f170a09b939ace16246a181892 |