Giter VIP home page Giter VIP logo

ibis-datasette's Introduction

ibis-datasette

github pypi binder

ibis-datasette provides a datasette backend for ibis. This lets you query any datasette server using a familiar dataframe-like API (rather than SQL).

Installation

ibis-datasette is available on pypi:

$ pip install ibis-datasette

Usage

Once installed, you can connect to any datasette server using the ibis.datasette.connect function. This takes the full URL to a database For example, to connect to the legislators database.

In [1]: import ibis

In [2]: con = ibis.datasette.connect("https://congress-legislators.datasettes.com/legislators")

Once connected, you can interact with tables using ibis just as you would a local sqlite database:

In [3]: ibis.options.interactive = True  # enable interactive mode

In [4]: con.list_tables()
Out[4]:
['executive_terms',
 'executives',
 'legislator_terms',
 'legislators',
 'offices',
 'social_media']

In [5]: t = con.tables.legislators  # access the `legislators` table

In [6]: t.name_first.topk(5)  # top 5 first names for legislators
Out[6]:
  name_first  count
0       John   1273
1    William   1024
2      James    721
3     Thomas    457
4    Charles    442

LICENSE

New BSD. See the License File.

ibis-datasette's People

Contributors

jcrist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.