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
Metadata
Release files for tidytuesday 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tidytuesday-0.1.0.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tidytuesday-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / tidytuesday-0.1.0.tar.gz
| Download URL | tidytuesday-0.1.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93ad2979a42a6723872871b5ed08d7baa8a3d21f7b445c9fca78d57ed9c92556
|
|
BLAKE2b-256 checksum How to use checksums |
bb0695f198e7336a9db6e1ab4eca250af9cd7e5ba05ebfb03e1af1ab339c0a07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.20
|
Release files / tidytuesday-0.1.0-py3-none-any.whl
| Download URL | tidytuesday-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86a061194fc7a6c0f2b8fa71dfef56913665159925ace2844e044ccadf7af7da
|
|
BLAKE2b-256 checksum How to use checksums |
01e651da8a41501683bbe08e145737c2236932693a07ec483fa3423d7f3a00d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.20
|