Skip to main content

pygrove

Writing the same imports over and over is draining. Some imports are standard enough for automation. pyforest allows this, but it is not frequently updated and oriented towards general data science. Here, I provide other imports, including some huggingface libraries imports.

Installation

pip install pygrove

Usage

import pygrove
model = AutoModel.from_pretrained('roberta-base')
tokenizer = AutoTokenizer.from_pretrained('roberta-base') 

Please note that thanks to pyforest, pygrove imports are lazy. Objects do not require time or memory until they are actually called.

Imports

Here is the list of pygrove imports

# HuggingFace
datasets = LazyImport("import datasets")
load_metric = LazyImport("from datasets import load_metric")
load_dataset = LazyImport("from datasets import load_dataset")
Dataset = LazyImport("from datasets import Dataset")

transformers = LazyImport("import transformers")
Trainer = LazyImport("from transformers import Trainer")
TrainingArguments = LazyImport("from transformers import TrainingArguments")
AutoTokenizer = LazyImport("from transformers import AutoTokenizer")
AutoConfig = LazyImport("from transformers import AutoConfig")
AutoModel = LazyImport("from transformers import AutoModel")
AutoModelForSequenceClassification = LazyImport("from transformers import AutoModelForSequenceClassification")
AutoModelForTokenClassification = LazyImport("from transformers import AutoModelForTokenClassification")
AutoModelForMultipleChoice = LazyImport("from transformers import AutoModelForMultipleChoice")
AutoModelForQuestionAnswering = LazyImport("from transformers import AutoModelForQuestionAnswering")

# Helpers
ftfy = LazyImport("import ftfy")
fc = LazyImport("import funcy as fc")
warnings = LazyImport("import warnings")
tqdm = LazyImport("from tqdm.auto import tqdm")
random = LazyImport("import random")
itertools = LazyImport("import itertools")
appdirs = LazyImport("import appdirs")
copy = LazyImport("import copy")
defaultdict = LazyImport("from collections import defaultdict")
Counter = LazyImport("from collections import Counter")
edict = LazyImport("from easydict import EasyDict as edict")
Xp = LazyImport("from xpflow import Xp")
millify = LazyImport("from millify import millify")

Metadata

Release files for pygrove 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygrove 1.6.0
File Size Uploaded Provenance Actions
pygrove-1.6.0.tar.gz 7.6 kB Without provenance Details for pygrove-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygrove 1.6.0
File Interpreter ABI Platform Actions
pygrove-1.6.0-py3-none-any.whl Python 3 none any Details for pygrove-1.6.0-py3-none-any.whl

Total release size: 14.6 kB

Release files / pygrove-1.6.0.tar.gz

Download URL pygrove-1.6.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
61406420e6dff0d7141b8614365158c54bfcdd11d7b2685a1bfd788292d76d02
BLAKE2b-256 checksum
How to use checksums
cbc79d6b6930ca601fa224bc2aead431cb36697e40b9060650d5a7bc41289093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / pygrove-1.6.0-py3-none-any.whl

Download URL pygrove-1.6.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a791ce1e8946d8f6c9546d6cd3e586904b84193c79396cec11907f69aa6f297
BLAKE2b-256 checksum
How to use checksums
a70e3ce506ea82d488f7fd5ceab90656ee8e64c40365b1f7665d972cb9e9444b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for pygrove 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page