maestral.core

Dataclasses for our internal and external APIs.

Module Contents

class maestral.core.AccountType[source]

Bases: enum.Enum

Enum of account types

Basic = 'basic'[source]
Pro = 'pro'[source]
Business = 'business'[source]
Other = 'other'[source]
class maestral.core.Team[source]

A group of users with joint access to shared folders

id: str[source]

Unique identifier of the team

name: str[source]

Display name of the team

class maestral.core.RootInfo[source]

Namespace info for the root of a shared filesystem

root_namespace_id: str[source]

Unique ID of the user’s root namespace

home_namespace_id: str[source]

Unique ID of the user’s personal namespace

This will be different from root_namespace_id when Maestral is set up to sync the shared folder of a team.

class maestral.core.UserRootInfo[source]

Bases: RootInfo

Namespace info for the root of a shared filesystem

class maestral.core.TeamRootInfo[source]

Bases: RootInfo

Namespace info for the root of a shared filesystem

home_path: str[source]

Path of the user’s personal home folder relative to the root namespace

Only present for accounts set up as part of a team when syncing the entire team’s folder.

class maestral.core.Account[source]

Represents the user’s account

account_id: str[source]

Unique account ID

display_name: str[source]

The user’s name for display purposes

email: str[source]

The user’s email address

email_verified: bool[source]

Whether the email address was verified

profile_photo_url: str | None[source]

A URL to the user’s photo

disabled: bool[source]

Whether the account is disabled

class maestral.core.FullAccount[source]

Bases: Account

Represents the user’s account and sync information

country: str | None[source]

The user’s country

locale: str[source]

The user’s locale

team: Team | None[source]

The team that a user belongs to, if any

team_member_id: str | None[source]

The member ID of user in a team, if any

account_type: AccountType[source]

The account type

root_info: RootInfo[source]

The user’s root namespace to sync

class maestral.core.SpaceUsage[source]

Space usage information

used: int[source]

Space used by in bytes

allocated: int[source]

Space available in bytes

class maestral.core.PersonalSpaceUsage[source]

Bases: SpaceUsage

Space usage information for a user

team_usage: SpaceUsage | None[source]

Space usage of a user’s team, if any

class maestral.core.WriteMode[source]

Bases: enum.Enum

Enum of write modes when uploading a file

Add = 'add'[source]
Update = 'update'[source]
Overwrite = 'overwrite'[source]
class maestral.core.Metadata[source]

Base class for sync item metadata

name: str[source]

Name of the file or folder

path_lower: str[source]

Normalised path on the server

path_display: str[source]

Cased path for display purposes and the local file system

class maestral.core.DeletedMetadata[source]

Bases: Metadata

Metadata of a deleted item

class maestral.core.FileMetadata[source]

Bases: Metadata

File metadata

id: str[source]

Unique ID on the server

client_modified: datetime.datetime[source]

Modified time in UTC as provided by clients

server_modified: datetime.datetime[source]

Server-side modified time in UTC

rev: str[source]

Unique ID of this version of a file

size: int[source]

File size in bytes

If the file is a symlink, path of the target relative to the root namespace

shared: bool[source]

Whether the file is shared

modified_by: str | None[source]

Unique ID of the account that created / modified this revision

is_downloadable: bool[source]

Whether the file can be downloaded

content_hash: str[source]

A content hash of the file

class maestral.core.FolderMetadata[source]

Bases: Metadata

Folder metadata

id: str[source]

Unique ID on the server

shared: bool[source]

Whether the folder is shared

class maestral.core.ListFolderResult[source]

Result from listing the contents of a folder

entries: list[Metadata][source]

List of entries

has_more: bool[source]

Whether there are more entries than listed

cursor: str[source]

Cursor to iterate and fetch more entries

class maestral.core.LinkAccessLevel[source]

Bases: enum.Enum

Enum of access levels to shared links

Viewer = 'viewer'[source]
Editor = 'editor'[source]
Other = 'other'[source]
class maestral.core.LinkAudience[source]

Bases: enum.Enum

Enum of shared link audience

Public = 'public'[source]
Team = 'team'[source]
NoOne = 'no_one'[source]
Other = 'other'[source]
class maestral.core.LinkPermissions[source]

Permissions for a shared link

can_revoke: bool[source]

If the link can be revoked

allow_download: bool[source]

If the link allows users to download the item

effective_audience: LinkAudience[source]

The effective audience of link (who can use it)

The type of access that the link grants to the item (how they can use it)

require_password: bool | None[source]

Whether a password is required when accessing the item through this link

Note that users who already have access to an item otherwise will not need a password regardless of this value.

class maestral.core.SharedLinkMetadata[source]

Metadata for a shared link

url: str[source]

The URL string

name: str[source]

The basename of the item

path_lower: str | None[source]

The normalised path of the item

expires: datetime.datetime | None[source]

Expiry time for a link in UTC

Permissions that a link grants its users

class maestral.core.ListSharedLinkResult[source]

Result from listing shared links

entries: list[SharedLinkMetadata][source]

List of shared link metadata

has_more: bool[source]

Whether there are more items to fetch

cursor: str[source]

A cursor to continue iterating over shared links

class maestral.core.UpdateCheckResult[source]

Information on update availability

update_available: bool[source]

Whether an update to Maestral is available

latest_release: str[source]

The latest release that can be updated to

release_notes: str[source]

Release notes for all releases between the currently running version up to and including the latest version