# File registry

> File registry - DataRobot’s file system uses containers or “buckets” to store one or more files
> using a key-value storage approach, where the file’s path is the key and its contents the value.
> Each container is listed as an item under Data Assets (Data Catalog). We refer to the container as
> acatalog item.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-06-10T05:26:01.805910+00:00` (UTC).

## Primary page

- [File registry](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [classdatarobot.fs.file_system.DataRobotFileSystem](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem): In-page section heading.
- [classmethod_strip_protocol(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem._strip_protocol): In-page section heading.
- [_split_path(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem._split_path): In-page section heading.
- [ls(path, detail=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.ls): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also): In-page section heading.
- [info(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.info): In-page section heading.
- [created(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.created): In-page section heading.
- [du(path, total=True, maxdepth=None, withdirs=False, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.du): In-page section heading.
- [find(path, maxdepth=None, withdirs=False, detail=False, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.find): In-page section heading.
- [glob(path, maxdepth=None, detail=False, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.glob): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_1): In-page section heading.
- [tree(path='', recursion_limit=2, max_display=25, display_size=False, prefix='', is_last=True, first=True, indent_size=4)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.tree): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_2): In-page section heading.
- [cat_file(path, start=None, end=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cat_file): In-page section heading.
- [cat(path, recursive=False, on_error='raise', **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cat): In-page section heading.
- [sign(path, expiration=100, version_id=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.sign): In-page section heading.
- [cp_file(path1, path2, overwrite_strategy=FilesOverwriteStrategy.RENAME, max_wait=600, wait_for_completion=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cp_file): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_3): In-page section heading.
- [cp_directory(path1, path2, overwrite_strategy=FilesOverwriteStrategy.RENAME, max_wait=600, wait_for_completion=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cp_directory): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_4): In-page section heading.
- [copy(path1, path2, recursive=False, maxdepth=None, on_error=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.copy): In-page section heading.
- [rm_file(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rm_file): In-page section heading.
- [rm_directory(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rm_directory): In-page section heading.
- [rm(path, recursive=False, maxdepth=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rm): In-page section heading.
- [create_catalog_item_dir(**kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.create_catalog_item_dir): In-page section heading.
- [mv_file(path1, path2, , overwrite_strategy=FilesOverwriteStrategy.REPLACE, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.mv_file): In-page section heading.
- [mv(path1, path2, recursive=False, maxdepth=None, , overwrite_strategy=FilesOverwriteStrategy.REPLACE, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.mv): In-page section heading.
- [clone_catalog_item_dir(path_or_id, files_to_omit=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.clone_catalog_item_dir): In-page section heading.
- [put_from_url(path, url, unpack_archive_files=True, overwrite_strategy=FilesOverwriteStrategy.RENAME, , upload_timeout=600, wait_for_completion=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_from_url): In-page section heading.
- [put_from_data_source(path, data_source_id, credential_id=None, credential_data=None, unpack_archive_files=True, overwrite_strategy=FilesOverwriteStrategy.RENAME, , upload_timeout=600, wait_for_completion=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_from_data_source): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_5): In-page section heading.
- [open(path, mode='rb', block_size=None, cache_options=None, compression=None, overwrite_strategy=FilesOverwriteStrategy.REPLACE, unpack_archive_files=False, upload_timeout=600, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.open): In-page section heading.
- [touch(path, truncate=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.touch): In-page section heading.
- [read_block(fn, offset, length, delimiter=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.read_block): In-page section heading.
- [put_file(lpath, rpath, callback=, mode='overwrite', raise_error_on_directory=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_file): In-page section heading.
- [put(lpath, rpath, recursive=False, callback=, maxdepth=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put): In-page section heading.
- [get_mapper(root='', missing_exceptions=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.get_mapper): In-page section heading.
- [pipe_file(path, value, mode='overwrite', **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.pipe_file): In-page section heading.
- [pipe(path, value=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.pipe): In-page section heading.
- [checksum(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.checksum): In-page section heading.
- [expand_path(path, recursive=False, maxdepth=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.expand_path): In-page section heading.
- [get(rpath, lpath, recursive=False, callback=, maxdepth=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.get): In-page section heading.
- [get_file(rpath, lpath, callback=, outfile=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.get_file): In-page section heading.
- [mkdir(*args, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.mkdir): In-page section heading.
- [makedirs(*args, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.makedirs): In-page section heading.
- [rmdir(*args, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rmdir): In-page section heading.
- [modified(*args, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.modified): In-page section heading.
- [cat_ranges(paths, starts, ends, max_gap=None, on_error='return', **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cat_ranges): In-page section heading.
- [cp(path1, path2, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cp): In-page section heading.
- [classmethodcurrent()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.current): In-page section heading.
- [delete(path, recursive=False, maxdepth=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.delete): In-page section heading.
- [disk_usage(path, total=True, maxdepth=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.disk_usage): In-page section heading.
- [download(rpath, lpath, recursive=False, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.download): In-page section heading.
- [exists(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.exists): In-page section heading.
- [staticfrom_dict(dct)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.from_dict): In-page section heading.
- [WARNING](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#warning): In-page section heading.
- [staticfrom_json(blob)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.from_json): In-page section heading.
- [WARNING](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#warning_1): In-page section heading.
- [head(path, size=1024)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.head): In-page section heading.
- [isdir(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.isdir): In-page section heading.
- [isfile(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.isfile): In-page section heading.
- [lexists(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.lexists): In-page section heading.
- [listdir(path, detail=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.listdir): In-page section heading.
- [makedir(path, create_parents=True, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.makedir): In-page section heading.
- [mkdirs(path, exist_ok=False)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.mkdirs): In-page section heading.
- [move(path1, path2, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.move): In-page section heading.
- [read_bytes(path, start=None, end=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.read_bytes): In-page section heading.
- [read_text(path, encoding=None, errors=None, newline=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.read_text): In-page section heading.
- [rename(path1, path2, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rename): In-page section heading.
- [size(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.size): In-page section heading.
- [sizes(paths)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.sizes): In-page section heading.
- [stat(path, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.stat): In-page section heading.
- [tail(path, size=1024)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.tail): In-page section heading.
- [to_dict(, include_password=True)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.to_dict): In-page section heading.
- [WARNING](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#warning_2): In-page section heading.
- [to_json(, include_password=True)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.to_json): In-page section heading.
- [WARNING](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#warning_3): In-page section heading.
- [ukey(path)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.ukey): In-page section heading.
- [unstrip_protocol(name)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.unstrip_protocol): In-page section heading.
- [upload(lpath, rpath, recursive=False, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.upload): In-page section heading.
- [walk(path, maxdepth=None, topdown=True, on_error='omit', **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.walk): In-page section heading.
- [write_bytes(path, value, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.write_bytes): In-page section heading.
- [write_text(path, value, encoding=None, errors=None, newline=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.write_text): In-page section heading.
- [classdatarobot.fs.file_system.DataRobotFile](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile): In-page section heading.
- [SEE ALSO](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#see-also_6): In-page section heading.
- [write(data)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.write): In-page section heading.
- [flush(force=False)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.flush): In-page section heading.
- [upload()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.upload): In-page section heading.
- [close()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.close): In-page section heading.
- [propertyurl: str](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.url): In-page section heading.
- [commit()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.commit): In-page section heading.
- [discard()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.discard): In-page section heading.
- [fileno()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.fileno): In-page section heading.
- [info()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.info): In-page section heading.
- [isatty()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.isatty): In-page section heading.
- [read(length=-1)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.read): In-page section heading.
- [readable()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.readable): In-page section heading.
- [readinto(b)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.readinto): In-page section heading.
- [readline()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.readline): In-page section heading.
- [readlines()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.readlines): In-page section heading.
- [readuntil(char=b'\\n', blocks=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.readuntil): In-page section heading.
- [seek(loc, whence=0)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.seek): In-page section heading.
- [seekable()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.seekable): In-page section heading.
- [tell()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.tell): In-page section heading.
- [truncate()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.truncate): In-page section heading.
- [propertyuse_range_headers: bool](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.use_range_headers): In-page section heading.
- [writable()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.writable): In-page section heading.
- [writelines(lines,)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.writelines): In-page section heading.
- [propertyis_datarobot_url_for_read: bool](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.is_datarobot_url_for_read): In-page section heading.
- [propertyread_client: Session](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFile.read_client): In-page section heading.
- [classdatarobot.fs.file_system.DataRobotFSMap](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap): In-page section heading.
- [delitems(keys)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.delitems): In-page section heading.
- [propertydirfs](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.dirfs): In-page section heading.
- [get(k) → D\[k\] if k in D, else d.  d defaults to None.](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.get): In-page section heading.
- [getitems(keys, on_error='raise')](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.getitems): In-page section heading.
- [items() → a set-like object providing a view on D's items](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.items): In-page section heading.
- [keys() → a set-like object providing a view on D's keys](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.keys): In-page section heading.
- [pop(key, default=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.pop): In-page section heading.
- [popitem() → (k, v), remove and return some (key, value) pair](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.popitem): In-page section heading.
- [setdefault(k) → D.get(k,d), also set D\[k\]=d if k not in D](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.setdefault): In-page section heading.
- [setitems(values_dict)](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.setitems): In-page section heading.
- [update(**F) → None.  Update D from mapping/iterable E and F.](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.update): In-page section heading.
- [values() → an object providing a view on D's values](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.values): In-page section heading.
- [clear()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFSMap.clear): In-page section heading.
- [Enum and Helpers](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#enum-and-helpers): In-page section heading.
- [classdatarobot.fs.file_system.FileInfo](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.FileInfo): In-page section heading.
- [classdatarobot.enums.FilesOverwriteStrategy](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.enums.FilesOverwriteStrategy): In-page section heading.
- [RENAME= 'rename'](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.enums.FilesOverwriteStrategy.RENAME): In-page section heading.
- [REPLACE= 'replace'](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.enums.FilesOverwriteStrategy.REPLACE): In-page section heading.
- [SKIP= 'skip'](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.enums.FilesOverwriteStrategy.SKIP): In-page section heading.
- [ERROR= 'error'](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.enums.FilesOverwriteStrategy.ERROR): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html.md): Linked from this page.
- [API reference](https://docs.datarobot.com/en/docs/api/reference/index.html.md): Linked from this page.
- [Python API client](https://docs.datarobot.com/en/docs/api/reference/sdk/index.html.md): Linked from this page.
- [Data preparation](https://docs.datarobot.com/en/docs/api/reference/sdk/tag-data-prep.html.md): Linked from this page.
- [AsyncTimeoutError](https://docs.datarobot.com/en/docs/api/reference/sdk/errors.html.md#datarobot.errors.AsyncTimeoutError): Linked from this page.
- [DataSource](https://docs.datarobot.com/en/docs/api/reference/sdk/data-connectivity.html.md#datarobot.DataSource): Linked from this page.
- [Credential](https://docs.datarobot.com/en/docs/api/reference/sdk/credentials.html.md#datarobot.models.Credential): Linked from this page.

## Documentation content

DataRobot’s file system uses containers or “buckets” to store one or more files using a key-value storage approach, where the file’s path is the key and its contents the value. Each container is listed as an item under Data Assets (Data Catalog). We refer to the container as a catalog item.

The following should be kept in mind when working with the DataRobot file system:

- Permissions are attached to the catalog item containing the files. All files inside a catalog item share the same permissions.
- Since the DR file system uses key-value pairs to store files inside containers, directory structures are simulated and may change due to their contents. Most operations in the DataRobot file system support directory paths.
- While the DR file system does not support empty directories, a catalog item may be empty.
- The DR file system simulates a top-level directory structure by giving each catalog item its own directory named according to its id. Files inside the catalog item will appear as paths inside its directory.

### class datarobot.fs.file_system.DataRobotFileSystem

Bases: `AbstractFileSystem`

[fsspec](https://filesystem-spec.readthedocs.io/en/latest/index.html) implementation
of DataRobot’s file system.

File paths are of the form:
: `dr://<catalog_item_id>/path/to/file.txt` or `<catalog_item_id>/path/to/file.txt`

