jetraw package¶
Module contents¶
- jetraw.get_default_client()¶
Get the default client instance.
Creates a new default client if none has been set. The default client is used by all global operations when no specific client is provided.
- Returns:
The default client instance
- Return type:
Example
>>> client = get_default_client() >>> # Use the client for operations >>> client.download(JetrawPath("/my-space/file.tiff"))
- jetraw.set_default_client(client)¶
Set the default client instance.
The default client will be used by all global operations when no specific client is provided.
- Parameters:
client (
Client
) – The client instance to use as default
Example
>>> from jetraw import Client >>> client = Client(organization="my-org") >>> set_default_client(client) >>> # Now all global operations use this client >>> download(JetrawPath("/my-space/file.tiff"))
- jetraw.authorize(timeout=None, *, client=None)¶
Start the authorization flow using a web browser and user credentials.
Opens a web browser for the user to authenticate and authorize the application.
- Parameters:
timeout (
Optional
[timedelta
]) – Maximum time to wait for authorization (default: 1 minute)client (
Optional
[Client
]) – Client instance to use (uses default if None)
Example
>>> # Authorize with default timeout >>> authorize() >>> >>> # Authorize with custom timeout >>> from datetime import timedelta >>> authorize(timeout=timedelta(minutes=5))
- jetraw.download(from_path, to_path='', *, client=None, storages=None)¶
Download files from Jetraw.
- Parameters:
from_path (
Union
[List
[Path
],Path
]) – Remote path(s) to download from (JetrawPath, string, or list)to_path (
PathLike
) – Local path to download to (current directory if empty)client (
Optional
[Client
]) – Client instance to use (uses default if None)storages (
Optional
[List
[str
]]) – List of storage IDs to use
- Returns:
Result of the download operation
- Return type:
str
Example
>>> # Download single file using JetrawPath >>> download(JetrawPath("/my-space/file.tiff"), "/local/") >>> >>> # Download single file using string >>> download("/my-space/file.tiff", "/local/") >>> >>> # Download multiple files >>> download([ ... JetrawPath("/my-space/file1.tiff"), ... "/my-space/file2.tiff" ... ], "/local/directory/")
- jetraw.upload(from_path, to_path, *, client=None, calibration_id=None)¶
Upload files to Jetraw.
- Parameters:
- Returns:
Result of the upload operation
- Return type:
str
Example
>>> # Upload single file using JetrawPath >>> upload("/local/file.tiff", JetrawPath("/my-space/file.tiff")) >>> >>> # Upload single file using string >>> upload("/local/file.tiff", "/my-space/file.tiff") >>> >>> # Upload multiple files >>> upload([ ... "/local/file1.tiff", ... "/local/file2.tiff" ... ], JetrawPath("/my-space/directory/"))
- class jetraw.Client(*, organization=None, config_file=None, shared_credentials_file=None, host=None, access_token=None, refresh_token=None, refresh_token_if_empty=True, skip_compatibility_check=False)¶
Main client for interacting with Jetraw services.
Provides authentication, file operations, and connection management for the Jetraw filesystem and services.
Example
>>> # Create client with organization >>> client = Client(organization="my-org") >>> >>> # Create client with explicit host and token >>> client = Client(host="https://my-org.jetraw.com", access_token="token") >>> >>> # Create client from config file >>> client = Client(config_file="~/.jetraw/config")
Submodules¶
- jetraw.client module
- jetraw.license module
- jetraw.links module
- jetraw.path module
Path
Path.absolute()
Path.as_posix()
Path.as_uri()
Path.client
Path.copy_to()
Path.exists()
Path.file_id
Path.file_info()
Path.get_items()
Path.host
Path.id
Path.is_absolute()
Path.is_block_device()
Path.is_char_device()
Path.is_dir()
Path.is_fifo()
Path.is_file()
Path.is_junction()
Path.is_loaded
Path.is_mount()
Path.is_reserved()
Path.is_socket()
Path.is_space()
Path.is_symlink()
Path.iterdir()
Path.joinpath()
Path.mkdir()
Path.move_to()
Path.name
Path.parent
Path.parent_id
Path.remove()
Path.rename()
Path.resolve()
Path.root
Path.samefile()
Path.space_id
Path.stat()
Path.stem
Path.suffix
Path.suffixes
Path.unlink()
Path.with_segments()
- jetraw.spaces module
- jetraw.storages module
- jetraw.trash module
- jetraw.users module