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.

Source Distribution

special_snowflake-0.0.7.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file special_snowflake-0.0.7.tar.gz.

File metadata

File hashes

Hashes for special_snowflake-0.0.7.tar.gz
Algorithm Hash digest
SHA256 42ef2f7c96ed9bef8c6378c00fc3013c28bf52470132aa9452cd233196630762
MD5 04503309148eab8d61320dec81d8bda4
BLAKE2b-256 b01a4e630dd58db7c7f0408d345035cbe312674b436fe534fcc7d1522c6cafaa

See more details on using hashes here.

Supported by

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