Home / Function/ _collect_files() — anthropic-sdk-python Function Reference

_collect_files() — anthropic-sdk-python Function Reference

Architecture documentation for the _collect_files() function in _files.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  8fe3fdd6_df01_8782_278e_e5a14e6db0c1["_collect_files()"]
  b21d65c1_1f1b_5699_6638_2ab0107a8fb1["_files.py"]
  8fe3fdd6_df01_8782_278e_e5a14e6db0c1 -->|defined in| b21d65c1_1f1b_5699_6638_2ab0107a8fb1
  37bbdfd0_9aad_546f_72b4_865c38bbd035["files_from_dir()"]
  37bbdfd0_9aad_546f_72b4_865c38bbd035 -->|calls| 8fe3fdd6_df01_8782_278e_e5a14e6db0c1
  style 8fe3fdd6_df01_8782_278e_e5a14e6db0c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/_files.py lines 19–25

def _collect_files(directory: Path, relative_to: Path, files: list[FileTypes]) -> None:
    for path in directory.iterdir():
        if path.is_dir():
            _collect_files(path, relative_to, files)
            continue

        files.append((path.relative_to(relative_to).as_posix(), path.read_bytes()))

Subdomains

Called By

Frequently Asked Questions

What does _collect_files() do?
_collect_files() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/_files.py.
Where is _collect_files() defined?
_collect_files() is defined in src/anthropic/lib/_files.py at line 19.
What calls _collect_files()?
_collect_files() is called by 1 function(s): files_from_dir.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free