Python supercharged for fastai development
Project description
Welcome to fastcore
[!NOTE]
fastcore v2
In July 2026 we released fastcore v2, which removes or relocates a number of APIs that had accumulated better alternatives. If you use
from fastcore.utils import *(orfastcore.all), most of these changes won’t affect you. The breaking changes:Paramis gone fromfastcore.script; use plain type annotations with docments, ortyping.Annotated[type, "help"], optionally with adictof argparse arguments for advanced features.L’sstarmap,starfilter, and the otherstar*/rstar*methods are replaced by thestarandrstarfunction adapters, which compose with everyLmethod (e.g.t.map(star(f))); relatedly,spreadis replaced bystar, anddspreadis renamed todstar. Async helpers now live in the newfastcore.aiomodule:run_sync,iter_sync, andctx_syncmoved there fromnet, andmaybe_await,then,mapa,acache,reawaitable,is_async_callable, and the other async utilities moved there fromxtras.Configand the config file functions moved fromfoundationtoxtras.fastcore.netlost its request builders (urlrequest,urlsend,do_request,urlcheck) andclean_type_stris gone.parallel_genis removed; the stdlibProcessPoolExecutorinitializerpattern replaces it (fastai’sparallel_tokenizeshows the recipe). Python 3.11 or later is now required. If you need the old APIs, pinfastcore<2.
Python is a powerful, dynamic language. Rather than bake everything into the language, it lets the programmer customize it to make it work for them. fastcore uses this flexibility to add to Python features inspired by other languages we’ve loved, mixins from Ruby, and currying, binding, and more from Haskell. It also adds some “missing features” and clean up some rough edges in the Python standard library, such as simplifying parallel processing, and bringing ideas from NumPy over to Python’s list type.
Getting started
To install fastcore run: conda install fastcore -c fastai (if you use Anaconda, which we recommend) or pip install fastcore. For an editable install, clone this repo and run: pip install -e ".[dev]". fastcore is tested to work on Ubuntu, macOS and Windows (versions tested are those shown with the -latest suffix here).
fastcore contains many features, including:
fastcore.test: Simple testing functionsfastcore.foundation: Mixins, delegation, composition, and morefastcore.xtras: Utility functions to help with functional-style programming, parallel processing, and more
To get started, we recommend you read through the fastcore tour.
Contributing
After you clone this repository, please run nbdev_install_hooks in your terminal. This sets up git hooks, which clean up the notebooks to remove the extraneous stuff stored in the notebooks (e.g. which cells you ran) which causes unnecessary merge conflicts.
To run the tests in parallel, launch nbdev_test.
Before submitting a PR, check that the local library and notebooks match.
- If you made a change to the notebooks in one of the exported cells, you can export it to the library with
nbdev_prepare. - If you made a change to the library, you can export it back to the notebooks with
nbdev_update.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastcore-2.0.4.tar.gz.
File metadata
- Download URL: fastcore-2.0.4.tar.gz
- Upload date:
- Size: 103.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b65f7fc39ab716c62e9117746c6ea897ae111f9d71f4d7d6d0c08daac8c9480
|
|
| MD5 |
e96601807f4d8dfd91bf3af9e2e5ed55
|
|
| BLAKE2b-256 |
3c3a6ab189da89201ea24cd294bc56a20b6de621b7899485b6497c9240963a5b
|
File details
Details for the file fastcore-2.0.4-py3-none-any.whl.
File metadata
- Download URL: fastcore-2.0.4-py3-none-any.whl
- Upload date:
- Size: 108.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15a4044114dc54d1c6bfdfec1a6c0e5b64c9b115d5881e9ef879de2a0f9b9a97
|
|
| MD5 |
b7d5849f5b18c5fd8b97dc89c85ec540
|
|
| BLAKE2b-256 |
40254094eede4ca19d712c646402a9db5c9ab67cba4e6ff192754805655ec8a9
|