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")

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.1.0.tar.gz (11.8 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.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grafiki_bridge-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 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.1.0.tar.gz
Algorithm Hash digest
SHA256 48375c27ae1b6fec88c98dfaf90992d1f56a47ca10ea9606ecf1f352a098aeed
MD5 c7e7d0b49e211bffeaa22e4684f81dc7
BLAKE2b-256 c7d683960b5cbb8852c177feaf55b2842e8a7149e94739a8847d9a66fa33e1a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafiki_bridge-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: grafiki_bridge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0ccaf29abc39efe661d368efaca2dd331ae0c89bf6be379d10732c548d9ddb1
MD5 78f754a026ea326c057630af11e89b40
BLAKE2b-256 a829401d4ac5dfe1ab025e057e44fcd29860e2f0fb101525544068a46315a1ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafiki_bridge-0.1.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