- Variables:

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> ```
> 
> List all catalog items in the file system:
> 
> ```
> >>> fs.ls("")
> ['696935d6d5a04a752419cf6d/', '69691fc3d5a04a752419cf5c/']
> ```
> 
> Create a new catalog item to hold your files:
> 
> ```
> >>> catalog_id = fs.create_catalog_item_dir()
> >>> fs.put_file("local/path/to/file.txt", f"dr://{catalog_id}/file.txt")
> >>> fs.ls(f"dr://{catalog_id}/")
> ['file.txt']
> ```
> 
> Find all PDF files you’ve uploaded to your catalog item:
> 
> ```
> >>> fs.glob(f"dr://{catalog_id}/**/*.pdf")
> ['696935d6d5a04a752419cf6d/file.pdf', '696935d6d5a04a752419cf6d/finance/fy-2024/budgets/Q2_budget_2024.pdf']
> ```
> 
> Copy, move or delete your files:
> 
> ```
> >>> fs.copy(f"dr://{catalog_id}/file.txt", f"dr://{catalog_id}/file_copy.txt")
> >>> fs.move(f"dr://{catalog_id}/file_copy.txt", f"dr://{catalog_id}/file_moved.txt")
> >>> fs.rm(f"dr://{catalog_id}/file_moved.txt")
> ```
> 
> Open files for reading or writing:
> 
> ```
> >>> with fs.open(f"dr://{catalog_id}/new_file.txt", mode="w") as f:
> ...     f.write("Hello, world!")
> 
> >>> with fs.open(f"dr://{catalog_id}/new_file.txt", mode="r") as f:
> ...     data = f.read()
> ...     print(data)
> Hello, world!
> ```

#### classmethod _strip_protocol(path)

Turn path from fully-qualified to DR file system specific.

- Parameters: path ( str ) – File path in the DataRobot file system.
- Returns: Validated file path without the protocol prefix.
- Return type: str

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> DataRobotFileSystem._strip_protocol("dr://12345/path/to/file.txt")
> '12345/path/to/file.txt'
> >>> DataRobotFileSystem._strip_protocol("dr://12345/path/")
> '12345/path/'
> >>> DataRobotFileSystem._strip_protocol("dr:///12345/")
> '12345/'
> >>> DataRobotFileSystem._strip_protocol("dr://")
> ''
> ```

#### _split_path(path)

Split the given path into catalog ID and internal file path.
Internal paths can be empty.

- Parameters: path ( str ) – File path in the DataRobot file system.
- Returns: A tuple of catalog ID and the internal file path.
- Return type: Tuple[str , str]
- Raises: ValueError – If the path format is invalid.

> [!NOTE] Examples
> ```
> >>> fs = DataRobotFileSystem()
> >>> fs._split_path("dr://12345/path/to/file.txt")
> ('12345', 'path/to/file.txt')
> >>> fs._split_path("dr:///12345/")
> ('12345', '')
> >>> fs._split_path("12345/folder/")
> ('12345', 'folder/')
> ```

#### ls(path, detail=True, **kwargs)

List files and folders at the given directory path. Use [info()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.info) for information about
a specific file.

If `detail` is True, returns a list of dictionaries with file details including name (path), size and type.
If `detail` is False, returns a list of file and folder paths as strings.

- Parameters:
- Returns: paths – List of dicts with file and folder details if detail is True, otherwise list of paths.
- Return type: List[FileInfo] or List[str]
- Raises: FileNotFoundError – If the specified path does not exist.

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.ls("dr://", detail=False)
> ['696935d6d5a04a752419cf6d/', 'abcdef1234567890abcdef12/']
> >>> fs.ls("dr://696935d6d5a04a752419cf6d/finance/")
> [
>     {
>         'name': '696935d6d5a04a752419cf6d/finance/fy-2024/',
>         'size': 0,
>         'type': 'directory',
>         'format': None
>     },
>     {
>         'name': '696935d6d5a04a752419cf6d/finance/employee-list.csv',
>         'size': 2048,
>         'type': 'file',
>         'format': 'csv'
>     },
> ]
> ```

#### SEE ALSO

[info()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.info)

[exists()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.exists)

#### info(path, **kwargs)

Get details about a file or directory.

For info about a directory path append a forward slash (/) at the end of the path.
Paths without a trailing slash can return info about files or directories. If both
a file and directory share the same path, the file info is returned.

- Parameters:
- Returns: info – A dictionary with file or directory details including name (path), size and type.
- Return type: FileInfo
- Raises:

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.info("dr://696935d6d5a04a752419cf6d/finance/employee-list.csv")
> {
>     'name': '696935d6d5a04a752419cf6d/finance/employee-list.csv',
>     'size': 2048,
>     'type': 'file',
>     'format': 'csv',
>     'created_at': datetime.datetime(2026, 3, 6, 10, 5, 16, 805655)
> }
> >>> fs.info("dr://696935d6d5a04a752419cf6d/finance/")
> {
>     'name': '696935d6d5a04a752419cf6d/finance/',
>     'size': 0,
>     'type': 'directory',
>     'format': None,
>     'created_at': None
> }
> >>> fs.info("dr://696935d6d5a04a752419cf6d/my_folder")
> {
>     'name': '696935d6d5a04a752419cf6d/my_folder/',
>     'size': 0,
>     'type': 'directory',
>     'format': None,
>     'created_at': None
> }
> ```

