Skip to main content

Download #TidyTuesday data

Project description

tidytuesdayPy

Download TidyTuesday data. Inspired by tidytuesdayR.

Usage

from tidytuesday import TidyTuesday

tt = TidyTuesday("2021-04-06")

If you do not provide a date (i.e. just TidyTuesday()), then the latest TidyTuesday will be used. Note that this will not be good for reproducability in the future!

You can then access each data set from the data field using the filename, dropping the extension.

df = tt.data["forest"]

You can also access the readme if one exists.

print(tt.readme)

Polars

If you want to use Polars, you can pass the module to the TidyTueday constructor via the optional mod argument as follows:

import polars as pl

tt = TidyTuesday("2021-04-06", mod=pl)

tt.data["forest"] # is a pl.DataFrame

For future dataframe modules, you can pass as the mod argument any object/module that has a read_csv that returns an object.

The constructor also has an optional kwargs argument that allows you to pass a dictionary of kwargs to the read_csv method. For instance, this can be used to specify separators in pl.read_csv as follows:

tt = TidyTuesday("2020-08-25", mod=pl, kwargs={"separator": "\t"}) # contains chopped.tsv

tt.data["chopped"] # is a pl.DataFrame

If using the default Pandas, sepcifying tab separation should not be needed.

TODO

  • Implement parsers for rds formats
  • Documentation

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

tidytuesday-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

tidytuesday-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file tidytuesday-0.1.0.tar.gz.

File metadata

  • Download URL: tidytuesday-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for tidytuesday-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93ad2979a42a6723872871b5ed08d7baa8a3d21f7b445c9fca78d57ed9c92556
MD5 e2d106ff9b5be187f3a66721c3503d99
BLAKE2b-256 bb0695f198e7336a9db6e1ab4eca250af9cd7e5ba05ebfb03e1af1ab339c0a07

See more details on using hashes here.

File details

Details for the file tidytuesday-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tidytuesday-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for tidytuesday-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86a061194fc7a6c0f2b8fa71dfef56913665159925ace2844e044ccadf7af7da
MD5 f241fba3a56f744f19a137cdb7519bb8
BLAKE2b-256 01e651da8a41501683bbe08e145737c2236932693a07ec483fa3423d7f3a00d4

See more details on using hashes here.

Supported by

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