Skip to main content

Find the unique indices for a dataset

Project description

Because datasets are often provided with scant metadata, I want to infer some of the conventional metadata without depending on special information. One such sort of metadata is the schema of the dataset.

Special snowflake looks for unique identifiers in arbitrary datasets. Run it like so.

$ snowflake bus_stops.csv
route.number, stop.id, n.students
time, n.students, location
route.name, n.students, location
route.name, stop.id
route.number, stop.id, time

By default, you get all of the combinations of up to three columns inside bus_stops.csv that function as unique indices on the full spreadsheet.

Or call it from Python!

from special_snowflake import fromcsv
from pprint import pprint
with open('open-data-index.csv') as fp:
    pprint(fromcsv(csv.DictReader(fp), n_columns = 2, only_adjacent = False))

This program finds all of the combinations of one or two columns inside open-data-index.csv that function as unique indices on the full spreadsheet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for special_snowflake, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size special_snowflake-0.0.8.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page