Skip to main content

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:

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.
  • Bulk-load large DataFrames with write_bulk(), which stages the data in chunks and runs COPY INTO instead of issuing INSERTs — with chunk_size, auto_create_table and overwrite options:
success, num_chunks, num_rows, _ = sf.write_bulk(
    df,
    table_name='AD_DISAPPROVAL_CURRENT',
    chunk_size=100_000,
    auto_create_table=True,
    overwrite=True,
)
  • 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. 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).

Metadata

Release files for fb-data 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fb-data 1.2.0
File Size Uploaded Provenance
fb_data-1.2.0.tar.gz 10.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fb-data 1.2.0
File Interpreter ABI Platform
fb_data-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / fb_data-1.2.0.tar.gz

Download URL fb_data-1.2.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b723fa6fd5aef6f61841a3f71d8ac0ac8ab96753315c9c20ca9e7e807b8f3d6
BLAKE2b-256 checksum
How to use checksums
4c5d216c5a854a5d2304e57dc311fd1648c5779934948e94a34a1d8e77bdde64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.6 Darwin/25.6.0

Release files / fb_data-1.2.0-py3-none-any.whl

Download URL fb_data-1.2.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96438d36380f63fa7dbdfb90b8d689caa3b7a0a389a58ca9354379ba6323ac78
BLAKE2b-256 checksum
How to use checksums
fdba7eb5c487a43fa6360ae0e2884bdb3f68ab1880ec7ab2ca4b7927031be43e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.6 Darwin/25.6.0

Security for fb-data 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page