Skip to main content

A curated collection of datasets for data analysis & machine learning, downloadable with a single Python command

Project description

opendatasets

opendatasets is a Python library for downloading datasets from online sources like Kaggle and Google Drive using a simple Python command.

Installation

Install the library using pip:

pip install opendatasets --upgrade

Usage - Downloading a dataset

Datasets can be downloaded within a Jupyter notebook or Python script using the opendatasets.download helper function. Here's some sample code for downloading the US Elections Dataset:

import opendatasets as od
dataset_url = 'https://www.kaggle.com/tunguz/us-elections-dataset'
od.download('https://www.kaggle.com/tunguz/us-elections-dataset')

Kaggle Credentials

opendatasets uses the Kaggle Official API for donwloading dataset from Kaggle. Follow these steps to find your API credentials:

  1. Sign in to https://kaggle.com/, then click on your profile picture on the top right and select "My Account" from the menu.

  2. Scroll down to the "API" section and click "Create New API Token". This will download a file kaggle.json with the following contents:

{"username":"YOUR_KAGGLE_USERNAME","key":"YOUR_KAGGLE_KEY"}
  1. When you run opendatsets.download, you will be asked to enter your username & Kaggle API, which you can get from the file downloaded in step 2.

Note that you need to download the kaggle.json file only once.

Some interesting datasets

You can find interesting datasets on Kaggle: https://www.kaggle.com/datasets

You can also create a new dataset on Kaggle by uploading a CSV file here: https://www.kaggle.com/datasets?new=true (make sure to keep your dataset public, otherwise it will not be downloadable)

Other sources to look for datasets:

If you use an external source other than Kaggle, you'll create a new dataset on Kaggle by uploading a CSV file here: https://www.kaggle.com/datasets?new=true (make sure to keep your dataset public, otherwise it will not be downloadable using opendatasets)

Curated Datasets

opendatasets also provides some curated datsets that you can download by passing the Dataset ID to opendatasets.download. Here's an example:

import opendatasets
opendatasets.download('stackoverflow-developer-survey-2020')

The following datasets are available for download.

Dataset ID Description Source
stackoverflow-developer-survey-2020 Stack Overflow Developer Survey 2020 Stack Overflow
owid-covid-19-latest Covid-19 Stats by Our World in Data Our World in Data
state-of-javascript-2016 State of Javascript Annual Survey 2016 StateOfJS
state-of-javascript-2017 State of Javascript Annual Survey 2017 StateOfJS
state-of-javascript-2018 State of Javascript Annual Survey 2018 StateOfJS
state-of-javascript-2019 State of Javascript Annual Survey 2019 StateOfJS
countries-languages-spoken Languages Spoken in Different Countries Infoplease

More datasets will be added soon..

Contributing

This is an open source project and we welcome contributions.

Local Development Setup

  1. Clone the repository:
git clone https://github.com/JovianML/opendatasets.git
  1. Setup the Python environment for development
conda create -n opendatasets python=3.5
conda activate opendatasets
pip install -r requirements.txt
  1. Open up the project in VS code and make your changes. Make sure to install the Python Extension for VS Code and select the opendatasets conda environment.

Adding Datasets

TODO - more details will be added here later

This package is developed and mainted by the Jovian.ml team.

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

opendatasets-0.1.19.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendatasets-0.1.19-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file opendatasets-0.1.19.tar.gz.

File metadata

  • Download URL: opendatasets-0.1.19.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for opendatasets-0.1.19.tar.gz
Algorithm Hash digest
SHA256 94af0103cfd714bfa335d2854697df71d8e1efb57d27338f14aff474c909b16e
MD5 311d9f2b875e91c26c13ddd09eec49ab
BLAKE2b-256 a9f93902f859991019cf297ecd872f8fe8c2c2f6c0f686717a31967b270c1f8a

See more details on using hashes here.

File details

Details for the file opendatasets-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: opendatasets-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for opendatasets-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 0e4af2854fe53965f0cb18a18c424cded40e76adfed9ca59c44ab85f9296fa28
MD5 abe00bf2f9d50dc77adcfa7f6a18ceb3
BLAKE2b-256 11a24bdaef0ea5c506ab4367b6287963e4079d92343c8278064b84a8f668914b

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