{"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":"python","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,"search_vec":"'2.115.4':77 'allow':26 'base':45 'chalk':1,10 'chalkpi':4 'changelog':84 'class':59 'comput':64 'creat':61 'current':74 'data':37,93 'data-sci':92 'defin':29,53 'deploy':20 'design':14 'engin':18,46 'etl':96 'execut':49 'facilit':52 'familiar':33 'featur':12,17,30,54,89 'feature-stor':88 'frequent':79 'function':35 'indic':81 'infer':69 'inspir':58 'learn':23,87 'librari':51 'machin':22,86 'machine-learn':85 'mlop':91 'offlin':71 'onlin':68 'orchestr':39 'parallel':48 'pipelin':31 'pydant':57 'pydantic-inspir':56 'python':2,7,34 'resolv':62 'rust':44 'rust-bas':43 'scienc':94 'sdk':3,8,95 'simplifi':16 'store':13,90 'structur':38 'team':24 'train':72 'updat':80 'use':32 'user':27 'version':75","created_at":"2026-04-14T01:21:11.230792+00:00","updated_at":"2026-04-16T01:53:09.709024+00:00","problems":[{"fix":"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.\n\n```bash\nexport CHALK_CLIENT_ID=\"your_client_id\"\nexport CHALK_CLIENT_SECRET=\"your_client_secret\"\n# Or, to log in via CLI\nchalk login\n```","cause":"This error typically indicates that your Chalk client is unauthenticated, meaning the `CHALK_CLIENT_ID` and `CHALK_CLIENT_SECRET` environment variables are not set correctly, or you haven't authenticated via the `chalk login` CLI command.","error":"Unexpected Chalk server error with status code 401"},{"fix":"Ensure `chalkpy` is installed in your active Python environment. If you need specific functionalities, install with the appropriate 'extras'.\n\n```bash\npip install chalkpy\n# Or for specific functionalities, e.g., for notebooks or Chalk DataFrames:\npip install \"chalkpy[runtime]\"\npip install \"chalkpy[chalkdf]\"\n```","cause":"This error occurs when the `chalkpy` library, or specific modules within it, cannot be found by your Python environment, often due to an incomplete installation or incorrect import paths.","error":"ModuleNotFoundError: No module named 'chalk'"},{"fix":"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.","cause":"This error indicates that Chalk cannot construct a valid dependency graph for resolving features, either because a feature lacks a defined resolver or there's an unbreakable circular dependency in your feature computations.","error":"Please double check that all features have resolvers and resolvers do not have circular dependencies."},{"fix":"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`.\n\n```python\nfrom chalk.client import ChalkClient\nfrom chalk import features, online, offline\n```","cause":"This usually happens when you try to access a component (like `ChalkClient`, `features`, `online`, `offline`) that is not directly available under the top-level `chalk` module, or there's a version mismatch/corrupted installation.","error":"AttributeError: module 'chalk' has no attribute 'ChalkClient' (or similar for other core components)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.157.6","cli_name":"chalk","cli_version":"sh: 1: chalk: not found","type":"library","homepage":"https://chalk.ai","github":null,"docs":"https://docs.chalk.ai","changelog":"https://docs.chalk.ai/docs/changelog","pypi":"https://pypi.org/project/chalkpy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data","workflow"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}