Files
albert.resources.files
FileNamespace
The storage namespace a file lives in.
Attributes:
| Name | Type | Description |
|---|---|---|
AGENT |
Files used by Albert agents. |
|
BREAKTHROUGH |
Files associated with Breakthrough (data science / modeling). |
|
PIPELINE |
Files used by data pipelines. |
|
PUBLIC |
Publicly accessible files. |
|
RESULT |
Files produced as results and attached to entities (the common default). |
|
SDS |
Safety Data Sheet files. |
BREAKTHROUGH
Files associated with Breakthrough (data science / modeling).
FileCategory
SignURLPOSTFile
Bases: BaseAlbertModel
Request entry describing a single file to be signed for upload.
Used internally to build the payload for
get_signed_upload_url.
Show JSON schema:
{
"$defs": {
"FileCategory": {
"description": "The kind of file being stored.",
"enum": [
"SDS",
"Other"
],
"title": "FileCategory",
"type": "string"
},
"FileNamespace": {
"description": "The storage namespace a file lives in.",
"enum": [
"agent",
"breakthrough",
"pipeline",
"public",
"result",
"sds"
],
"title": "FileNamespace",
"type": "string"
}
},
"description": "Request entry describing a single file to be signed for upload.\n\nUsed internally to build the payload for\n[`get_signed_upload_url`][albert.collections.files.FileCollection.get_signed_upload_url].",
"properties": {
"name": {
"description": "The name (storage key) to store the file under.",
"title": "Name",
"type": "string"
},
"namespace": {
"$ref": "#/$defs/FileNamespace",
"description": "The namespace to store the file in."
},
"contentType": {
"description": "The MIME type of the file.",
"title": "Contenttype",
"type": "string"
},
"metadata": {
"anyOf": [
{
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional key/value metadata to store with the file.",
"title": "Metadata"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/FileCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the file (e.g. SDS, Other)."
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The signed URL returned by the API for this file.",
"title": "Url"
}
},
"required": [
"name",
"namespace",
"contentType"
],
"title": "SignURLPOSTFile",
"type": "object"
}
Fields:
-
name(str) -
namespace(FileNamespace) -
content_type(str) -
metadata(list[dict[str, str]] | None) -
category(FileCategory | None) -
url(str | None)
metadata
Optional key/value metadata to store with the file.
SignURLPOST
Bases: BaseAlbertModel
Request body wrapping the list of files to sign for upload.
Show JSON schema:
{
"$defs": {
"FileCategory": {
"description": "The kind of file being stored.",
"enum": [
"SDS",
"Other"
],
"title": "FileCategory",
"type": "string"
},
"FileNamespace": {
"description": "The storage namespace a file lives in.",
"enum": [
"agent",
"breakthrough",
"pipeline",
"public",
"result",
"sds"
],
"title": "FileNamespace",
"type": "string"
},
"SignURLPOSTFile": {
"description": "Request entry describing a single file to be signed for upload.\n\nUsed internally to build the payload for\n[`get_signed_upload_url`][albert.collections.files.FileCollection.get_signed_upload_url].",
"properties": {
"name": {
"description": "The name (storage key) to store the file under.",
"title": "Name",
"type": "string"
},
"namespace": {
"$ref": "#/$defs/FileNamespace",
"description": "The namespace to store the file in."
},
"contentType": {
"description": "The MIME type of the file.",
"title": "Contenttype",
"type": "string"
},
"metadata": {
"anyOf": [
{
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional key/value metadata to store with the file.",
"title": "Metadata"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/FileCategory"
},
{
"type": "null"
}
],
"default": null,
"description": "The category of the file (e.g. SDS, Other)."
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The signed URL returned by the API for this file.",
"title": "Url"
}
},
"required": [
"name",
"namespace",
"contentType"
],
"title": "SignURLPOSTFile",
"type": "object"
}
},
"description": "Request body wrapping the list of files to sign for upload.",
"properties": {
"files": {
"description": "The files to request signed upload URLs for.",
"items": {
"$ref": "#/$defs/SignURLPOSTFile"
},
"title": "Files",
"type": "array"
}
},
"required": [
"files"
],
"title": "SignURLPOST",
"type": "object"
}
Fields:
FileInfo
Bases: BaseAlbertModel
Metadata about a stored file in Albert.
Returned by
get_by_name. Its name
can be used as the key of an
Attachment.
Show JSON schema:
{
"$defs": {
"FileNamespace": {
"description": "The storage namespace a file lives in.",
"enum": [
"agent",
"breakthrough",
"pipeline",
"public",
"result",
"sds"
],
"title": "FileNamespace",
"type": "string"
}
},
"description": "Metadata about a stored file in Albert.\n\nReturned by\n[`get_by_name`][albert.collections.files.FileCollection.get_by_name]. Its ``name``\ncan be used as the ``key`` of an\n[`Attachment`][albert.resources.attachments.Attachment].",
"properties": {
"name": {
"description": "The name (storage key) of the file.",
"title": "Name",
"type": "string"
},
"size": {
"description": "The size of the file in bytes.",
"title": "Size",
"type": "integer"
},
"etag": {
"description": "The storage entity tag (checksum) for the file.",
"title": "Etag",
"type": "string"
},
"namespace": {
"anyOf": [
{
"$ref": "#/$defs/FileNamespace"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The namespace the file is stored in.",
"title": "Namespace"
},
"contentType": {
"description": "The MIME type of the file.",
"title": "Contenttype",
"type": "string"
},
"lastModified": {
"description": "When the file was last modified.",
"format": "date-time",
"title": "Lastmodified",
"type": "string"
},
"metadata": {
"description": "Key/value metadata stored with the file.",
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"title": "Metadata",
"type": "array"
}
},
"required": [
"name",
"size",
"etag",
"contentType",
"lastModified"
],
"title": "FileInfo",
"type": "object"
}
Fields:
-
name(str) -
size(int) -
etag(str) -
namespace(FileNamespace | str | None) -
content_type(str) -
last_modified(datetime) -
metadata(list[dict[str, str]])