#### created(path)

Return the created timestamp of a file as a `datetime.datetime` object.

- Parameters: path ( str ) – Path in the DataRobot file system to get information about.
- Returns: The timestamp of when the file was created or None if a directory.
- Return type: datetime.datetime or None
- Raises:

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.created("dr://696935d6d5a04a752419cf6d/finance/employee-list.csv")
> datetime.datetime(2026, 3, 6, 10, 5, 16, 805655)
> ```

#### du(path, total=True, maxdepth=None, withdirs=False, **kwargs)

Retrieve space used by files and optionally directories at a path.

> [!NOTE] Notes
> Directory size does not include the size of its contents and is set to zero.

- Parameters:
- Returns: If total is True, the number of bytes of all files in the path.
  If total is False, a dictionary mapping paths to their size.
- Return type: int or Dict[str , int]

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> 
> >>> fs.du("dr://696935d6d5a04a752419cf6d/finance/yellow.txt")
> 2048
> 
> >>> fs.du("dr://696935d6d5a04a752419cf6d/", total=False)
> {'696935d6d5a04a752419cf6d/file.txt': 102, '696935d6d5a04a752419cf6d/finance/yellow.txt': 2048}
> 
> >>> fs.du("dr://696935d6d5a04a752419cf6d/", total=False, maxdepth=1, withdirs=True)
> {'696935d6d5a04a752419cf6d/file.txt': 102, '696935d6d5a04a752419cf6d/finance/': 0}
> ```

#### find(path, maxdepth=None, withdirs=False, detail=False, **kwargs)

List all files below path. If withdirs is True, include directories as well.

Like posix `find` command without conditions

- Parameters:
- Returns: If detail is False, a list of file (and optionally directory) paths.
  If detail is True, a dictionary mapping paths to their info dictionaries.
- Return type: List[str] or Dict[str , Dict[str , FileInfo]]

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.find("dr://696935d6d5a04a752419cf6d/", withdirs=True)
> [
>     '696935d6d5a04a752419cf6d/',
>     '696935d6d5a04a752419cf6d/finance/',
>     '696935d6d5a04a752419cf6d/finance/budgets/',
>     '696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.pdf',
>     '696935d6d5a04a752419cf6d/finance/employee-list.csv'
> ]
> 
> >>> fs.find("dr://696935d6d5a04a752419cf6d/finance/", maxdepth=1)
> ['696935d6d5a04a752419cf6d/finance/employee-list.csv']
> 
> >>> fs.find("dr://696935d6d5a04a752419cf6d/finance", maxdepth=1, withdirs=True, detail=True)
> {
>     '696935d6d5a04a752419cf6d/finance/': {
>         'name': '696935d6d5a04a752419cf6d/finance/',
>         'size': 0,
>         'type': 'directory',
>         'format': None,
>         'created_at': None
>     },
>     '696935d6d5a04a752419cf6d/finance/employee-list.csv': {
>         'name': '696935d6d5a04a752419cf6d/finance/employee-list.csv',
>         'size': 2048,
>         'type': 'file',
>         'format': 'csv',
>         'created_at': datetime.datetime(2026, 3, 6, 10, 5, 16, 805655)
>     },
>     '696935d6d5a04a752419cf6d/finance/budgets/': {
>         'name': '696935d6d5a04a752419cf6d/finance/budgets/',
>         'size': 0,
>         'type': 'directory',
>         'format': None,
>         'created_at': None
>     },
> }
> ```

#### glob(path, maxdepth=None, detail=False, **kwargs)

Find files by glob-matching.

Pattern matching capabilities for finding files that match the given pattern.

- Parameters:
- Returns: If detail is False, a list of file and directory paths.
  If detail is True, a dictionary mapping paths to their info dictionaries.
- Return type: List[str] or Dict[str , FileInfo]

> [!NOTE] Notes
> Supported patterns:
> 
> ‘*’: Matches any sequence of characters within a single directory level
> ‘**’: Matches any number of directory levels (must be an entire path component)
> ‘?’: Matches exactly one character
> ‘[abc]’: Matches any character in the set
> ‘[a-z]’: Matches any character in the range
> ‘[!cat]’: Matches any character NOT in the set {c, a, t}
> 
> Special behaviors:
> 
> If the path ends with ‘/’, only folders are returned
> Consecutive ‘*’ characters are compressed into a single ‘*’
> Empty brackets ‘[]’ never match anything
> Negated empty brackets ‘[!]’ match any single character
> Special characters in character classes are escaped properly
> 
> Limitations:
> 
> ‘**’ must be a complete path component (e.g., ‘a/**/b’, not ‘a**b’)
> No brace expansion (‘{a, b}.txt’)
> No extended glob patterns (‘+(pattern)’, ‘!(pattern)’)

#### SEE ALSO

[find()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.find)

> [!NOTE] Examples
> Find all files and directories directly under the specified path.
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.glob("dr://696935d6d5a04a752419cf6d/finance/*", detail=False)
> [
>     '696935d6d5a04a752419cf6d/finance/budgets/',
>     '696935d6d5a04a752419cf6d/finance/employee-list.csv'
> ]
> ```
> 
> Find only directories directly under the specified path.
> 
> ```
> >>> fs.glob("dr://696935d6d5a04a752419cf6d/finance/*/", detail=False)
> ['696935d6d5a04a752419cf6d/finance/budgets/']
> ```
> 
> Find any budget directories with a 4-digit year in their name.
> 
> ```
> >>> fs.glob("dr://696935d6d5a04a752419cf6d/finance/budgets/*-202[0-9]/", detail=False)
> [
>     '696935d6d5a04a752419cf6d/finance/budgets/fy-2024/',
>     '696935d6d5a04a752419cf6d/finance/budgets/fy-2023/'
> ]
> ```
> 
> Find all .csv files at a maximum depth of 2 levels.
> 
> ```
> >>> fs.glob("dr://696935d6d5a04a752419cf6d/**/*.csv", maxdepth=2, detail=False)
> [
>     '696935d6d5a04a752419cf6d/finance/employee-list.csv',
>     '696935d6d5a04a752419cf6d/sales/data.csv'
> ]
> ```

#### tree(path='', recursion_limit=2, max_display=25, display_size=False, prefix='', is_last=True, first=True, indent_size=4)

Return a tree-like structure string of the DataRobot file system from the given path.

- Parameters:
- Returns: tree_str – A string representing the tree structure of the file system.
- Return type: str

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> print(fs.tree("dr://696935d6d5a04a752419cf6d/", recursion_limit=5))
> 696935d6d5a04a752419cf6d/
> └── finance/
>     ├── fy-2024/
>     │   └── budgets/
>     │       └── Q2_budget_2024.pdf
>     └── employee-list.csv
> ```

#### SEE ALSO

[walk()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.walk)

#### cat_file(path, start=None, end=None, **kwargs)

Fetch a single file’s contents.

- Parameters:
- Returns: The contents of the file as bytes.
- Return type: bytes

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.cat_file("dr://696935d6d5a04a752419cf6d/finance/report.txt")
> b'Q2 Financial Report...'
> ```
> 
> Read a range of bytes from a file:
> 
> ```
> >>> fs.cat_file("dr://696935d6d5a04a752419cf6d/finance/report.txt", start=10, end=20)
> b'Financial Report...'
> ```

#### cat(path, recursive=False, on_error='raise', **kwargs)

