Metadata-Version: 2.4
Name: fb-data
Version: 1.1.0
Summary: Python package with helper functions for the Data team.
License: MIT
License-File: LICENSE
Author: markostefanovic1
Author-email: marko.stefanovic@fishingbooker.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: SQLAlchemy (>=1.4,<3.0)
Requires-Dist: cryptography (>=3.4)
Requires-Dist: google-api-python-client (>=2.0,<3.0)
Requires-Dist: google-auth (>=2.0,<3.0)
Requires-Dist: pandas (>=1.3.0,<3.0)
Requires-Dist: snowflake-connector-python (>=3.7.0,<4.0)
Requires-Dist: snowflake-sqlalchemy (>=1.4.7,<2.0)
Description-Content-Type: text/markdown

# fb_data

**fb_data** is a Python package maintained by the Data team at FishingBooker which simplifies data workflows by providing helper functions for interacting with:
- **Snowflake**: Streamlined connection, query execution, Pandas integration, and privilege management.
- **Google Analytics (GA4)**: Query analytics data in raw or Pandas DataFrame format.
- **Google Search Console**: Extract search performance data efficiently.

---

## 📦 Installation

Install the package using pip:

```bash
pip install fb_data
```

## 📚 Supported Modules

### 1. Snowflake Helper
The Snowflake module provides methods to interact with your Snowflake database.

Features:

- Easy connection to Snowflake without the need to import multiple libraries.
- Password and key-pair authentication: pass `user`/`password`, or `private_key_pem` (PEM string, e.g. from `dbutils.secrets.get`) with an optional `private_key_passphrase`.
- Execute SQL queries with results in raw or Pandas DataFrame format.
- Write Pandas DataFrames to Snowflake tables.
- Easily manages database, schema, and object privileges, allowing multiple commands to be executed in a single execution.

### 2. Google Analytics Helper
Simplifies interactions with Google Analytics API (GA4).

Features:

- Query analytics data with custom dimensions and metrics.
- Retrieve results in raw or Pandas DataFrame format.

### 3. Google Search Console Helper
Provides easy access to Google Search Console API.

Features:
- Extract search performance data for specific dimensions and metrics.
- Retrieve results in raw or Pandas DataFrame format.
- Handle large data extractions with pagination support.

## 🤝 Contributing

- Ensure you have Poetry installed for dependency management and packaging.
- This project follows [Semantic Versioning 2.0.0](https://semver.org/). When making changes, increment the version number in the pyproject.toml file based on the nature of the change:
  - Patch: Bug fixes or minor updates (e.g., 1.0.0 → 1.0.1).
  - Minor: New features that are backward-compatible (e.g., 1.0.0 → 1.1.0).
  - Major: Breaking changes (e.g., 1.0.0 → 2.0.0).

