Helpers to request bing API
Project description
Arcane bing
This package is based on bingads.
Get Started
pip install arcane-bing
Example Usage
Reporting
bing_client = Client(
credentials=Config.BING_ADS_CREDENTIALS,
secrets_bucket=Config.SECRETS_BUCKET,
refresh_token_location=Config.BING_ADS_REFRESH_TOKEN,
storage_client=storage_client
)
reporting_service_manager, reporting_service = bing_client.get_bing_ads_api_client()
report_request = build_campaigns_report(reporting_service, bing_account_id)
result_file_path = bing_client.submit_and_download(report_request, reporting_service_manager)
Campaign Service
:warning: For some API methods, you must provide the client's account id and the manager's customer id
from arcane.bing import Client
from arcane.bing.helpers import parse_webfault_errors, parse_bing_response
bing_client = Client(
credentials=Config.BING_ADS_CREDENTIALS,
secrets_bucket=Config.SECRETS_BUCKET,
refresh_token_location=Config.BING_ADS_REFRESH_TOKEN,
storage_client=storage_client,
customer_id=CUSTOMER_ID,
account_id=ACCOUNT_ID
)
campaign_service = bing_client.get_service_client(service_name='CampaignManagement')
try:
response = campaign_service.GetCampaignsByAccountId(AccountId=ACCOUNT_ID)
all_campaigns = parse_bing_response(response)['Campaign']
# do stuff with all_campaigns
except WebFault as e:
bing_error = parse_webfault_errors(e)
# do stuff with bing_error
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
arcane_bing-0.5.8.tar.gz
(5.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arcane_bing-0.5.8.tar.gz.
File metadata
- Download URL: arcane_bing-0.5.8.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773ac180e3c0146593848a6166ecf82a3aaf9d2838baf7ecb31608a483556f3f
|
|
| MD5 |
be721eb532d70869b0fbbb67594a4c8a
|
|
| BLAKE2b-256 |
66d80a103eb0062116d9b155202c63be1a2eab97569b848f038a082e858c9fe6
|
File details
Details for the file arcane_bing-0.5.8-py3-none-any.whl.
File metadata
- Download URL: arcane_bing-0.5.8-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f4968ed27d993af3e0727ff29c7b20a78706211abc61b0908452e8671fdf9ef
|
|
| MD5 |
5a7d0b83192e82ead437e300b468312b
|
|
| BLAKE2b-256 |
dc00348954b982709a09914502b38167527081b57d1281f98032adcdb3d5e7b1
|