Fetch (potentially multiple) path’s contents.

- Parameters:
- Returns: If a single file path is provided, returns the file contents as bytes. If multiple paths are
  provided or the path is otherwise expanded, returns a dictionary mapping each path to its
  contents as bytes or an exception instance if on_error is set to “return”.
- Return type: bytes or Dict[str , bytes] or Dict[str , Union[bytes , Exception]]

> [!NOTE] Examples
> Read a single file:
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.cat("dr://696935d6d5a04a752419cf6d/finance/report.txt")
> b'Q2 Financial Report...'
> ```
> 
> Read multiple files and all files in a directory:
> 
> ```
> >>> fs.cat(
> ...     ["dr://696935d6d5a04a752419cf6d/finance/summary.txt", "dr://696935d6d5a04a752419cf6d/reports/"],
> ...     recursive=True
> ... )
> {
>     '696935d6d5a04a752419cf6d/finance/summary.txt': b'Summary...',
>     '696935d6d5a04a752419cf6d/reports/report_2024.txt': b'2024 Report...',
>     '696935d6d5a04a752419cf6d/reports/report_2025.txt': b'2025 Report...'
> }
> ```
> 
> Read all CSV files matching a glob pattern:
> 
> ```
> >>> fs.cat("dr://696935d6d5a04a752419cf6d/data/**/*.csv")
> {
>     '696935d6d5a04a752419cf6d/data/sales.csv': b'date,amount\n2024-01-01,1000\n...',
>     '696935d6d5a04a752419cf6d/data/archive/old_sales.csv': b'date,amount\n2023-01-01,950\n...'
> }
> ```

#### sign(path, expiration=100, version_id=None, **kwargs)

Create a signed URL for the given file path. Optionally specify a version ID to retrieve a
signed URL for an earlier version of the file from that version of the catalog directory.

- Parameters:
- Returns: A signed URL granting temporary access to the file.
- Return type: str
- Raises:

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> signed_url = fs.sign(
> ...     "dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.pdf",
> ...     expiration=300,
> ... )
> ```

#### cp_file(path1, path2, overwrite_strategy=FilesOverwriteStrategy.RENAME, max_wait=600, wait_for_completion=True, **kwargs)

Copy a file or directory from path1 to path2.

Copies directories recursively. Specify an overwrite strategy to handle file naming conflicts
at the target location. Note that copying between catalog item directories is an asynchronous operation.
Cannot create a new catalog item directory by copying files into a non-existent catalog item directory.

- Parameters:
- Raises:
- Return type: None

> [!NOTE] Examples
> Copy a file to a new file path:
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> from datarobot.enums import FilesOverwriteStrategy
> >>> fs = DataRobotFileSystem()
> >>> fs.cp_file(
> ...     "dr://696935d6d5a04a752419cf6d/fy-2024/budgets/Q2_budget_2024.pdf",
> ...     "dr://69691fc3d5a04a752419cf5/fy-2024/budgets-copy.pdf",
> ... )
> ```
> 
> Copy file into a directory, replace existing file if present:
> 
> ```
> >>> fs.cp_file(
> ...     "dr://696935d6d5a04a752419cf6d/fy-2024/budgets/Q2_budget_2024.pdf",
> ...     "dr://69691fc3d5a04a752419cf5/fy-2024/budgets/",
> ...     overwrite_strategy=FilesOverwriteStrategy.OVERWRITE,
> ... )
> ```
> 
> Copy the contents of a directory into another directory:
> 
> ```
> >>> fs.cp_file(
> ...     "dr://696935d6d5a04a752419cf6d/fy-2024/budgets/",
> ...     "dr://69691fc3d5a04a752419cf5/archive/budgets-2024/",
> ... )
> ```

#### SEE ALSO

[copy()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.copy)

#### cp_directory(path1, path2, overwrite_strategy=FilesOverwriteStrategy.RENAME, max_wait=600, wait_for_completion=True, **kwargs)

Copy a directory recursively from path1 to path2.

Validates that both paths are directories by checking for trailing slashes (/).
Calls [cp_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cp_file) internally.

- Parameters:
- Return type: None

#### SEE ALSO

[cp_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cp_file)

#### copy(path1, path2, recursive=False, maxdepth=None, on_error=None, **kwargs)

Copy files or directories between two locations in the DataRobot file system.

- Parameters:
- Raises: FileNotFoundError – If any of the source paths do not exist or cannot find files and on_error is "raise" .
- Return type: None

> [!NOTE] Examples
> Copy a single file to a new path:
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/finance/employee-list.csv",
> ...     "dr://696935d6d5a04a752419cf6d/finance/employee-list-backup.csv",
> ... )
> ```
> 
> Copy more than one file or directory:
> 
> ```
> >>> fs.copy(
> ...     [
> ...         "dr://696935d6d5a04a752419cf6d/finance/employee-list.csv",
> ...         "dr://696935d6d5a04a752419cf6d/finance/employee-list-copy.csv",
> ...     ],
> ...     [
> ...         "dr://696935d6d5a04a752419cf6d/finance/employee-list-copy.csv",
> ...         "dr://696935d6d5a04a752419cf6d/finance/employee-list-copy-2.csv",
> ...     ],
> ... )
> ```
> 
> Copy a single file into a directory:
> 
> ```
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/finance/report.pdf",
> ...     "dr://696935d6d5a04a752419cf6d/archive/",
> ... )
> ```
> 
> Recursively copy the contents of a directory to another directory:
> 
> ```
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/budgets/",
> ...     "dr://696935d6d5a04a752419cf6d/archive/budgets-2024/",
> ...     recursive=True,
> ... )
> ```
> 
> Copy all CSV files in a directory and its subdirectories up to a maximum depth of 2:
> 
> ```
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/data/**/*.csv",
> ...     "dr://696935d6d5a04a752419cf6d/archive/data-2024/",
> ...     recursive=True,
> ...     maxdepth=2,
> ... )
> ```
> 
> Copy all text files in a directory into a new directory:
> 
> ```
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/data/*.txt",
> ...     "dr://696935d6d5a04a752419cf6d/archive/",
> ...     recursive=True,
> ... )
> ```
> 
> Copy a directory recursively, skipping files that already exist at the target:
> 
> ```
> >>> from datarobot.enums import FilesOverwriteStrategy
> >>> fs.copy(
> ...     "dr://696935d6d5a04a752419cf6d/budgets/",
> ...     "dr://696935d6d5a04a752419cf6d/archive/",
> ...     recursive=True,
> ...     overwrite_strategy=FilesOverwriteStrategy.SKIP,
> ... )
> ```

#### rm_file(path, **kwargs)

Delete a file or directory at the given path(s). Completes silently if the file does not exist.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.rm_file("dr://696935d6d5a04a752419cf6d/finance/employee-list.csv")
> 
> >>> fs.rm_file([
> ...     "dr://696935d6d5a04a752419cf6d/finance/employee-list.csv",
> ...     "dr://696935d6d5a04a752419cf6d/finance/fy-2024/budgets/Q2_budget_2024.pdf"
> ... ])
> ```

#### rm_directory(path, **kwargs)

Recursively delete a directory at the given path(s). Completes silently if the directory does not exist.
Uses [rm_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.rm_file) internally.

Soft-deletes catalog item directory when requested. Use `Files.un_delete()` if you need to restore a deleted catalog item.

- Parameters:
- Raises: ValueError: – If any of the provided paths do not end with a forward slash (/).
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.rm_directory("dr://696935d6d5a04a752419cf6d/finance/fy-2024/")
> 
> >>> fs.rm_directory([
> ...     "dr://696935d6d5a04a752419cf6d/finance/fy-2024/",
> ...     "dr://696935d6d5a04a752419cf6d/"
> ... ])
> ```

#### rm(path, recursive=False, maxdepth=None, **kwargs)

Delete files or directories. Completes silently if the file or directory does not exist.

Soft-deletes catalog item directory when requested. Use `Files.un_delete()` if you need to restore a deleted catalog item.
If all files in a directory are deleted, the directory itself is also deleted implicitly
as DataRobot file system does not support empty directories.

- Parameters:
- Return type: None

