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.1

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.1
File Size Uploaded Provenance
fb_data-1.2.1.tar.gz 10.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 21.6 kB

Release files / fb_data-1.2.1.tar.gz

Download URL fb_data-1.2.1.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5889bac989a2ad04ee5494b2499c5f558a21f9b72de160e005c67c33f0f5ba3e
BLAKE2b-256 checksum
How to use checksums
afff5bd957d5fbc2a70e048c268967e095e34a43dbde2c8c6129fac3c4c5027f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.6 Darwin/27.0.0

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

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

Security for fb-data 1.2.1

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