arbor_imago.core package
Submodules
arbor_imago.core.config module
arbor_imago.core.types module
- class arbor_imago.core.types.AccessTokenCookieConfig[source]
Bases:
TypedDict
- httponly: NotRequired[bool]
- key: str
- samesite: NotRequired[Literal['lax', 'strict', 'none']]
- secure: NotRequired[bool]
- class arbor_imago.core.types.AccessTokenCookieConfigFromFile[source]
Bases:
TypedDict
- httponly: bool
- key: str
- samesite: Literal['lax', 'strict', 'none']
- secure: bool
- class arbor_imago.core.types.ApiKey[source]
Bases:
AuthCredential
- id
alias of
str
- name
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=256, pattern=None
)]
- order_by
alias of
Literal
[‘issued’, ‘expiry’, ‘name’]
- class arbor_imago.core.types.ApiKeyScope[source]
Bases:
_ApiKeyScopeBase
- id
alias of
ApiKeyScopeId
- class arbor_imago.core.types.ApiKeyScopeId(api_key_id, scope_id)[source]
Bases:
NamedTuple
- api_key_id: str
Alias for field number 0
- scope_id: int
Alias for field number 1
- class arbor_imago.core.types.AuthConfig[source]
Bases:
TypedDict
- credential_lifespans: dict[Literal['access_token', 'magic_link', 'request_sign_up', 'otp'], timedelta]
- jwt_algorithm: str
- jwt_secret_key: str
- class arbor_imago.core.types.AuthConfigFromFile[source]
Bases:
TypedDict
- credential_lifespans: dict[Literal['access_token', 'magic_link', 'request_sign_up', 'otp'], Annotated[str, 'ISO 8601 duration string']]
- jwt_algorithm: str
- class arbor_imago.core.types.AuthCredential[source]
Bases:
object
- expiry_timestamp
alias of
Annotated
[float
, ‘The datetime at which the auth credential will expire’]
- issued_timestamp
alias of
Annotated
[float
, ‘The datetime at which the auth credential was issued’]
- type
alias of
Literal
[‘access_token’, ‘api_key’, ‘otp’, ‘sign_up’]
- class arbor_imago.core.types.BackendConfigFromFile[source]
Bases:
TypedDict
- ACCESS_TOKEN_COOKIE: AccessTokenCookieConfigFromFile
- AUTH: AuthConfigFromFile
- GOOGLE_CLIENT_PATH: str
- MEDIA_DIR: str
- OPENAPI_SCHEMA_PATHS: dict[Literal['gallery'], PathLike[str] | str]
- UVICORN: UvicornConfigFromFile
- class arbor_imago.core.types.File[source]
Bases:
object
- gallery_id
alias of
str
- id
alias of
str
- size
alias of
int
- stem
alias of
str
- suffix
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=True, strict=None
, min_length=None
, max_length=None
, pattern=None
)]
- class arbor_imago.core.types.Gallery[source]
Bases:
object
- class date
Bases:
object
date(year, month, day) –> date object
- ctime()
Return ctime() style string.
- day
- classmethod fromisocalendar()
int, int, int -> Construct a date from the ISO year, week number and weekday.
This is the inverse of the date.isocalendar() function
- classmethod fromisoformat(object, /)
str -> Construct a date from a string in ISO 8601 format.
- classmethod fromordinal()
int -> date corresponding to a proleptic Gregorian ordinal.
- classmethod fromtimestamp(timestamp, /)
Create a date from a POSIX timestamp.
The timestamp is a number, e.g. created via time.time(), that is interpreted as local time.
- isocalendar()
Return a named tuple containing ISO year, week number, and weekday.
- isoformat()
Return string in ISO 8601 format, YYYY-MM-DD.
- isoweekday()
Return the day of the week represented by the date. Monday == 1 … Sunday == 7
- max = datetime.date(9999, 12, 31)
- min = datetime.date(1, 1, 1)
- month
- replace()
Return date with new specified fields.
- resolution = datetime.timedelta(days=1)
- strftime()
format -> strftime() style string.
- timetuple()
Return time tuple, compatible with time.localtime().
- classmethod today()
Current date or datetime: same as self.__class__.fromtimestamp(time.time()).
- toordinal()
Return proleptic Gregorian ordinal. January 1 of year 1 is day 1.
- weekday()
Return the day of the week represented by the date. Monday == 0 … Sunday == 6
- year
- description
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=0, max_length=20000, pattern=None
)]
- folder_name
alias of
str
- id
alias of
str
- name
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=256, pattern=re.compile(‘^(?!\d{4}-\d{2}-\d{2} ).*’))]
- parent_id
alias of
str
- user_id
alias of
str
- visibility_level
alias of
int
- class arbor_imago.core.types.GalleryDateAndName(date, name)[source]
Bases:
NamedTuple
- name: str
Alias for field number 1
- class arbor_imago.core.types.GalleryPermission[source]
Bases:
_GalleryPermissionBase
- id
alias of
GalleryPermissionId
- class arbor_imago.core.types.GalleryPermissionId(gallery_id, user_id)[source]
Bases:
NamedTuple
- gallery_id: str
Alias for field number 0
- user_id: str
Alias for field number 1
Bases:
TypedDict
- class arbor_imago.core.types.ImageFileMetadata[source]
Bases:
object
- file_id
alias of
str
- scale
alias of
int
- version_id
alias of
str
- class arbor_imago.core.types.ImageVersion[source]
Bases:
object
- aspect_ratio
alias of
float
- average_color
alias of
str
- base_name
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=240, pattern=re.compile(‘^(?!.*_).+$’))]
- class datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
Bases:
date
The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.
- astimezone()
tz -> convert to local time in new timezone tz
- classmethod combine()
date, time -> datetime with same date and time fields
- ctime()
Return ctime() style string.
- date()
Return date object with same year, month and day.
- dst()
Return self.tzinfo.dst(self).
- fold
- classmethod fromisoformat(object, /)
string -> datetime from a string in most ISO 8601 formats
- classmethod fromtimestamp()
timestamp[, tz] -> tz’s local time from POSIX timestamp.
- hour
- isoformat()
[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.
- max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
- microsecond
- min = datetime.datetime(1, 1, 1, 0, 0)
- minute
- classmethod now(tz=None)
Returns new datetime object representing current time local to tz.
- tz
Timezone object.
If no tz is specified, uses local timezone.
- replace()
Return datetime with new specified fields.
- resolution = datetime.timedelta(microseconds=1)
- second
- classmethod strptime()
string, format -> new datetime parsed from a string (like time.strptime()).
- time()
Return time object with same time but with tzinfo=None.
- timestamp()
Return POSIX timestamp as float.
- timetuple()
Return time tuple, compatible with time.localtime().
- timetz()
Return time object with same time and tzinfo.
- tzinfo
- tzname()
Return self.tzinfo.tzname(self).
- classmethod utcfromtimestamp()
Construct a naive UTC datetime from a POSIX timestamp.
- classmethod utcnow()
Return a new datetime representing UTC day and time.
- utcoffset()
Return self.tzinfo.utcoffset(self).
- utctimetuple()
Return UTC time tuple, compatible with time.localtime().
- description
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=0, max_length=20000, pattern=None
)]
- gallery_id
alias of
str
- id
alias of
str
- parent_id
alias of
str
- version
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=None
, max_length=None
, pattern=re.compile(‘^(?!\d{2}$).+$’))]
- class arbor_imago.core.types.LoggerConfig[source]
Bases:
TypedDict
- level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
- class arbor_imago.core.types.OTP[source]
Bases:
AuthCredential
- code
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=6, max_length=6, pattern=re.compile(‘^\d{6}$’))]
- hashed_code
alias of
str
- id
alias of
str
- class arbor_imago.core.types.PermissionLevel[source]
Bases:
object
- id
alias of
int
- name
alias of
Literal
[‘editor’, ‘viewer’]
- class arbor_imago.core.types.Scope[source]
Bases:
object
- id
alias of
int
- name
alias of
Literal
[‘admin’, ‘users.read’, ‘users.write’]
Bases:
TypedDict
- class arbor_imago.core.types.SignUp[source]
Bases:
AuthCredential
- email
alias of
Annotated
[EmailStr
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=254, pattern=None
)]
- class arbor_imago.core.types.User[source]
Bases:
object
- email
alias of
Annotated
[EmailStr
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=254, pattern=None
)]
- hashed_password
alias of
str
- id
alias of
str
- password
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=None
, strict=None
, min_length=1, max_length=64, pattern=None
)]
- phone_number
alias of
str
- user_role_id
alias of
int
- username
alias of
Annotated
[str
,StringConstraints
(strip_whitespace=None
, to_upper=None
, to_lower=True, strict=None
, min_length=3, max_length=20, pattern=re.compile(‘^[a-zA-Z0-9_.-]+$’))]
- class arbor_imago.core.types.UserAccessToken[source]
Bases:
AuthCredential
- id
alias of
str
- class arbor_imago.core.types.UserRole[source]
Bases:
object
- id
alias of
int
- name
alias of
Literal
[‘admin’, ‘user’]
- class arbor_imago.core.types.UvicornConfig[source]
Bases:
TypedDict
- run_kwargs: dict
- use_string_import: NotRequired[bool]