> [!NOTE] Examples
> Delete file:
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.rm("dr://696935d6d5a04a752419cf6d/finance/employee-list.csv")
> ```
> 
> Delete directory recursively:
> 
> ```
> >>> fs.rm("dr://696935d6d5a04a752419cf6d/finance/fy-2024/", recursive=True)
> ```
> 
> Delete contents of catalog item folder recursively up to a maximum depth of 2:
> 
> ```
> >>> fs.rm("dr://696935d6d5a04a752419cf6d/", recursive=True, maxdepth=2)
> ```
> 
> Delete catalog item folder:
> 
> ```
> >>> fs.rm("dr://696935d6d5a04a752419cf6d/")
> ```
> 
> Delete .csv files in a directory and its subdirectories up to a maximum depth of 3:
> 
> ```
> >>> fs.rm("dr://696935d6d5a04a752419cf6d/finance/**/*.csv", recursive=True, maxdepth=3)
> ```

#### create_catalog_item_dir(**kwargs)

Create a new empty catalog item directory and return its id.

- Parameters: kwargs ( Any ) – Additional keyword arguments for future proofing.
- Returns: The id of the newly created catalog item.
- Return type: str

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> catalog_id = fs.create_catalog_item_dir()
> >>> fs.ls(f"dr://{catalog_id}/")
> []
> ```

#### mv_file(path1, path2, , overwrite_strategy=FilesOverwriteStrategy.REPLACE, **kwargs)

Move a single file or directory from path1 to path2.

- Parameters:
- Return type: None

#### mv(path1, path2, recursive=False, maxdepth=None, , overwrite_strategy=FilesOverwriteStrategy.REPLACE, **kwargs)

Move files or directories from path1 to path2. path1 may contain glob patterns.

- Parameters:
- Raises: ValueError: – If multiple sources are moved to a single file destination (not a directory).
- Return type: None

#### clone_catalog_item_dir(path_or_id, files_to_omit=None, **kwargs)

Clone a catalog item directory (copy all contents) and return the ID of the cloned catalog item.

- Parameters:
- Returns: The ID of the cloned catalog item.
- Return type: str

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.ls("dr://696935d6d5a04a752419cf6d/", detail=False)
> ['696935d6d5a04a752419cf6d/folder/', '696935d6d5a04a752419cf6d/file.txt']
> >>> clone_id = fs.clone_catalog_item_dir("dr://696935d6d5a04a752419cf6d/")
> >>> clone_id
> "696935d6d5a04a752419cf6d-clone"
> >>> fs.ls(f"dr://{clone_id}/", detail=False)
> ['696935d6d5a04a752419cf6d-clone/folder/', '696935d6d5a04a752419cf6d-clone/file.txt']
> ```
> 
> Clone a catalog item directory and omit a file:
> 
> ```
> >>> fs.clone_catalog_item_dir("dr://696935d6d5a04a752419cf6d/", files_to_omit=["file.txt"])
> "696935d6d5a04a752419cf6d-clone"
> >>> fs.ls(f"dr://696935d6d5a04a752419cf6d-clone/", detail=False)
> ['696935d6d5a04a752419cf6d-clone/folder/']
> ```

#### put_from_url(path, url, unpack_archive_files=True, overwrite_strategy=FilesOverwriteStrategy.RENAME, , upload_timeout=600, wait_for_completion=True, **kwargs)

Load file(s) from a URL into a directory in the DataRobot file system.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> catalog_id = fs.create_catalog_item_dir()
> >>> fs.put_from_url(f"dr://{catalog_id}/data/", "https://example.com/file.png")
> >>> fs.ls(f"dr://{catalog_id}/data/")
> [{'name': 'file.png', 'size': 12345, 'type': 'file', ...}]
> ```

- Raises:

#### put_from_data_source(path, data_source_id, credential_id=None, credential_data=None, unpack_archive_files=True, overwrite_strategy=FilesOverwriteStrategy.RENAME, , upload_timeout=600, wait_for_completion=True, **kwargs)

Upload one or more files from a data source into a directory in the DataRobot file system.

- Parameters:
- Raises:
- Return type: None

> [!NOTE] Examples
> Upload file or folder from Google Drive.
> 
> Note: GDrive paths must use drive, folder and file IDs.
> Example: `/<drive_id>/<folder_id>/<file_id>` or `/<drive_id>/<folder_id>` if folder.
> 
> ```
> >>> import datarobot as dr
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> gcp_cred = dr.Credential.create_gcp(
> ...     name='GDrive Credentials',
> ...     gcp_key={  # Or load from keyfile
> ...         "type": "service_account",
> ...         "private_key_id": "...",
> ...         "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
> ...         "client_email": "user@project.iam.gserviceaccount.com",
> ...         "client_id": "...",
> ...     },
> ... )
> >>> gdrive_connector = next(
> ...     c for c in dr.Connector.list() if c.connector_type == "gdrive"
> ... )
> >>> gdrive_datastore = dr.DataStore.create(
> ...     data_store_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='GDrive DataStore',
> ...     fields=[{'id': 'gdrive.drive_name', 'name': 'Drive Name', 'value': 'My Drive'}],
> ...     connector_id=gdrive_connector.id,
> ... )
> >>> path = "/<drive_id>/<folder_id>/<file_id>"  # or "/<drive_id>/<folder_id>" for a folder
> >>> gdrive_datasource = dr.DataSource.create(
> ...     data_source_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='GDrive DataSource for my documents',
> ...     params=dr.DataSourceParameters(data_store_id=gdrive_datastore.id, path=path),
> ... )
> >>> fs.put_from_data_source(
> ...     "dr://<catalog-id>/my_gdrive_documents/",
> ...     gdrive_datasource.id,
> ...     credential_id=gcp_cred.credential_id, # Can omit if using default credentials setup with DataStore
> ... )
> >>> print(fs.ls(f"dr://<catalog-id>/my_gdrive_documents/", detail=False))
> ['<catalog-id>/my_gdrive_documents/file.txt']
> ```
> 
> Upload file or folder from AWS S3 bucket:
> 
> ```
> >>> import datarobot as dr
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> cred = dr.Credential.create_s3(
> ...     name="AWS S3 Credentials",
> ...     aws_access_key_id="...",
> ...     aws_secret_access_key="...",
> ...     aws_session_token="...",
> ... )
> >>> s3_connector = next(
> ...     c for c in dr.Connector.list() if c.connector_type == "s3"
> ... )
> >>> s3_datastore = dr.DataStore.create(
> ...     data_store_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='S3 DataStore',
> ...     fields=[
> ...         {"id": "fs.defaultFS", "name": "Bucket Name", "value": "my-bucket-name"},
> ...         {"id": "fs.rootDirectory", "name": "Prefix", "value": "/"},
> ...         {"id": "fs.s3.awsRegion", "name": "S3 Bucket Region", "value": "us-east-1"},
> ...     ],
> ...     connector_id=s3_connector.id,
> ... )
> >>> s3_datasource = dr.DataSource.create(
> ...     data_source_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='S3 DataSource for my files',
> ...     params=dr.DataSourceParameters(
> ...         data_store_id=s3_datastore.id,
> ...         path="path/to/my/file.txt",  # or "path/to/my/folder/"
> ...     ),
> ... )
> >>> fs.put_from_data_source(
> ...     "dr://<catalog-id>/my_s3_files/",
> ...     s3_datasource.id,
> ...     credential_id=cred.credential_id, # Can omit if using default credentials setup with DataStore
> ... )
> >>> print(fs.ls(f"dr://<catalog-id>/my_s3_files/", detail=False))
> ['<catalog-id>/my_s3_files/file.txt']
> ```
> 
> Upload file or folder from SharePoint:
> 
> Note: Sharepoint paths must use the following format: `/<HOSTNAME>,<SITE_COLLECTION_ID>,<SITE_ID/WEB_ID>/<DRIVE_ID>/<FILE_OR_FOLDER_ITEM_ID>`.
> 
> Example: `/mydomain.sharepoint.com,4732d...8b01b0,eb0d3...e42f/b!8tQyRyn.....TowMA13__nTU/01MAJ...EYJTAOR6/`
> 
> ```
> >>> import datarobot as dr
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> cred = dr.Credential.create_azure_service_principal(
> ...     name="Azure Service Principal Credential for Sharepoint",
> ...     client_id="...",
> ...     client_secret="...",
> ...     azure_tenant_id="...",
> ... )
> >>> sharepoint_connector = next(
> ...     c for c in dr.Connector.list() if c.connector_type == "sharepoint"
> ... )
> >>> sharepoint_datastore = dr.DataStore.create(
> ...     data_store_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='Sharepoint DataStore',
> ...     fields=[],
> ...     connector_id=sharepoint_connector.id,
> ... )
> >>> path = "/<HOSTNAME>,<SITE_COLLECTION_ID>,<SITE_ID/WEB_ID>/<DRIVE_ID>/<FILE_OR_FOLDER_ITEM_ID>"
> >>> sharepoint_datasource = dr.DataSource.create(
> ...     data_source_type=dr.enums.DataStoreTypes.DR_CONNECTOR_V1,
> ...     canonical_name='Sharepoint DataSource',
> ...     params=dr.DataSourceParameters(
> ...         data_store_id=sharepoint_datastore.id,
> ...         path=path,
> ...     ),
> ... )
> >>> fs.put_from_data_source(
> ...     "dr://<catalog-id>/my_sharepoint_files/",
> ...     sharepoint_datasource.id,
> ...     credential_id=cred.credential_id,
> ... )
> >>> print(fs.ls(f"dr://<catalog-id>/my_sharepoint_files/", detail=False))
> ['<catalog-id>/my_sharepoint_files/my_file.txt']
> ```

