Chalkpy is the Python SDK for Chalk, a feature store designed to simplify feature engineering and deployment for machine learning teams. It allows users to define feature pipelines using familiar Python functions and data structures, orchestrating them on a Rust-based engine for parallel execution. The library facilitates defining features with Pydantic-inspired classes and creating resolvers to compute them for both online inference and offline training. The current version is 2.115.4, with frequent updates indicated by its changelog.
pip install chalkpyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the ChalkClient and verify authentication. It requires `CHALK_CLIENT_ID` and `CHALK_CLIENT_SECRET` to be set as environment variables or for the user to have authenticated via the `chalk login` CLI command.
Set `CHALK_CLIENT_ID` and `CHALK_CLIENT_SECRET` in your environment, or run `chalk login` from the command line and follow the prompts to authenticate.
Install with the appropriate extras, e.g., `pip install "chalkpy[runtime]"` or `pip install "chalkpy[chalkdf]"`.
Be aware of the `cache_nulls` default behavior. Set `cache_nulls=False` to prevent updating null entries in the cache, or `cache_nulls="evict_nulls"` to evict entries that would have been null.
Ensure `CHALK_CLIENT_ID` and `CHALK_CLIENT_SECRET` are set in your environment variables, or run `chalk login` in your terminal and follow the prompts to authenticate. ```bash export CHALK_CLIENT_ID="your_client_id" export CHALK_CLIENT_SECRET="your_client_secret" # Or, to log in via CLI chalk login ```
Ensure `chalkpy` is installed in your active Python environment. If you need specific functionalities, install with the appropriate 'extras'. ```bash pip install chalkpy # Or for specific functionalities, e.g., for notebooks or Chalk DataFrames: pip install "chalkpy[runtime]" pip install "chalkpy[chalkdf]" ```
Review your feature definitions and resolvers to ensure every feature has a corresponding resolver and that no resolver directly or indirectly calls itself in a loop. Reduce the number of output features in your query to isolate the problematic set and debug circular dependencies.
Ensure you are importing core components from their correct submodules, as specified in the Chalkpy documentation. For `ChalkClient`, it's typically `from chalk.client import ChalkClient`. Other decorators like `features`, `online`, `offline` are often imported directly from `chalk`. ```python from chalk.client import ChalkClient from chalk import features, online, offline ```