A robust Python framework designed for managing and integrating data operations across multiple marketing and analytics platforms. D2B Data Framework provides modular, reusable classes to streamline ETL processes and data handling.
git clone [https://github.com/D2b-Innovation/d2b_dataframework.git](https://github.com/D2b-Innovation/d2b_dataframework.git)
cd d2b_dataframework
pip install -r requirements.txt
pip install git+[https://github.com/D2b-Innovation/d2b_dataframework.git](https://github.com/D2b-Innovation/d2b_dataframework.git)
| Module | Main Class | Description |
|---|---|---|
Facebook_Marketing |
Manage Ads Insights and campaign data. | |
| 📊 GA4 | Google_GA4 |
Fetch reports and real-time analytics data. |
| ☁️ BigQuery | Google_Bigquery |
Streamline SQL queries and data uploads. |
| 📈 Google Analytics | Google_Analytics |
Legacy Universal Analytics support. |
| 📝 Sheets | Google_Spreadsheet |
Read/Write operations on Google Sheets. |
| 🔑 Auth | Google_Token_MNG |
Manage OAuth2 tokens and credentials. |
Linkedin_Marketing |
Extract B2B marketing performance metrics. | |
| 🎵 TikTok | Tiktok |
Integration with TikTok Ads API. |
| 🐦 X (Twitter) | X_ads |
Handle X Ads data reporting. |
from d2b_data.Google_GA4 import Google_GA4
# 1. Initialize the client
ga4_client = Google_GA4('client_secret.json', 'token.json')
# 2. Fetch data
property_id = 'properties/YOUR_PROPERTY_ID'
query = { "dimensions": [{"name": "city"}], "metrics": [{"name": "activeUsers"}] }
df = ga4_client.get_report_df(property_id, query, realtime=True)
print(df.head())This project is licensed under the MIT License.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request