#### SEE ALSO

[put_from_url()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_from_url)

[put_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_file)

#### open(path, mode='rb', block_size=None, cache_options=None, compression=None, overwrite_strategy=FilesOverwriteStrategy.REPLACE, unpack_archive_files=False, upload_timeout=600, **kwargs)

Open a file in the DataRobot file system.
Supports read modes ‘r’, ‘rb’ and write modes ‘w’, ‘wb’,
‘xb’.

- Parameters:
- Raises:
- Returns: A file-like object for reading or writing.
- Return type: DataRobotFile

> [!NOTE] Examples
> Open a file for reading:
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> with fs.open("dr://696935d6d5a04a752419cf6d/notes/agenda.txt", mode="r") as f:
> ...     data = f.read()
> ```
> 
> Read first 20 bytes from a file then skip to byte 100 and read the next 30 bytes:
> 
> ```
> >>> with fs.open("dr://696935d6d5a04a752419cf6d/figures/plot.png", mode="rb") as f:
> ...     first_20_bytes = f.read(20)
> ...     f.seek(100)
> ...     next_30_bytes = f.read(30)
> ```

#### touch(path, truncate=True, **kwargs)

Create an empty file at the given path.

DataRobotFileSystem does not support updating timestamps of existing files.

- Parameters:
- Raises: NotImplementedError – If attempting to update the timestamp of an existing file with truncate set to False.
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.touch("dr://696935d6d5a04a752419cf6d/notes/agenda.txt")
> ```

#### read_block(fn, offset, length, delimiter=None)

Read a block of bytes from a file.

Starting at `offset` of the file, read `length` bytes.  If `delimiter` is set then we ensure that the read starts and stops at
delimiter boundaries that follow the locations `offset` and `offset
+ length`.  If `offset` is zero then we start at zero.  The
bytestring returned WILL include the end delimiter string.

If offset+length is beyond the eof, reads to eof.

- Parameters:
- Return type: bytes

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.read_block("dr://696935d6d5a04a752419cf6d/data/file.txt", 0, 13)
> b'Alice, 100\nBo'
> >>> fs.read_block("dr://696935d6d5a04a752419cf6d/data/file.txt", 0, 13, delimiter=b'\n')
> b'Alice, 100\nBob, 200\n'
> ```
> 
> Use `length=None` to read to the end of the file.
> 
> ```
> >>> fs.read_block("dr://696935d6d5a04a752419cf6d/data/file.txt", 0, None, delimiter=b'\n')
> b'Alice, 100\nBob, 200\nCharlie, 300'
> ```

#### put_file(lpath, rpath, callback=, mode='overwrite', raise_error_on_directory=True, **kwargs)

Upload a single file from local to DataRobot file system.

- Parameters:
- Raises:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.put_file(
> ...     "/Users/username/local/path/to/file.txt",
> ...     "dr://696935d6d5a04a752419cf6d/my/new/file_copy.txt",
> ... )
> ```

#### put(lpath, rpath, recursive=False, callback=, maxdepth=None, **kwargs)

Upload local file(s) to DataRobot file system.

Copies a specific file or tree of files (if recursive=True). If rpath
ends with a “/”, it will be assumed to be a directory, and target files
will go within. If lpath ends with a “/”, it will be assumed to be a directory
and will target files inside the directory. Calls [put_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_file) for each source path or uses `FilesStage` to upload multiple files at once
if upload can be optimized.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.put(
> ...     "/Users/username/local/path/to/file.txt",
> ...     "dr://696935d6d5a04a752419cf6d/my/new/file_copy.txt",
> ```
> 
> Upload a directory recursively:
> 
> ```
> >>> fs.put(
> ...     "/Users/username/local/path/to/directory",
> ...     "dr://696935d6d5a04a752419cf6d/my/new/directory/",
> ...     recursive=True,
> ... )
> ```
> 
> Upload all PDF files in a directory:
> 
> ```
> >>> fs.put(
> ...     "/Users/username/local/my/documents/**/*.pdf",
> ...     "dr://696935d6d5a04a752419cf6d/my-pdf-documents/",
> ...     recursive=True,
> ... )
> ```
> 
> Upload multiple files at once:
> 
> ```
> >>> fs.put(
> ...     ["/Users/username/local/path/to/file1.txt", "/Users/username/local/path/to/file2.txt"],
> ...     ["dr://696935d6d5a04a752419cf6d/my/new/file1.txt", "dr://696935d6d5a04a752419cf6d/my/new/file2.txt"],
> ... )
> ```

#### get_mapper(root='', missing_exceptions=None)

Create a key/value mutable store based on this file-system.

Creates a MutableMapping interface to the DataRobot file system at the given root path.

- Parameters:
- Returns: A key/value mutable store based on this file-system.
- Return type: DataRobotFSMap

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem, DataRobotFSMap
> >>> fs = DataRobotFileSystem()
> >>> root_map = fs.get_mapper()
> >>> map = fs.get_mapper("dr://696935d6d5a04a752419cf6d/")
> ```
> 
> Retrieve file contents from file system using map:
> 
> ```
> >>> map["file.txt"]
> b"Hello, world!"
> >>> "folder/path/file.txt" in map
> True
> >>> file_count = len(map)
> >>> file_count
> 3
> >>> [file for file in map]
> ["file.txt", "folder/path/file.txt", "another/folder/file.txt"]
> >>> map.getitems(["file.txt", "folder/path/file.txt", "another/folder/file.txt"])
> {
>     "file.txt": b"Hello, world!",
>     "folder/path/file.txt": b"Hello, world!",
>     "another/folder/file.txt": b"Hello, world!",
> }
> ```
> 
> Set file contents in file system using map:
> 
> ```
> >>> map["file.txt"] = b"Hello, world!"
> >>> map["folder/path/new_file.txt"] = b"This is a new file!"
> >>> map.setitems({
>     "another/folder/file.txt": b"Hello, world!",
>     "folder/path/new_file.txt": b"This is a new file!",
> })
> ```
> 
> Delete files from file system using map:
> 
> ```
> >>> del map["file.txt"]
> >>> map.delitems(["folder/path/new_file.txt", "another/folder/file.txt"])
> >>> map.pop("file.txt", "default_value_if_file_does_not_exist")
> b'Hello, world!'
> >>> map.pop("folder/path/non_existent_file.txt", "default_value_if_file_does_not_exist")
> 'default_value_if_file_does_not_exist'
> ```
> 
> Clear all files under the map root. This may have unintended consequences as
> DataRobot file system does not support empty directories:
> 
> ```
> >>> map.clear()
> >>> len(map)
> 0
> ```

#### pipe_file(path, value, mode='overwrite', **kwargs)

Set the bytes of a given file.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.pipe_file("dr://696935d6d5a04a752419cf6d/my/new/file.txt", b"Hello, world!")
> ```

#### pipe(path, value=None, **kwargs)

Put value into path.

Counterpart to [cat()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.cat).
Calls [put_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.put_file).

- Parameters:
- Raises: ValueError – If path is not a string or dict.
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.pipe("dr://696935d6d5a04a752419cf6d/my/new/file.txt", b"Hello, world!")
> >>> fs.pipe({"dr://696935d6d5a04a752419cf6d/my/new/file.txt": b"Hello, world!"})
> >>> fs.pipe({
> ...     "dr://696935d6d5a04a752419cf6d/my/new/file.txt": b"Hello, world!",
> ...     "dr://696935d6d5a04a752419cf6d/my/new/file2.txt": b"Hello, world2!",
> ... })
> ```

#### checksum(path)

Unique value for the content of a file at the given path.

If the checksum is the same from one moment to another, the contents
are guaranteed to be the same. If the checksum changes, the contents might have changed.

- Parameters: path ( str ) – Path in the DataRobot file system to get the checksum of.
- Returns: The checksum of the file at the given path.
- Return type: int

#### expand_path(path, recursive=False, maxdepth=None, **kwargs)

Turn one or more paths (can be globs or directory paths) into a list of all matching paths to files
and directories.

- Parameters:
- Returns: List of all matching paths.
- Return type: List[str]

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.expand_path("dr://696935d6d5a04a752419cf6d/finance/", recursive=True, maxdepth=1)
> [
>     'dr://696935d6d5a04a752419cf6d/finance/',
>     'dr://696935d6d5a04a752419cf6d/finance/budgets/',
>     'dr://696935d6d5a04a752419cf6d/finance/employee-list.csv',
> ]
> ```
> 
> Expand a glob pattern with no max depth:
> 
> ```
> >>> fs.expand_path("dr://696935d6d5a04a752419cf6d/finance/**/*.csv", recursive=True)
> [
>     'dr://696935d6d5a04a752419cf6d/finance/employee-list.csv',
>     'dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv',
>     'dr://696935d6d5a04a752419cf6d/finance/budgets/archive/Q3_budget_2000.csv',
> ]
> ```
> 
> Expand a list of paths:
> 
> ```
> >>> fs.expand_path([
> ...    "dr://696935d6d5a04a752419cf6d/finance/budgets/*.csv",
> ...    "dr://696935d6d5a04a752419cf6d/finance/employee-list.csv",
> ... ])
> [
>     'dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv',
>     'dr://696935d6d5a04a752419cf6d/finance/employee-list.csv',
> ]
> ```

#### get(rpath, lpath, recursive=False, callback=, maxdepth=None, **kwargs)

Download file(s) from the DataRobot file system to the local file system.

Copies a specific file or tree of files (if ```recursive``=True). If ``lpath``` ends with a “/”, it will be assumed to be a directory, and target files
will go within. Can submit a list of paths, which may be glob-patterns
and will be expanded.

Calls [get_file()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.get_file) for each file.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.get(
> ...     "dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv",
> ...     "/Users/username/local/path/to/download/Q2_budget_2024.csv",
> ... )
> ```
> 
> Download a directory recursively:
> 
> ```
> >>> fs.get(
> ...     "dr://696935d6d5a04a752419cf6d/finance/budgets/",
> ...     "/Users/username/local/path/to/download/budgets/",
> ...     recursive=True,
> ... )
> ```
> 
> Download all PDF files in a directory:
> 
> ```
> >>> fs.get(
> ...     "dr://696935d6d5a04a752419cf6d/finance/budgets/**/*.pdf",
> ...     "/Users/username/local/path/to/download/budgets/",
> ...     recursive=True,
> ... )
> ```
> 
> Download multiple files at once:
> 
> ```
> >>> fs.get(
> ...     [
> ...         "dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv",
> ...         "dr://696935d6d5a04a752419cf6d/finance/employee-list.csv"
> ...     ],
> ...     [
> ...         "/Users/username/local/path/to/download/Q2_budget_2024.csv",
> ...         "/Users/username/local/path/to/download/employee-list.csv"
> ...     ],
> ... )
> ```

