An ibis backend for querying datasette
Project description
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.
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
ibis-datasette-0.2.0.tar.gz
(24.5 kB
view hashes)
Built Distribution
Close
Hashes for ibis_datasette-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbdecf587f5b54d2bc45c7fa44afc299d14cad0a28208fc139d5bbe57fae1d6b |
|
MD5 | afca15b5f9ff3f1497e68782734dba1a |
|
BLAKE2b-256 | f26f562d95ec2f3a99d5f34a88e6933ad08c88fea5d3fba05a76553a27fb92c3 |