Skip to main content

Provides a management interface for camera and microphone devices in Google Colab.

Project description

ColabKit

ColabKit is a lightweight bridge between Python and JavaScript for Google Colab.
It allows you to load custom JavaScript tools, interact with the browser, control the webcam, capture frames, and build interactive Colab applications with minimal effort.

This package bundles two client-side JavaScript modules:

  • media.js – Camera control, frame capture, device switching
  • console.js – A styled typewriter-style console component

and provides a Python interface (ColabKit) that communicates with them through google.colab.output.


Features

  • Load and run custom JavaScript utilities inside Google Colab
  • Control the webcam (start/stop/change camera)
  • Capture image frames directly into Python as Base64
  • Monitor device changes (camera plugged/unplugged)
  • Display a browser-side animated console
  • Simple, clean and extensible API

Installation

pip install git+https://github.com/MuhammetOzturk/colabkit.git

Quick Start

1. Import the module

from colabkit import ColabKit
kit = ColabKit()

2. Load the JavaScript tools into the notebook

kit.loadTools(["media.js", "console.js"])

3. Start the camera

kit.startCamera()

4. Capture a frame

frame = kit.captureFrame()

5. List cameras

kit.listCameras()

6. Switch camera

kit.changeCamera("device-id-here")

7. Stop the camera

kit.stopCamera()

File Structure (for reference)

colabkit/
│
├── colabkit/
│   ├── __init__.py
│   ├── colabkit.py
│   └── static/
│       ├── console.js
│       ├── media.js
├── README.md
├── LICENSE
├── pyproject.toml
└── setup.cfg

Why ColabKit?

Google Colab allows JavaScript execution but provides no standard pattern for organizing JS tools or interacting with them from Python. ColabKit solves this problem by bundling JS modules and exposing clean, Python-friendly methods such as:

  • startCamera()
  • captureFrame()
  • watchDeviceChanges()
  • loadTools()

This makes it ideal for:

  • AI/computer-vision experiments
  • Real-time camera processing
  • Interactive notebooks
  • Educational tools
  • Browser-based demos

Requirements

  • Python 3.8+
  • Google Colab environment
  • google-colab Python package
  • IPython

License

MIT License


Author

Developed by Muhammet Ozturk
GitHub: https://github.com/muhammetozturk
Email: muhammetozturk.219@gmail.com

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

google_colabkit-0.0.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

google_colabkit-0.0.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file google_colabkit-0.0.0.2.tar.gz.

File metadata

  • Download URL: google_colabkit-0.0.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for google_colabkit-0.0.0.2.tar.gz
Algorithm Hash digest
SHA256 f314359cbd4ac015a06c5def58b03e2d43e46ed8129bc5dc59c6c312bcd8e642
MD5 82a9fb3370137fb8539dd840396f126c
BLAKE2b-256 80f6bfbb3074ee6e08bf1d5e0bd89dfb6a04600079415198af1a83051c271cf0

See more details on using hashes here.

File details

Details for the file google_colabkit-0.0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for google_colabkit-0.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9b6a6d1d08c5492db72e6281996a15179328452574c3b731fd7eb3ab578b04
MD5 c113fa736eca89b8050f341c318890b9
BLAKE2b-256 ec0022942e395353986b974c1ea52b2a522e616746c9808df5d77f6b41a7e19b

See more details on using hashes here.

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