#### get_file(rpath, lpath, callback=, outfile=None, **kwargs)

Download a single file from the DataRobot file system to the local file system.

- Parameters:
- Return type: None

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> fs.get_file(
> ...     "dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv",
> ...     "/Users/username/local/path/to/download/Q2_budget_2024.csv",
> ... )
> ```
> 
> ```
> >>> from datarobot.fs import DataRobotFileSystem
> >>> fs = DataRobotFileSystem()
> >>> with open("/Users/username/local/path/to/download/Q2_budget_2024.csv", "wb") as f:
> ...     fs.get_file("dr://696935d6d5a04a752419cf6d/finance/budgets/Q2_budget_2024.csv", f)
> ```

#### mkdir(*args, **kwargs)

Not supported as DataRobotFileSystem does not support empty directories.

- Return type: None

#### makedirs(*args, **kwargs)

Not supported as DataRobotFileSystem does not support empty directories.

- Return type: None

#### rmdir(*args, **kwargs)

Not supported as DataRobotFileSystem does not support empty directories.

- Return type: None

#### modified(*args, **kwargs)

DataRobotFileSystem does not currently expose file modification timestamp.

- Return type: datetime

#### cat_ranges(paths, starts, ends, max_gap=None, on_error='return', **kwargs)

Get the contents of byte ranges from one or more files

- Parameters:

#### cp(path1, path2, **kwargs)

Alias of AbstractFileSystem.copy.

#### classmethod current()

Return the most recently instantiated FileSystem

If no instance has been created, then create one with defaults

#### delete(path, recursive=False, maxdepth=None)

Alias of AbstractFileSystem.rm.

#### disk_usage(path, total=True, maxdepth=None, **kwargs)

Alias of AbstractFileSystem.du.

#### download(rpath, lpath, recursive=False, **kwargs)

Alias of AbstractFileSystem.get.

#### exists(path, **kwargs)

Is there a file at the given path

#### static from_dict(dct)

Recreate a filesystem instance from dictionary representation.

See `.to_dict()` for the expected structure of the input.

- Parameters: dct ( Dict[str , Any] )
- Return type: file system instance , not necessarily of this particular class.

#### WARNING

This can import arbitrary modules (as determined by the `cls` key).
Make sure you haven’t installed any modules that may execute malicious code
at import time.

#### static from_json(blob)

Recreate a filesystem instance from JSON representation.

See `.to_json()` for the expected structure of the input.

- Parameters: blob ( str )
- Return type: file system instance , not necessarily of this particular class.

#### WARNING

This can import arbitrary modules (as determined by the `cls` key).
Make sure you haven’t installed any modules that may execute malicious code
at import time.

#### head(path, size=1024)

Get the first `size` bytes from file

#### isdir(path)

Is this entry directory-like?

#### isfile(path)

Is this entry file-like?

#### lexists(path, **kwargs)

If there is a file at the given path (including
broken links)

#### listdir(path, detail=True, **kwargs)

Alias of AbstractFileSystem.ls.

#### makedir(path, create_parents=True, **kwargs)

Alias of AbstractFileSystem.mkdir.

#### mkdirs(path, exist_ok=False)

Alias of AbstractFileSystem.makedirs.

#### move(path1, path2, **kwargs)

Alias of AbstractFileSystem.mv.

#### read_bytes(path, start=None, end=None, **kwargs)

Alias of AbstractFileSystem.cat_file.

#### read_text(path, encoding=None, errors=None, newline=None, **kwargs)

Get the contents of the file as a string.

- Parameters:

#### rename(path1, path2, **kwargs)

Alias of AbstractFileSystem.mv.

#### size(path)

Size in bytes of file

#### sizes(paths)

Size in bytes of each file in a list of paths

#### stat(path, **kwargs)

Alias of AbstractFileSystem.info.

#### tail(path, size=1024)

Get the last `size` bytes from file

#### to_dict(, include_password=True)

JSON-serializable dictionary representation of this filesystem instance.

- Parameters: include_password ( bool , default True ) – Whether to include the password (if any) in the output.
- Return type: dict [ str , Any ]
- Returns:

#### WARNING

Serialized filesystems may contain sensitive information which have been
passed to the constructor, such as passwords and tokens. Make sure you
store and send them in a secure environment!

#### to_json(, include_password=True)

JSON representation of this filesystem instance.

- Parameters: include_password ( bool , default True ) – Whether to include the password (if any) in the output.
- Return type: str
- Returns:

#### WARNING

Serialized filesystems may contain sensitive information which have been
passed to the constructor, such as passwords and tokens. Make sure you
store and send them in a secure environment!

#### ukey(path)

Hash of file properties, to tell if it has changed

#### unstrip_protocol(name)

Format FS-specific path to generic, including protocol

- Return type: str

#### upload(lpath, rpath, recursive=False, **kwargs)

Alias of AbstractFileSystem.put.

#### walk(path, maxdepth=None, topdown=True, on_error='omit', **kwargs)

Return all files under the given path.

List all files, recursing into subdirectories; output is iterator-style,
like `os.walk()`. For a simple list of files, `find()` is available.

When topdown is True, the caller can modify the dirnames list in-place (perhaps
using del or slice assignment), and walk() will
only recurse into the subdirectories whose names remain in dirnames;
this can be used to prune the search, impose a specific order of visiting,
or even to inform walk() about directories the caller creates or renames before
it resumes walk() again.
Modifying dirnames when topdown is False has no effect. (see os.walk)

Note that the “files” outputted will include anything that is not
a directory, such as links.

- Parameters:

#### write_bytes(path, value, **kwargs)

Alias of AbstractFileSystem.pipe_file.

#### write_text(path, value, encoding=None, errors=None, newline=None, **kwargs)

Write the text to the given file.

An existing file will be overwritten.

- Parameters:

### class datarobot.fs.file_system.DataRobotFile

Bases: `AbstractBufferedFile`

File-like object for reading and writing files in the DataRobot file system.

Supports read modes ‘r’, ‘rb’ and write modes ‘w’, ‘wb’,
‘xb’. DataRobot file system buffers writes in memory only before
uploading on close.

- Variables:

#### SEE ALSO

[open()](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem.open)

#### write(data)

Write data to buffer.

- Parameters: data ( bytes ) – Data to write as bytes.
- Returns: Number of bytes written.
- Return type: int
- Raises: ValueError – If the file is not in write mode, is closed, or has been force-flushed.

#### flush(force=False)

Write the buffered data to the DataRobot file system if force is True.

> [!NOTE] Notes
> Since DataRobot file system does not support multipart uploads,
> calling flush without force does not upload any data.

- Parameters: force ( bool ) – Whether to force flush and upload data. Disallows further writing to this file.
- Raises: ValueError – If the file is closed or if force flush has already been called.
- Return type: None

#### upload()

Alias of `flush(force=True)`.

- Return type: None

#### close()

Close file. Finalizes writes, discards cache.

- Return type: None

#### property url : str

A signed URL for the file.

#### commit()

Move from temp to final destination

#### discard()

Throw away temporary file

#### fileno()

Returns underlying file descriptor if one exists.

OSError is raised if the IO object does not use a file descriptor.

#### info()

File information about this path

#### isatty()

Return whether this is an ‘interactive’ stream.

Return False if it can’t be determined.

#### read(length=-1)

Return data from cache, or fetch pieces as necessary

- Parameters: length ( int (-1) ) – Number of bytes to read; if <0, all remaining bytes.

#### readable()

Whether opened for reading

#### readinto(b)

mirrors builtin file’s readinto method

[https://docs.python.org/3/library/io.html#io.RawIOBase.readinto](https://docs.python.org/3/library/io.html#io.RawIOBase.readinto)

#### readline()

Read until and including the first occurrence of newline character

Note that, because of character encoding, this is not necessarily a
true line ending.

#### readlines()

Return all data, split by the newline character, including the newline character

#### readuntil(char=b'\n', blocks=None)

Return data between current position and first occurrence of char

char is included in the output, except if the end of the tile is
encountered first.

- Parameters:

#### seek(loc, whence=0)

Set current file location

- Parameters:

#### seekable()

Whether is seekable (only in read mode)

#### tell()

Current file location

#### truncate()

Truncate file to size bytes.

File pointer is left unchanged.  Size defaults to the current IO
position as reported by tell().  Returns the new size.

#### property use_range_headers : bool

Whether to use range headers when reading data from file URL.

#### writable()

Whether opened for writing

#### writelines(lines,)

Write a list of lines to stream.

Line separators are not added, so it is usual for each of the
lines provided to have a line separator at the end.

#### property is_datarobot_url_for_read : bool

Whether the file URL is a DataRobot URL.

#### property read_client : Session

Session client to use for reading data from file URL.
Supports unauthenticated clients for URLs outside DataRobot with embedded authentication.

### class datarobot.fs.file_system.DataRobotFSMap

Bases: `FSMap`

Wrap a [DataRobotFileSystem](https://docs.datarobot.com/en/docs/api/reference/sdk/file-system.html.md#datarobot.fs.file_system.DataRobotFileSystem) instance as a mutable mapping.

The keys of the mapping become files under the given root, and the
values (which must be bytes) the contents of those files.

- Parameters:

> [!NOTE] Examples
> ```
> >>> from datarobot.fs import DataRobotFileSystem, DataRobotFSMap
> >>> fs = DataRobotFileSystem()
> >>> map = DataRobotFSMap("dr://696935d6d5a04a752419cf6d/", fs)
> ```
> 
> Retrieve file contents from file system using map:
> 
> ```
> >>> map["file.txt"]
> b"Hello, world!"
> >>> "folder/path/file.txt" in map
> True
> >>> file_count = len(map)
> >>> file_count
> 3
> >>> [file for file in map]
> ["file.txt", "folder/path/file.txt", "another/folder/file.txt"]
> >>> map.getitems(["file.txt", "folder/path/file.txt", "another/folder/file.txt"])
> {
>     "file.txt": b"Hello, world!",
>     "folder/path/file.txt": b"Hello, world!",
>     "another/folder/file.txt": b"Hello, world!",
> }
> ```
> 
> Set file contents in file system using map:
> 
> ```
> >>> map["file.txt"] = b"Hello, world!"
> >>> map["folder/path/new_file.txt"] = b"This is a new file!"
> >>> map.setitems({
>     "another/folder/file.txt": b"Hello, world!",
>     "folder/path/new_file.txt": b"This is a new file!",
> })
> ```
> 
> Delete files from file system using map:
> 
> ```
> >>> del map["file.txt"]
> >>> map.delitems(["folder/path/new_file.txt", "another/folder/file.txt"])
> >>> map.pop("file.txt", "default_value_if_file_does_not_exist")
> b'Hello, world!'
> >>> map.pop("folder/path/non_existent_file.txt", "default_value_if_file_does_not_exist")
> 'default_value_if_file_does_not_exist'
> ```
> 
> Clear all files under the map root directory. This may have unintended consequences as
> DataRobot file system does not support empty directories:
> 
> ```
> >>> map.clear()
> >>> len(map)
> 0
> ```

#### delitems(keys)

Remove multiple keys from the store

#### property dirfs

dirfs instance that can be used with the same keys as the mapper

#### get(k) → D[k] if k in D, else d. d defaults to None.

#### getitems(keys, on_error='raise')

Fetch multiple items from the store

If the backend is async-able, this might proceed concurrently

- Parameters:
- Return type: dict(key , bytes|exception)

#### items() → a set-like object providing a view on D's items

#### keys() → a set-like object providing a view on D's keys

#### pop(key, default=None)

Pop data

#### popitem() → (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

#### setdefault(k) → D.get(k,d), also set D[k]=d if k not in D

#### setitems(values_dict)

Set the values of multiple items in the store

- Parameters: values_dict ( dict(str , bytes) )

#### update(**F) → None. Update D from mapping/iterable E and F.

If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v

#### values() → an object providing a view on D's values

#### clear()

Remove all keys below root. Empties out the mapping.

> [!NOTE] Notes
> May delete more directories than expected as DataRobot
> file system does not support empty directories.

- Return type: None

## Enum and Helpers

### class datarobot.fs.file_system.FileInfo

Information about a file or directory in DataRobot File System.

- Variables:

### class datarobot.enums.FilesOverwriteStrategy

Strategy to handle naming conflicts when writing to a path where a file already exists.

#### RENAME = 'rename'

Rename an uploaded file using “ (n).ext” pattern.

#### REPLACE = 'replace'

Overwrite the existing file.

#### SKIP = 'skip'

Skip uploading if a file already exists at the target path.

#### ERROR = 'error'

Raise FileExistsError if a file already exists at the target path.
