Skip to main content

dfbrowse

Python library that provides spreadsheet-style browsing of a Pandas dataframe within a terminal/curses environment.

It was borne out of my love for curses-style/modal interfaces, and a frustration with how difficult it is to really navigate/browse/inspect a large dataframe while you're operating on it within IPython.

Image visible on GitHub

Installation

pip install dfbrowse

Getting started

dfbrowse is generally intended to be used inside IPython. Start by launching IPython, then import the IPython magics:

import dfbrowse.ipython_main

If you want to jump straight into browsing, load a parquet or CSV directly:

%csv ~/work/project1/employees.csv emp
%pq ~/work/project2/my_data.parquet data

If you've already loaded a dataframe, browse it like so:

import pandas as pd

emp = pd.read_parquet('~/work/project2/my_data.parquet')

%show emp

Inside the browser

Once inside the browser, you can navigate with arrow keys and the mouse.

Press ? to find out about some basic browsing commands. You can resize columns, hide them, reorder them, and even search the row contents, with a few keystrokes.

There are many other commands that you can discover in keybindings.py.

There are even more commands that can be discovered by typing / and then pressing TAB. These are pre-registered functions, such as str_match and query, that perform some operation on a dataframe. The returned dataframe will be rendered in the browser.

In theory it is possible to write and register your own dataframe functions as well, but this is a topic for a much larger document and I'm not sure how well it's working anyway. If you want to do complex transforms on your dataframe, you're probably better off to drop back into the IPython 'shell', do your work, and then jump back into the browser with one of the options above.

quitting and reentering

You can use q on your keyboard to go back to the shell/ipython session.

Re-enter the browser via %show <df_name>, or %fg to foreground the most recent dataframe.

bugs

There are lots. I even know about some of them. Please feel free to report any you find on GitHub.

Metadata

Release files for dfbrowse 0.1.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 dfbrowse 0.1.1
File Size Uploaded
dfbrowse-0.1.1.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dfbrowse 0.1.1
File Interpreter ABI Platform
dfbrowse-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 57.8 kB

Release files / dfbrowse-0.1.1.tar.gz

Download URL dfbrowse-0.1.1.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c0000100df5495d1f01f7d007c68ec2ff83ca335c82928e2a321ff586982a2c6
BLAKE2b-256 checksum
How to use checksums
af6f907c39a7087b861553c3a2556d363d4b57bce6cbc2fc390a653f07919f3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.12

Release files / dfbrowse-0.1.1-py3-none-any.whl

Download URL dfbrowse-0.1.1-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f16bcba93d439ab8eff2d95bb79e45b326a5385892288d48cb2100aaae903098
BLAKE2b-256 checksum
How to use checksums
8ff3ae307f7043320e029be4f2d2f82c32ecbab3b5d3b98861c654287876a58e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.12

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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