Skip to main content

Kaggling for fast kagglers!

Project description

fastkaggle

Install

Either:

pip install fastkaggle

or:

mamba install -c fastai fastkaggle

(or replace mamba with conda if you don’t mind it taking much longer to run…)

How to use

Competition

This little library is where I’ll be putting snippets of stuff which are useful on Kaggle. Functionality includes the following:

It defines iskaggle which is True if you’re running on Kaggle:

'Kaggle' if iskaggle else 'Not Kaggle'
'Not Kaggle'

It provides a setup_comp function which gets a path to the data for a competition, downloading it if needed, and also installs any modules that might be missing or out of data if running on Kaggle:

setup_comp('titanic')
Path('titanic')

There’s also push_notebook to push a notebook to Kaggle Notebooks, and import_kaggle to use the Kaggle API (even when you’re on Kaggle!) See the fastkaggle.core docs for details.

Datasets

This section is designed to make uploading pip libraries to kaggle datasets easy. There’s 2 primary high level functions to be used. First we can define our kaggle username and the local path we want to use to store datasets when we create them.

Usage tip

The purpose of this is to create datasets that can be used in no internet inference competitions to install libraries using pip install -Uqq library --no-index --find-links=file:///kaggle/input/your_dataset/

lib_path = Path('/root/kaggle_datasets')
username = 'isaacflath'

List of Libraries

We can take a list of libraries and upload them as seperate datasets. For example the below will create a library-fastcore and library-timm dataset. If they already exist, it will push a new version if there is a more recent version available.

libs = ['fastcore','timm']
create_libs_datasets(libs,lib_path,username)
Processing fastcore as library-fastcore at /root/kaggle_datasets/library-fastcore
-----Downloading or Creating Dataset
-----Checking dataset version against pip
-----Kaggle dataset already up to date 1.5.16 to 1.5.16
Processing timm as library-timm at /root/kaggle_datasets/library-timm
-----Downloading or Creating Dataset
-----Checking dataset version against pip
-----Kaggle dataset already up to date 0.6.7 to 0.6.7
Complete

This creates datasets in kaggle with the needed files.

Pawpularity Dataset

requirements.txt

We can also create a singular dataset with multiple libraries based on a requirements.txt file for the project. If there are any different files it will push a new version.

create_requirements_dataset('test_files/requirements.txt',lib_path,'libraries-pawpularity', username)
Processing libraries-pawpularity at /root/kaggle_datasets/libraries-pawpularity
-----Downloading or Creating Dataset
Data package template written to: /root/kaggle_datasets/libraries-pawpularity/dataset-metadata.json
-----Checking dataset version against pip
-----Updating libraries-pawpularity in Kaggle
Complete

This creats a dataset in kaggle with the needed files.

Fastkaggle Dataset

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

fastkaggle-0.0.8.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

fastkaggle-0.0.8-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastkaggle-0.0.8.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fastkaggle-0.0.8.tar.gz
Algorithm Hash digest
SHA256 43cf8f6a5a96577e49af9a9d8595b01f5d67a581cfa111597ed68d3adeb34b7f
MD5 b9d05e96f5f028e3b1f0b389e19ef25a
BLAKE2b-256 ba528a23984eedcf3803f0f71f2040309c0944a93c1d51f15e8a1f9ef309461c

See more details on using hashes here.

File details

Details for the file fastkaggle-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: fastkaggle-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fastkaggle-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d9c261c70d390a53227d66efa305106ed5ba339e86d915d4cb8abc81306986f7
MD5 a0680b49a699fb58ca13f1ee8331f33e
BLAKE2b-256 214667cde22d6d061f3f7ff6160c404abed3411b55c5446a2adea7718d74daf0

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