Skip to main content

No project description provided

Project description

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.

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

dfbrowse-0.1.1.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

dfbrowse-0.1.1-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file dfbrowse-0.1.1.tar.gz.

File metadata

  • Download URL: dfbrowse-0.1.1.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for dfbrowse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c0000100df5495d1f01f7d007c68ec2ff83ca335c82928e2a321ff586982a2c6
MD5 84204b40bdf027c9a0f10d308634f922
BLAKE2b-256 af6f907c39a7087b861553c3a2556d363d4b57bce6cbc2fc390a653f07919f3e

See more details on using hashes here.

File details

Details for the file dfbrowse-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dfbrowse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for dfbrowse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f16bcba93d439ab8eff2d95bb79e45b326a5385892288d48cb2100aaae903098
MD5 6a2a410e4b95423c512c11ae8c53a80a
BLAKE2b-256 8ff3ae307f7043320e029be4f2d2f82c32ecbab3b5d3b98861c654287876a58e

See more details on using hashes here.

Supported by

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