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.8.tar.gz (2.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for special_snowflake-0.0.8.tar.gz
Algorithm Hash digest
SHA256 2d9e8ca4e49883a8bc44e55418b0b03250b313d9cd3079e89ab5a7180704388c
MD5 d6a96e04af1b607f12853fac98ef2f8c
BLAKE2b-256 8180b3954b209f66cee37b84f87f05f36b9aa9b33924403d3945173ee97f2d04

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