{"id":5146,"library":"chalkpy","title":"Chalk Python SDK","description":"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.","status":"active","version":"2.115.4","language":"en","source_language":"en","source_url":"https://github.com/chalk-ai","tags":["machine-learning","feature-store","mlops","data-science","sdk","etl"],"install":[{"cmd":"pip install chalkpy","lang":"bash","label":"Basic installation"},{"cmd":"pip install \"chalkpy[runtime]\"","lang":"bash","label":"For notebook environments"},{"cmd":"pip install \"chalkpy[chalkdf]\"","lang":"bash","label":"For chalkdf functionality"}],"dependencies":[{"reason":"Used for defining features with Pydantic-inspired classes.","package":"pydantic","optional":false},{"reason":"Common dependency for API interactions, mentioned in quickstart requirements.","package":"requests","optional":false},{"reason":"Required for specific features related to Chalk DataFrames.","package":"chalkdf","optional":true}],"imports":[{"symbol":"ChalkClient","correct":"from chalk.client import ChalkClient"},{"note":"Used as a decorator to define feature sets.","symbol":"features","correct":"from chalk import features"},{"note":"Used as a decorator to define online feature resolvers.","symbol":"online","correct":"from chalk import online"},{"note":"Used as a decorator to define offline feature resolvers.","symbol":"offline","correct":"from chalk import offline"},{"note":"Used to build features on feature classes, commonly imported as underscore.","symbol":"_","correct":"from chalk import _"}],"quickstart":{"code":"import os\nfrom chalk.client import ChalkClient\n\n# Ensure these environment variables are set or authenticate via `chalk login` CLI command\nCHALK_CLIENT_ID = os.environ.get(\"CHALK_CLIENT_ID\", \"\")\nCHALK_CLIENT_SECRET = os.environ.get(\"CHALK_CLIENT_SECRET\", \"\")\n\nif not CHALK_CLIENT_ID or not CHALK_CLIENT_SECRET:\n    print(\"Warning: CHALK_CLIENT_ID and CHALK_CLIENT_SECRET environment variables are not set. Authentication will likely fail. Please refer to Chalk documentation for authentication.\")\n\ntry:\n    client = ChalkClient(\n        client_id=CHALK_CLIENT_ID,\n        client_secret=CHALK_CLIENT_SECRET,\n        branch='notebook' # or 'production', or a custom branch name\n    )\n\n    # Verify the setup\n    whoami_response = client.whoami()\n    print(f\"Successfully authenticated as user ID: {whoami_response.user_id}\")\nexcept Exception as e:\n    print(f\"Authentication failed or API call error: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"Authentication requires `CHALK_CLIENT_ID` and `CHALK_CLIENT_SECRET` environment variables to be set, or prior authentication through the `chalk cli login` command. Failing to do so will result in connection errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install with the appropriate extras, e.g., `pip install \"chalkpy[runtime]\"` or `pip install \"chalkpy[chalkdf]\"`.","message":"Specific functionalities require installation with 'extras'. For example, `chalkpy[runtime]` is recommended for notebook environments, and `chalkpy[chalkdf]` is needed for features utilizing Chalk DataFrames. A bare `pip install chalkpy` may not include all necessary components for certain use cases.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"The `cache_nulls` parameter for features defaults to `True`, meaning Chalk will cache all values, including nulls. This can lead to unexpected caching behavior if not explicitly handled, as a null value will replace an existing cached value.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}