Skip to main content

Send data from Jupyter notebooks to the grafiki web dashboard.

Project description

Grafiki Bridge

A Python package that creates shareable, interactive data visualizations from pandas DataFrames through compressed URL links.

Overview

This package allows you to convert pandas DataFrames into compressed, browser-compatible links that open in the grafiki web application for interactive data exploration and visualization. For more information, please visit our wiki.

Features

  • 📊 Convert pandas DataFrames to interactive visualizations
  • 🔗 Generate shareable web links with data compression
  • 🌐 Cross-browser compatibility checking
  • 📈 Memory-efficient data encoding
  • ⚡ Quick data exploration and sharing

Installation

Install from PyPI:

pip install grafiki-bridge

Or install the latest development version:

pip install git+https://github.com/leberkaassemmel/grafiki-bridge.git

Usage

Basic Examples

To share a DataFrame in a jupyter notebook, use the show_bridge_link function:

import pandas as pd
import grafiki

# Create sample data
sample_data = {
    'year': [1949, 1949, 1949, 1950, 1950, 1950],
    'month': ['January', 'February', 'March', 'January', 'February', 'March'],
    'passengers': [112, 118, 132, 115, 126, 141]
}

df = pd.DataFrame(sample_data)

# Generate shareable visualization link
grafiki.show_bridge_link(df, 'My First Dataset')

For quick DataFrame sharing, use the bridge_df function:

import pandas as pd
from grafiki import bridge_df

# Load your data
df = pd.read_csv('your_data.csv')

# Quick link generation
link = bridge_df(df, name="Sales Data Q1", tags=["sales", "quarterly"])
print(f"Share your data: {link}")

# With custom base URL
link = bridge_df(df, 
                name="Custom Dataset",
                tags=["analysis", "2024"],
                base_url="https://custom.grafiki.app")

Colab Example

Check out the colab notebook: grafiki Tutorial

What You Get

When you run show_bridge_link(), you'll see:

  • Dataset Overview: Rows, columns, and memory usage
  • Compression Stats: Data compression ratio and space saved
  • Browser Compatibility: Automatic detection and compatibility checking
  • Shareable Link: Direct URL to open your data in the Grafiki web app

Key Benefits

  • Browser Optimized: Checks URL length limits for different browsers
  • Instant Sharing: No need to upload files - data is encoded in the URL
  • Privacy Friendly: Data stays in your control through URL encoding

Browser Compatibility

The tool automatically detects your browser and shows compatibility:

  • Chrome/Edge: Up to ~2MB of data
  • Firefox: Up to ~64KB of data
  • Safari: Up to ~80KB of data

Requirements (automatically installed with the package)

  • Python 3.6+
  • pandas

Getting Started

  1. Install the package: pip install grafiki-bridge
  2. Import and use in your Python environment:
import pandas as pd
import grafiki

# Your DataFrame
df = pd.read_csv('your_data.csv')

# Generate shareable link
grafiki.show_bridge_link(df, 'Your Dataset Name')

Use Cases

Perfect for:

  • Quick data sharing with colleagues
  • Creating portable data visualizations
  • Prototyping data analysis workflows
  • Educational demonstrations
  • Lightweight data distribution

Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Development Setup

git clone https://github.com/yourusername/grafiki-bridge.git
cd grafiki-bridge
pip install -e ".[dev]"

License

This project is open source and available under the MIT License.

AI Assistance Disclosure

This project uses AI tools to assist with development, including:

  • Code generation and optimization
  • Documentation writing
  • Test case generation
  • Code review assistance

All AI-generated content is reviewed and validated by human maintainers before inclusion.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grafiki_bridge-0.2.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grafiki_bridge-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file grafiki_bridge-0.2.0.tar.gz.

File metadata

  • Download URL: grafiki_bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grafiki_bridge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 59d24db30236f87e0cf5e6856f96cbe6a7ca178609b9d68b26b033242278d76d
MD5 9dc1f9810648b3bde6b08523ae31a32e
BLAKE2b-256 018f8e200bc7876b7425065c8dc22438aa1d9b0cb09d8b724b6a9dc286054be8

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafiki_bridge-0.2.0.tar.gz:

Publisher: python-publish.yml on leberkaassemmel/grafiki-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grafiki_bridge-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: grafiki_bridge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grafiki_bridge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27fab9fa7b95ed7c6065a85fc5e45358119020df6dc766f383ff4a5f9f2cab5f
MD5 3d252a3627afb5bbb0cb64e9aeacca05
BLAKE2b-256 48b522b393fee09c71773870ab0367f4eda16e1d1cd8abf279aae6a506ce36c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafiki_bridge-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on leberkaassemmel/grafiki-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page