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.6.tar.gz
(5.4 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.6.tar.gz.
File metadata
- Download URL: arcane_bing-0.5.6.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dccb2fbcfbf9692f65b13711fbe7cddda578c5a5628d1b696995783031f89e99
|
|
| MD5 |
4a62c01b2c8427fe17fc4ad02cb2cd96
|
|
| BLAKE2b-256 |
f95358db9a95669ebf01600fbbc7a0faa757891a203045519cfae764a4b68222
|
File details
Details for the file arcane_bing-0.5.6-py3-none-any.whl.
File metadata
- Download URL: arcane_bing-0.5.6-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b77c633c1514240e39c0a7f44b61b8c1e900250f95e3f20479a6486b84d88a7
|
|
| MD5 |
4931c86f9208ca9734c5fdd322889a13
|
|
| BLAKE2b-256 |
545cf337a56c7a70db527def0873141cb52cf364d5e537c775d4ee9393e365d8
|