:tocdepth: 3 :py:mod:`gws` ============= .. py:module:: gws .. autoapi-nested-parse:: Basic types. This module contains essential type definitions and utilities from the core GWS library. It should be imported in every gws module. **Source code:** :source:`gws<gws/__init__.py>` Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 1 base/index.rst config/index.rst core/index.rst ext/index.rst gis/index.rst helper/index.rst lib/index.rst plugin/index.rst server/index.rst spec/index.rst test/index.rst Package Contents ---------------- .. py:class:: Access Bases: :py:obj:`Enum` Access mode. .. py:attribute:: create :value: 'create' .. py:attribute:: delete :value: 'delete' .. py:attribute:: read :value: 'read' .. py:attribute:: write :value: 'write' .. py:data:: Acl :type: TypeAlias Access Control list. A list of tuples ``(ACL bit, role-name)`` where ``ACL bit`` is ``1`` if the access is allowed and ``0`` otherwise. .. py:data:: AclStr :type: TypeAlias A string of comma-separated pairs ``allow <role>`` or ``deny <role>``. .. py:class:: Action Bases: :py:obj:`Node` Configurable GWS object. .. py:class:: ActionManager Bases: :py:obj:`Node` Action manager. .. py:method:: actions_for_project(project: Project, user: User) -> list[Action] Get a list of actions for a Project, to which a User has access to. .. py:method:: find_action(project: Optional[Project], ext_type: str, user: User) -> Optional[Action] Locate an Action object. :param project: Project to se :param ext_type: :param user: Returns: .. py:method:: prepare_action(command_category: CommandCategory, command_name: str, params: dict, user: User, read_options=None) -> tuple[Callable, Request] .. py:class:: Application Bases: :py:obj:`Node` The main Application object. .. py:attribute:: actionMgr :type: ActionManager .. py:attribute:: actions :type: list[Action] .. py:attribute:: authMgr :type: AuthManager .. py:attribute:: client :type: Client .. py:attribute:: databaseMgr :type: DatabaseManager .. py:attribute:: defaultPrinter :type: Printer .. py:attribute:: finders :type: list[Finder] .. py:attribute:: localeUids :type: list[str] .. py:attribute:: metadata :type: Metadata .. py:attribute:: middlewareMgr :type: MiddlewareManager .. py:attribute:: modelMgr :type: ModelManager .. py:attribute:: models :type: list[Model] .. py:attribute:: monitor :type: ServerMonitor .. py:attribute:: owsServices :type: list[OwsService] .. py:attribute:: printerMgr :type: PrinterManager .. py:attribute:: printers :type: list[Printer] .. py:attribute:: projects :type: list[Project] .. py:attribute:: searchMgr :type: SearchManager .. py:attribute:: serverMgr :type: ServerManager .. py:attribute:: storageMgr :type: StorageManager .. py:attribute:: templateMgr :type: TemplateManager .. py:attribute:: templates :type: list[Template] .. py:attribute:: version :type: str .. py:attribute:: versionString :type: str .. py:attribute:: webMgr :type: WebManager .. py:method:: developer_option(key: str) Get a value of a developer option. .. py:method:: helper(ext_type: str) -> Optional[Node] Get a Helper object by its extension type. .. py:method:: project(uid: str) -> Optional[Project] Get a Project object by its uid. .. py:class:: ApplicationManifest(*args, **kwargs) Bases: :py:obj:`Data` Application manifest. .. py:attribute:: excludePlugins :type: Optional[list[str]] Names of the core plugins that should be deactivated. .. py:attribute:: locales :type: list[str] Locale names supported by this application. .. py:attribute:: plugins :type: Optional[list[ApplicationManifestPlugin]] Custom plugins. .. py:attribute:: withFallbackConfig :type: bool :value: False Use a minimal fallback configuration. .. py:attribute:: withStrictConfig :type: bool :value: False Stop the application upon a configuration error. .. py:class:: ApplicationManifestPlugin(*args, **kwargs) Bases: :py:obj:`Data` Plugin description. .. py:attribute:: name :type: str :value: '' Optional name, when omitted, the directory name will be used. .. py:attribute:: path :type: DirPath Path to the plugin python module. .. py:class:: AttributeType Bases: :py:obj:`Enum` Feature attribute type. .. py:attribute:: bool :value: 'bool' .. py:attribute:: bytes :value: 'bytes' .. py:attribute:: date :value: 'date' .. py:attribute:: datetime :value: 'datetime' .. py:attribute:: feature :value: 'feature' .. py:attribute:: featurelist :value: 'featurelist' .. py:attribute:: file :value: 'file' .. py:attribute:: float :value: 'float' .. py:attribute:: floatlist :value: 'floatlist' .. py:attribute:: geometry :value: 'geometry' .. py:attribute:: int :value: 'int' .. py:attribute:: intlist :value: 'intlist' .. py:attribute:: str :value: 'str' .. py:attribute:: strlist :value: 'strlist' .. py:attribute:: time :value: 'time' .. py:class:: AuthManager Bases: :py:obj:`Node` Authentication manager. .. py:attribute:: guestSession :type: AuthSession Preconfigured Guest session. .. py:attribute:: guestUser :type: User Preconfigured Guest user. .. py:attribute:: methods :type: list[AuthMethod] Authentication methods. .. py:attribute:: mfAdapters :type: list[AuthMultiFactorAdapter] Authentication MFA handlers. .. py:attribute:: providers :type: list[AuthProvider] Authentication providers. .. py:attribute:: sessionMgr :type: AuthSessionManager Session manager. .. py:attribute:: systemUser :type: User Preconfigured System user. .. py:method:: authenticate(method: AuthMethod, credentials: Data) -> Optional[User] Authenticate a user. :param method: Authentication method. :param credentials: Credentials object. :returns: An authenticated User or ``None`` if authentication failed. .. py:method:: get_method(uid: str) -> Optional[AuthMethod] Get an authentication Method by its uid. :param uid: Uid. :returns: A Method or ``None``. .. py:method:: get_mf_adapter(uid: str) -> Optional[AuthMultiFactorAdapter] Get an authentication Provider by its uid. :param uid: Uid. :returns: A Provider or ``None``. .. py:method:: get_provider(uid: str) -> Optional[AuthProvider] Get an authentication Provider by its uid. :param uid: Uid. :returns: A Provider or ``None``. .. py:method:: get_user(user_uid: str) -> Optional[User] Get a User by its global uid. :param user_uid: Global user uid. :returns: A User or ``None``. .. py:method:: serialize_user(user: User) -> str Return a string representation of a User. :param user: A User object. :returns: A json string. .. py:method:: unserialize_user(ser: str) -> Optional[User] Restore a User object from a serialized representation. :param ser: A json string. :returns: A User object. .. py:class:: AuthMethod Bases: :py:obj:`Node` Authentication Method. .. py:attribute:: authMgr :type: AuthManager .. py:attribute:: secure :type: bool Method is only allowed in a secure context. .. py:method:: close_session(req: WebRequester, res: WebResponder) -> bool Close a previously opened Session. :param req: Requester object. :param res: Responder object. :returns: True if the Session was successfully closed. .. py:method:: open_session(req: WebRequester) -> Optional[AuthSession] Attempt to open a Session for a Requester. :param req: Requester object. :returns: A Session or ``None``. .. py:class:: AuthMultiFactorAdapter Bases: :py:obj:`Node` Multi-factor authentication adapter. .. py:attribute:: lifeTime :type: int .. py:attribute:: maxRestarts :type: int .. py:attribute:: maxVerifyAttempts :type: int .. py:attribute:: message :type: str .. py:method:: cancel(mfa: AuthMultiFactorTransaction) Cancel the transaction. .. py:method:: check_restart(mfa: AuthMultiFactorTransaction) -> bool Check if the transaction can be restarted. .. py:method:: check_state(mfa: AuthMultiFactorTransaction) -> bool Check if the MFA transaction is valid. .. py:method:: key_uri(secret: str | bytes, issuer_name: str, account_name: str) -> Optional[str] Generate a key uri for this adapter. .. py:method:: restart(mfa: AuthMultiFactorTransaction) -> Optional[AuthMultiFactorTransaction] Restart the transaction. .. py:method:: start(user: User) -> Optional[AuthMultiFactorTransaction] Initialize an MFA transaction for the user. .. py:method:: verify(mfa: AuthMultiFactorTransaction, payload: dict) -> AuthMultiFactorTransaction Verify a payload. .. py:class:: AuthMultiFactorState Bases: :py:obj:`Enum` Enumeration type. Despite being declared as extending ``Enum`` (for IDE support), this class is actually just a simple object and intended to be used as a collection of attributes. It doesn't provide any ``Enum``-specific utilities. The rationale behind this is that we need ``Enum`` members (e.g. ``Color.RED``) to be scalars, and not complex objects as in the standard ``Enum``. .. py:attribute:: failed :value: 'failed' .. py:attribute:: ok :value: 'ok' .. py:attribute:: open :value: 'open' .. py:attribute:: retry :value: 'retry' .. py:class:: AuthMultiFactorTransaction(*args, **kwargs) Bases: :py:obj:`Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: adapter :type: AuthMultiFactorAdapter .. py:attribute:: generateTime :type: int .. py:attribute:: message :type: str .. py:attribute:: restartCount :type: int .. py:attribute:: secret :type: str .. py:attribute:: startTime :type: int .. py:attribute:: state :type: AuthMultiFactorState .. py:attribute:: user :type: User .. py:attribute:: verifyCount :type: int .. py:class:: AuthProvider Bases: :py:obj:`Node` Authentication Provider. .. py:attribute:: allowedMethods :type: list[str] List of Method types allowed to be used with this Provider. .. py:method:: authenticate(method: AuthMethod, credentials: Data) -> Optional[User] Authenticate a user. :param method: Authentication method. :param credentials: Credentials object. :returns: An authenticated User or ``None`` if authentication failed. .. py:method:: get_user(local_uid: str) -> Optional[User] Get a User from its local uid. :param local_uid: User local uid. :returns: A User or ``None``. .. py:method:: serialize_user(user: User) -> str Return a string representation of a User. :param user: A User object. :returns: A json string. .. py:method:: unserialize_user(ser: str) -> Optional[User] Restore a User object from a serialized representation. :param ser: A json string. :returns: A User object. .. py:class:: AuthSession Authentication session. .. py:attribute:: created :type: datetime.datetime Session create time. .. py:attribute:: data :type: dict Session data. .. py:attribute:: isChanged :type: bool Session has changed since the last update.. .. py:attribute:: method :type: Optional[AuthMethod] Authentication method that created the session. .. py:attribute:: uid :type: str Session uid. .. py:attribute:: updated :type: datetime.datetime Session update time. .. py:attribute:: user :type: User Authorized User. .. py:method:: get(key: str, default=None) Get a session data value. :param key: Value name. :param default: Default value. :returns: A value or the default. .. py:method:: set(key: str, value) Set a session data value. :param key: Value name. :param value: A value. .. py:class:: AuthSessionManager Bases: :py:obj:`Node` Authentication session Manager. .. py:attribute:: lifeTime :type: int Session lifetime in seconds. .. py:method:: cleanup() Remove invalid Sessions from the storage. .. py:method:: create(method: AuthMethod, user: User, data: Optional[dict] = None) -> AuthSession Create a new Session, :param method: Auth Method that creates the Session. :param user: 'User' for which the Session is created. :param data: Session data. :returns: A new Session. .. py:method:: delete(sess: AuthSession) Delete a Session. :param sess: Session object. .. py:method:: delete_all() Delete all Sessions. .. py:method:: get(uid: str) -> Optional[AuthSession] Get Session by its uid. :param uid: Session uid. :returns: A Session or ``None``. .. py:method:: get_all() -> list[AuthSession] Get all sessions. .. py:method:: get_valid(uid: str) -> Optional[AuthSession] Get a valid Session by its uid. :param uid: Session uid. :returns: A Session or ``None`` if uid does not exists or the Session is not valid. .. py:method:: save(sess: AuthSession) Save the Session state into a persistent storage. :param sess: Session object. .. py:method:: touch(sess: AuthSession) Update the Session last activity timestamp. :param sess: Session object. .. py:class:: Axis Bases: :py:obj:`Enum` Axis orientation. .. py:attribute:: xy :value: 'xy' .. py:attribute:: yx :value: 'yx' .. py:exception:: BadRequestError Bases: :py:obj:`Error` Generic 'bad request' error. .. py:class:: Bounds(*args, **kwargs) Bases: :py:obj:`Data` Geo-referenced extent. .. py:attribute:: crs :type: Crs .. py:attribute:: extent :type: Extent .. py:data:: ClassRef :type: TypeAlias Class reference, a type, and 'ext' object or a class name. .. py:class:: Client Bases: :py:obj:`Node` GWS Client control object. .. py:attribute:: elements :type: list .. py:attribute:: options :type: dict .. py:class:: CliParams(*args, **kwargs) Bases: :py:obj:`Data` CLI params .. py:data:: Color :type: TypeAlias CSS color name. .. py:class:: ColumnDescription(*args, **kwargs) Bases: :py:obj:`Data` Database column description. .. py:attribute:: columnIndex :type: int .. py:attribute:: comment :type: str .. py:attribute:: default :type: str .. py:attribute:: geometrySrid :type: int .. py:attribute:: geometryType :type: GeometryType .. py:attribute:: hasDefault :type: bool .. py:attribute:: isAutoincrement :type: bool .. py:attribute:: isNullable :type: bool .. py:attribute:: isPrimaryKey :type: bool .. py:attribute:: isUnique :type: bool .. py:attribute:: name :type: str .. py:attribute:: nativeType :type: str .. py:attribute:: options :type: dict .. py:attribute:: type :type: AttributeType .. py:class:: CommandCategory Bases: :py:obj:`Enum` Command category. .. py:attribute:: api :value: 'api' API command. .. py:attribute:: cli :value: 'cli' CLI command. .. py:attribute:: get :value: 'get' Web GET command. .. py:attribute:: post :value: 'post' Web POST command. .. py:class:: Config(*args, **kwargs) Bases: :py:obj:`Data` Object configuration. .. py:attribute:: uid :type: str :value: '' Unique ID. .. py:exception:: ConfigurationError Bases: :py:obj:`Error` GWS Configuration error. .. py:class:: ConfigWithAccess(*args, **kwargs) Bases: :py:obj:`Config` Basic config with permissions. .. py:attribute:: access :type: Optional[AclStr] Permission to read or use the object. (deprecated in 8.0) .. py:attribute:: permissions :type: Optional[PermissionsConfig] Access permissions. .. py:class:: ContentResponse(*args, **kwargs) Bases: :py:obj:`Response` Web response with literal content. .. py:attribute:: asAttachment :type: bool Serve the content as an attachment. .. py:attribute:: attachmentName :type: str Name for the attachment. .. py:attribute:: content :type: bytes | str Response content. .. py:attribute:: contentPath :type: str Local path with the content. .. py:attribute:: headers :type: dict Additional headers. .. py:attribute:: mime :type: str Response mime type. .. py:function:: create_root(specs: SpecRuntime) -> Root .. py:class:: Crs Coordinate reference system. .. py:attribute:: axis :type: Axis Axis orientation. .. py:attribute:: base :type: int Base CRS code. .. py:attribute:: datum :type: str Datum. .. py:attribute:: epsg :type: str Name in the "epsg" format. .. py:attribute:: extent :type: Extent CRS own Extent. .. py:attribute:: isGeographic :type: bool This CRS is geographic. .. py:attribute:: isProjected :type: bool This CRS is projected. .. py:attribute:: isYX :type: bool This CRS has a lat/lon axis. .. py:attribute:: name :type: str CRS name. .. py:attribute:: proj4text :type: str Proj4 definition. .. py:attribute:: srid :type: int CRS SRID. .. py:attribute:: uom :type: Uom CRS unit. .. py:attribute:: uri :type: str Name in the "uri" format. .. py:attribute:: url :type: str Name in the "url" format. .. py:attribute:: urn :type: str Name in the "urn" format. .. py:attribute:: urnx :type: str Name in the "urnx" format. .. py:attribute:: wgsExtent :type: Extent CRS Extent in the WGS projection. .. py:attribute:: wkt :type: str WKT definition. .. py:method:: axis_for_format(fmt: CrsFormat) -> Axis Get the axis depending on the string format. We adhere to the GeoServer convention here: https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html .. py:method:: to_geojson() -> dict Return a geojson representation of the CRS (as per GJ2008). :returns: A GeoJson dict. .. rubric:: References https://geojson.org/geojson-spec#named-crs .. py:method:: to_string(fmt: Optional[CrsFormat] = None) -> str Return a string representation of the CRS. :param fmt: Format to use. :returns: A string. .. py:method:: transform_extent(extent: Extent, crs_to: Crs) -> Extent Transform an Extent from this CRS to another. :param extent: Extent. :param crs_to: Target CRS. :returns: A transformed Extent. .. py:method:: transformer(crs_to: Crs) -> Callable Create a transformer function to another CRS. :param crs_to: Target CRS. :returns: A function. .. py:class:: CrsFormat Bases: :py:obj:`Enum` CRS name format. .. py:attribute:: crs :value: 'crs' Like ``crs84``. .. py:attribute:: epsg :value: 'epsg' Like ``EPSG:3857``. .. py:attribute:: none :value: '' .. py:attribute:: srid :value: 'srid' Like ``3857``. .. py:attribute:: uri :value: 'uri' Like ``http://www.opengis.net/def/crs/epsg/0/3857``. .. py:attribute:: url :value: 'url' Like ``http://www.opengis.net/gml/srs/epsg.xml#3857``. .. py:attribute:: urn :value: 'urn' Like ``urn:ogc:def:crs:EPSG::3857``. .. py:attribute:: urnx :value: 'urnx' Like ``urn:x-ogc:def:crs:EPSG:3857``. .. py:data:: CrsName :type: TypeAlias A CRS code like ``EPSG:3857`` or a SRID like ``3857``. .. py:class:: Data(*args, **kwargs) Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:method:: get(key, default=None) Get an attribute value. :param key: Attribute name. :param default: Default value, returned if the attribute is undefined. .. py:method:: set(key, val) Set an attribute value. :param key: Attribute name. :param val: Attribute value. .. py:method:: setdefault(key, val) Set an attribute value if not already set. :param key: Attribute name. :param val: Attribute value. .. py:method:: update(*args, **kwargs) Update the object with keys and values from args and keywords. :param \*args: Dicts or Mappings. :param kwargs: Keyword args. .. py:class:: DatabaseManager Bases: :py:obj:`Node` Database manager. .. py:attribute:: providers :type: list[DatabaseProvider] .. py:method:: create_provider(cfg: Config, **kwargs) -> DatabaseProvider .. py:method:: find_provider(uid: Optional[str] = None, ext_type: Optional[str] = None) -> Optional[DatabaseProvider] .. py:class:: DatabaseModel Bases: :py:obj:`Model` Database-based data model. .. py:attribute:: db :type: DatabaseProvider .. py:attribute:: sqlFilter :type: str .. py:attribute:: tableName :type: str .. py:method:: column(column_name: str) -> sqlalchemy.Column .. py:method:: table() -> sqlalchemy.Table .. py:method:: uid_column() -> sqlalchemy.Column .. py:class:: DatabaseProvider Bases: :py:obj:`Node` Database Provider. A database Provider wraps SQLAlchemy ``Engine`` and ``Connection`` objects and provides common db functionality. .. py:attribute:: url :type: str Connection url. .. py:method:: column(table: DatabaseTableAlike, column_name: str) -> sqlalchemy.Column SA ``Column`` object for a specific column. .. py:method:: connect() -> ContextManager[sqlalchemy.Connection] Context manager for a SA ``Connection``. Context calls to this method can be nested. An inner call is a no-op, as no new connection is created. Only the outermost connection is closed upon exit:: with db.connect(): ... with db.connect(): # no-op ... # connection remains open ... # connection closed .. py:method:: count(table: DatabaseTableAlike) -> int Return table record count or 0 if the table does not exist. .. py:method:: describe(table: DatabaseTableAlike) -> DataSetDescription Describe a table. .. py:method:: engine(**kwargs) -> sqlalchemy.Engine SA ``Engine`` object for this provider. .. py:method:: execute_text(sql: str, **kwargs) -> sqlalchemy.CursorResult Execute a textual DML statement and return a result. .. py:method:: has_column(table: DatabaseTableAlike, column_name: str) -> bool Check if a specific column exists. .. py:method:: has_table(table_name: str) -> bool Check if a specific table exists. .. py:method:: join_table_name(schema: str, name: str) -> str Create a full table name from the schema and table names. .. py:method:: select_text(sql: str, **kwargs) -> list[dict] Execute a textual SELECT statement and return a list of record dicts. .. py:method:: split_table_name(table_name: str) -> tuple[str, str] Split a full table name into the schema and table names. .. py:method:: table(table_name: str, **kwargs) -> sqlalchemy.Table SA ``Table`` object for a specific table. .. py:method:: table_bounds(table: DatabaseTableAlike) -> Optional[Bounds] Compute a bounding box for the table primary geometry. .. py:data:: DatabaseTableAlike :type: TypeAlias SA ``Table`` object or a string table name. .. py:class:: DataSetDescription(*args, **kwargs) Bases: :py:obj:`Data` Description of a database Table or a GDAL Dataset. .. py:attribute:: columnMap :type: dict[str, ColumnDescription] .. py:attribute:: columns :type: list[ColumnDescription] .. py:attribute:: fullName :type: str .. py:attribute:: geometryName :type: str .. py:attribute:: geometrySrid :type: int .. py:attribute:: geometryType :type: GeometryType .. py:attribute:: name :type: str .. py:attribute:: schema :type: str .. py:class:: DateFormatter Locale-aware date formatter. .. py:method:: format(fmt: DateTimeFormat | str, date: Optional[Union[datetime.date, str]] = None) -> str Formats the date. :param fmt: Format type or a `strftime` format string :param date: Date, if none is given the current date will be used as default. :returns: A formatted date string. .. py:method:: iso(date=None) -> str Returns the date in the ISO 8601 format ``2013-12-11``. .. py:method:: long(date=None) -> str Returns the date in the medium format ``11. Dezember 2013``. .. py:method:: medium(date=None) -> str Returns the date in the medium format ``11.12.2013``. .. py:method:: short(date=None) -> str Returns the date in the short format ``11.12.13``. .. py:data:: DateStr :type: TypeAlias ISO date string like ``2019-01-30``. .. py:class:: DateTimeFormat Bases: :py:obj:`Enum` Enumeration indicating the length of the date/time format. .. py:attribute:: iso :value: 'iso' ISO 8601 format. .. py:attribute:: long :value: 'long' Local long format. .. py:attribute:: medium :value: 'medium' Local medium format. .. py:attribute:: short :value: 'short' Local short format. .. py:data:: DateTimeStr :type: TypeAlias ISO datetime string like ``2019-01-30 01:02:03``. .. py:data:: DirPath :type: TypeAlias Directory path on the server. .. py:data:: Duration :type: TypeAlias Duration like ``1w 2d 3h 4m 5s`` or an integer number of seconds. .. py:class:: EmptyRequest(*args, **kwargs) Bases: :py:obj:`Data` Empty command request. .. py:data:: EmptyValue Special value for empty fields. .. py:class:: Enum Bases: :py:obj:`enum.Enum` Enumeration type. Despite being declared as extending ``Enum`` (for IDE support), this class is actually just a simple object and intended to be used as a collection of attributes. It doesn't provide any ``Enum``-specific utilities. The rationale behind this is that we need ``Enum`` members (e.g. ``Color.RED``) to be scalars, and not complex objects as in the standard ``Enum``. .. py:exception:: Error Bases: :py:obj:`Exception` GWS error. .. py:data:: ErrorValue Special value for invalid fields. .. py:class:: ExtCommandDescriptor(*args, **kwargs) Bases: :py:obj:`Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: extName :type: str Full extension name like ``gws.ext.object.layer.wms``. .. py:attribute:: extType :type: str Extension type like ``wms``. .. py:attribute:: methodName :type: str Command method name. .. py:attribute:: methodPtr :type: Callable Command method. .. py:attribute:: owner :type: ExtObjectDescriptor Descriptor of the command owner. .. py:attribute:: request :type: Request Request sent to the command. .. py:attribute:: tArg :type: str Type of the command argument. .. py:attribute:: tOwner :type: str Type of the command owner. .. py:data:: Extent :type: TypeAlias An array of 4 elements representing extent coordinates ``[min-x, min-y, max-x, max-y]``. .. py:class:: ExtObjectDescriptor(*args, **kwargs) Bases: :py:obj:`Data` Extension object descriptor. .. py:attribute:: classPtr :type: type Class object. .. py:attribute:: extName :type: str Full extension name like ``gws.ext.object.layer.wms``. .. py:attribute:: extType :type: str Extension type like ``wms``. .. py:attribute:: ident :type: str Identifier. .. py:attribute:: modName :type: str Name of the module that contains the class. .. py:attribute:: modPath :type: str Path to the module that contains the class. .. py:class:: Feature Feature object. .. py:attribute:: attributes :type: dict .. py:attribute:: category :type: str .. py:attribute:: createWithFeatures :type: list[Feature] .. py:attribute:: cssSelector :type: str .. py:attribute:: errors :type: list[ModelValidationError] .. py:attribute:: insertedPrimaryKey :type: str .. py:attribute:: isNew :type: bool .. py:attribute:: model :type: Model .. py:attribute:: props :type: FeatureProps .. py:attribute:: record :type: FeatureRecord .. py:attribute:: views :type: dict .. py:method:: get(name: str, default=None) -> Any .. py:method:: has(name: str) -> bool .. py:method:: raw(name: str) -> Any .. py:method:: render_views(templates: list[Template], **kwargs) -> Feature .. py:method:: set(name: str, value: Any) -> Feature .. py:method:: shape() -> Optional[Shape] .. py:method:: to_geojson(user: User) -> dict .. py:method:: to_svg(view: MapView, label: Optional[str] = None, style: Optional[Style] = None) -> list[XmlElement] .. py:method:: transform_to(crs: Crs) -> Feature .. py:method:: uid() -> FeatureUid .. py:class:: FeatureLoadingStrategy Bases: :py:obj:`Enum` Loading strategy for features. .. py:attribute:: all :value: 'all' Load all features. .. py:attribute:: bbox :value: 'bbox' Load only features in the current map extent. .. py:attribute:: lazy :value: 'lazy' Load features on demand. .. py:class:: FeatureProps(*args, **kwargs) Bases: :py:obj:`Props` Feature Proprieties. .. py:attribute:: attributes :type: dict .. py:attribute:: createWithFeatures :type: Optional[list[FeatureProps]] .. py:attribute:: cssSelector :type: str .. py:attribute:: errors :type: Optional[list[ModelValidationError]] .. py:attribute:: isNew :type: bool .. py:attribute:: modelUid :type: str .. py:attribute:: uid :type: str .. py:attribute:: views :type: dict .. py:class:: FeatureRecord(*args, **kwargs) Bases: :py:obj:`Data` Raw data from a feature source. .. py:attribute:: attributes :type: dict .. py:attribute:: meta :type: dict .. py:attribute:: shape :type: Optional[Shape] .. py:attribute:: uid :type: Optional[str] .. py:data:: FeatureUid :type: TypeAlias Unique Feature id. .. py:data:: FilePath :type: TypeAlias File path on the server. .. py:class:: Finder Bases: :py:obj:`Node` Finder object. .. py:attribute:: models :type: list[Model] .. py:attribute:: sourceLayers :type: list[SourceLayer] .. py:attribute:: supportsFilterSearch :type: bool :value: False .. py:attribute:: supportsGeometrySearch :type: bool :value: False .. py:attribute:: supportsKeywordSearch :type: bool :value: False .. py:attribute:: templates :type: list[Template] .. py:attribute:: title :type: str .. py:attribute:: tolerance :type: UomValue .. py:attribute:: withFilter :type: bool .. py:attribute:: withGeometry :type: bool .. py:attribute:: withKeyword :type: bool .. py:method:: can_run(search: SearchQuery, user: User) -> bool .. py:method:: run(search: SearchQuery, user: User, layer: Optional[Layer] = None) -> list[Feature] .. py:exception:: ForbiddenError Bases: :py:obj:`Error` Generic 'forbidden' error. .. py:data:: FormatStr :type: TypeAlias Format string as used in Python. .. py:class:: GeometryType Bases: :py:obj:`Enum` Feature geometry type. OGC and SQL/MM geometry types. .. rubric:: References OGC 06-103r4 (https://www.ogc.org/standards/sfa), https://postgis.net/docs/manual-3.3/using_postgis_dbmanagement.html .. py:attribute:: circularstring :value: 'circularstring' .. py:attribute:: compoundcurve :value: 'compoundcurve' .. py:attribute:: curve :value: 'curve' .. py:attribute:: curvepolygon :value: 'curvepolygon' .. py:attribute:: geometry :value: 'geometry' .. py:attribute:: geometrycollection :value: 'geometrycollection' .. py:attribute:: line :value: 'line' .. py:attribute:: linearring :value: 'linearring' .. py:attribute:: linestring :value: 'linestring' .. py:attribute:: multicurve :value: 'multicurve' .. py:attribute:: multilinestring :value: 'multilinestring' .. py:attribute:: multipoint :value: 'multipoint' .. py:attribute:: multipolygon :value: 'multipolygon' .. py:attribute:: multisurface :value: 'multisurface' .. py:attribute:: point :value: 'point' .. py:attribute:: polygon :value: 'polygon' .. py:attribute:: polyhedralsurface :value: 'polyhedralsurface' .. py:attribute:: surface :value: 'surface' .. py:attribute:: tin :value: 'tin' .. py:attribute:: triangle :value: 'triangle' .. py:class:: Image Image object. .. py:method:: add_box(color=None) -> Image Creates a 1 pixel wide box on the image's edge. :param color: Color of the box's lines. :returns: The image with a box around the edges. .. py:method:: add_text(text: str, x=0, y=0, color=None) -> Image Adds text to an image object. :param text: Text to be displayed. :param x: x-coordinate. :param y: y-coordinate. :param color: Color of the text. :returns: The image object with the text displayed. .. py:method:: compare_to(other: Image) -> float Compare this image to another one. @TODO describe the alogrithm :returns: The similarity factor as a float (the more, the different). '0' means images are equal. .. py:method:: compose(other: Image, opacity=1) -> Image Places other image on top of the current image. :param other: Image to place on top. :param opacity: other image's opacity. :returns: The image object with the other image on top as an alpha composition. .. py:method:: crop(box) -> Image Crops the image with respect to the given box. :param box: `(width, height)` :returns: The cropped image object. .. py:method:: mode() -> str Get the image mode. :returns: PIL image mode. .. py:method:: paste(other: Image, where=None) -> Image Pastes an image to a specific location. :param other: Image that will be placed. :param where: `(x-coord, y-coord)` indicating where the upper left corer should be pasted. :returns: The image object with the other image placed inside. .. py:method:: resize(size: Size, **kwargs) -> Image Resizes the image and scales it to fit the new size. :param size: `(width, height)` :returns: The resized image object. .. py:method:: rotate(angle: int, **kwargs) -> Image Rotates the image. :param angle: Angle to rotate the image. :returns: The rotated image object. .. py:method:: size() -> Size Get the image size. :returns: A tuple ``(width, height)``. .. py:method:: to_array() -> numpy.typing.NDArray Converts the image to an array. :returns: The image as an array. For each row each entry contains the pixel information. .. py:method:: to_base64(mime: Optional[str] = None, options: Optional[dict] = None) -> str Return the image content as a base64 encoded string. .. py:method:: to_bytes(mime: Optional[str] = None, options: Optional[dict] = None) -> bytes Converts the image object to bytes. The ``options`` dict can contain any PIL save option (see https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html). An additional option ``mode`` is the image mode (see https://pillow.readthedocs.io/en/stable/handbook/concepts.html#concept-modes). If provided, the image is converted to that mode before saving. An additional option ``background`` sets the color to replace the alpha channel with when converting from RGBA to RGB (default is white). :param mime: The mime type. :param options: A dict of options. :returns: The image as bytes. .. py:method:: to_data_url(mime: Optional[str] = None, options: Optional[dict] = None) -> str Return the image content as a base64-based data url. .. py:method:: to_path(path: str, mime: Optional[str] = None, options: Optional[dict] = None) -> str Saves the image object at a given path. :param path: Image's path location. :param mime: The mime type. :param options: A dict of options. :returns: The path to the image. .. py:class:: ImageFormat Bases: :py:obj:`Enum` Image format .. py:attribute:: png24 :value: 'png24' png 24-bit .. py:attribute:: png8 :value: 'png8' png 8-bit .. py:function:: is_data_object(x) True if the argument is a ``Data`` object. .. py:class:: Job Background Job object. .. py:attribute:: error :type: str .. py:attribute:: payload :type: dict .. py:attribute:: state :type: JobState .. py:attribute:: uid :type: str .. py:attribute:: user :type: User .. py:method:: cancel() .. py:method:: remove() .. py:method:: run() .. py:method:: update(payload: Optional[dict] = None, state: Optional[JobState] = None, error: Optional[str] = None) .. py:class:: JobState Bases: :py:obj:`Enum` Background job state. .. py:attribute:: cancel :value: 'cancel' The job was cancelled. .. py:attribute:: complete :value: 'complete' The job has been completed successfully. .. py:attribute:: error :value: 'error' There was an error. .. py:attribute:: init :value: 'init' The job is being created. .. py:attribute:: open :value: 'open' The job is just created and waiting for start. .. py:attribute:: running :value: 'running' The job is running. .. py:class:: Layer Bases: :py:obj:`Node` Layer object. .. py:attribute:: bounds :type: Bounds .. py:attribute:: cache :type: Optional[LayerCache] .. py:attribute:: canRenderBox :type: bool .. py:attribute:: canRenderSvg :type: bool .. py:attribute:: canRenderXyz :type: bool .. py:attribute:: clientOptions :type: LayerClientOptions .. py:attribute:: displayMode :type: LayerDisplayMode .. py:attribute:: finders :type: list[Finder] .. py:attribute:: grid :type: Optional[TileGrid] .. py:attribute:: hasLegend :type: bool .. py:attribute:: imageFormat :type: str .. py:attribute:: isEnabledForOws :type: bool .. py:attribute:: isGroup :type: bool .. py:attribute:: isSearchable :type: bool .. py:attribute:: layers :type: list[Layer] .. py:attribute:: legend :type: Optional[Legend] .. py:attribute:: legendUrl :type: str .. py:attribute:: loadingStrategy :type: FeatureLoadingStrategy .. py:attribute:: mapCrs :type: Crs .. py:attribute:: metadata :type: Metadata .. py:attribute:: models :type: list[Model] .. py:attribute:: opacity :type: float .. py:attribute:: ows :type: LayerOws .. py:attribute:: resolutions :type: list[float] .. py:attribute:: sourceLayers :type: list[SourceLayer] .. py:attribute:: templates :type: list[Template] .. py:attribute:: title :type: str .. py:attribute:: wgsExtent :type: Extent .. py:method:: ancestors() -> list[Layer] .. py:method:: descendants() -> list[Layer] .. py:method:: find_features(search: SearchQuery, user: User) -> list[Feature] .. py:method:: render(lri: LayerRenderInput) -> Optional[LayerRenderOutput] .. py:method:: render_legend(args: Optional[dict] = None) -> Optional[LegendRenderOutput] .. py:method:: url_path(kind: str) -> str .. py:class:: LayerCache(*args, **kwargs) Bases: :py:obj:`Data` Layer cache. .. py:attribute:: maxAge :type: int .. py:attribute:: maxLevel :type: int .. py:attribute:: requestBuffer :type: int .. py:attribute:: requestTiles :type: int .. py:class:: LayerClientOptions(*args, **kwargs) Bases: :py:obj:`Data` Client options for a layer. .. py:attribute:: exclusive :type: bool Only one of this layer's children is visible at a time. .. py:attribute:: expanded :type: bool A layer is expanded in the list view. .. py:attribute:: hidden :type: bool A layer is initially hidden. .. py:attribute:: selected :type: bool A layer is initially selected. .. py:attribute:: unfolded :type: bool A layer is not listed, but its children are. .. py:attribute:: unlisted :type: bool A layer is hidden in the list view. .. py:class:: LayerDisplayMode Bases: :py:obj:`Enum` Layer display mode. .. py:attribute:: box :value: 'box' Display a layer as one big image (WMS-alike). .. py:attribute:: client :value: 'client' Draw a layer in the client. .. py:attribute:: tile :value: 'tile' Display a layer in a tile grid. .. py:class:: LayerOws Bases: :py:obj:`Node` Layer OWS controller. .. py:attribute:: allowedServiceUids :type: list[str] .. py:attribute:: deniedServiceUids :type: list[str] .. py:attribute:: featureName :type: str .. py:attribute:: geometryName :type: str .. py:attribute:: layerName :type: str .. py:attribute:: models :type: list[Model] .. py:attribute:: xmlNamespace :type: Optional[XmlNamespace] .. py:class:: LayerRenderInput(*args, **kwargs) Bases: :py:obj:`Data` Layer render input. .. py:attribute:: boxBuffer :type: int .. py:attribute:: boxSize :type: int .. py:attribute:: extraParams :type: dict .. py:attribute:: project :type: Project .. py:attribute:: style :type: Style .. py:attribute:: type :type: LayerRenderInputType .. py:attribute:: user :type: User .. py:attribute:: view :type: MapView .. py:attribute:: x :type: int .. py:attribute:: y :type: int .. py:attribute:: z :type: int .. py:class:: LayerRenderInputType Bases: :py:obj:`Enum` Layer render input type. .. py:attribute:: box :value: 'box' .. py:attribute:: svg :value: 'svg' .. py:attribute:: xyz :value: 'xyz' .. py:class:: LayerRenderOutput(*args, **kwargs) Bases: :py:obj:`Data` Layer render output. .. py:attribute:: content :type: bytes .. py:attribute:: tags :type: list[XmlElement] .. py:class:: Legend Bases: :py:obj:`Node` Legend object. .. py:method:: render(args: Optional[dict] = None) -> Optional[LegendRenderOutput] .. py:class:: LegendRenderOutput(*args, **kwargs) Bases: :py:obj:`Data` Legend render output. .. py:attribute:: html :type: str .. py:attribute:: image :type: Image .. py:attribute:: image_path :type: str .. py:attribute:: mime :type: str .. py:attribute:: size :type: Size .. py:class:: Locale(*args, **kwargs) Bases: :py:obj:`Data` Locale data. .. py:attribute:: dateFormatLong :type: str .. py:attribute:: dateFormatMedium :type: str .. py:attribute:: dateFormatShort :type: str .. py:attribute:: dateUnits :type: str date unit names, e.g. 'YMD' for 'en', 'JMT' for 'de' .. py:attribute:: dayNamesLong :type: list[str] .. py:attribute:: dayNamesNarrow :type: list[str] .. py:attribute:: dayNamesShort :type: list[str] .. py:attribute:: firstWeekDay :type: int .. py:attribute:: language :type: str ``de`` :type: Language code .. py:attribute:: language3 :type: str ``deu``. :type: ISO 3166-1 alpha-3 language code .. py:attribute:: languageBib :type: str Bibliographic language code.. .. py:attribute:: languageName :type: str ``Deutsch``. :type: Native language name .. py:attribute:: languageNameEn :type: str ``German``. :type: English language name .. py:attribute:: monthNamesLong :type: list[str] .. py:attribute:: monthNamesNarrow :type: list[str] .. py:attribute:: monthNamesShort :type: list[str] .. py:attribute:: numberDecimal :type: str .. py:attribute:: numberGroup :type: str .. py:attribute:: territory :type: str .. py:attribute:: territoryName :type: str .. py:attribute:: uid :type: str .. py:class:: Map Bases: :py:obj:`Node` Map object. .. py:attribute:: bounds :type: Bounds .. py:attribute:: center :type: Point .. py:attribute:: coordinatePrecision :type: int .. py:attribute:: initResolution :type: float .. py:attribute:: resolutions :type: list[float] .. py:attribute:: rootLayer :type: Layer .. py:attribute:: title :type: str .. py:attribute:: wgsExtent :type: Extent .. py:class:: MapRenderInput(*args, **kwargs) Bases: :py:obj:`Data` Map render input. .. py:attribute:: backgroundColor :type: int .. py:attribute:: bbox :type: Extent .. py:attribute:: center :type: Point .. py:attribute:: crs :type: Crs .. py:attribute:: dpi :type: int .. py:attribute:: mapSize :type: UomSize .. py:attribute:: notify :type: Callable .. py:attribute:: planes :type: list[MapRenderInputPlane] .. py:attribute:: project :type: Project .. py:attribute:: rotation :type: int .. py:attribute:: scale :type: int .. py:attribute:: user :type: User .. py:attribute:: visibleLayers :type: Optional[list[Layer]] .. py:class:: MapRenderInputPlane(*args, **kwargs) Bases: :py:obj:`Data` Map render input plane. .. py:attribute:: features :type: list[Feature] .. py:attribute:: image :type: Image .. py:attribute:: layer :type: Layer .. py:attribute:: opacity :type: float .. py:attribute:: soupPoints :type: list[Point] .. py:attribute:: soupTags :type: list[Any] .. py:attribute:: styles :type: list[Style] .. py:attribute:: subLayers :type: list[str] .. py:attribute:: type :type: MapRenderInputPlaneType .. py:class:: MapRenderInputPlaneType Bases: :py:obj:`Enum` Map render input plane type. .. py:attribute:: features :value: 'features' .. py:attribute:: image :value: 'image' .. py:attribute:: imageLayer :value: 'imageLayer' .. py:attribute:: svgLayer :value: 'svgLayer' .. py:attribute:: svgSoup :value: 'svgSoup' .. py:class:: MapRenderOutput(*args, **kwargs) Bases: :py:obj:`Data` Map render output. .. py:attribute:: planes :type: list[MapRenderOutputPlane] .. py:attribute:: view :type: MapView .. py:class:: MapRenderOutputPlane(*args, **kwargs) Bases: :py:obj:`Data` Map render output plane. .. py:attribute:: elements :type: list[XmlElement] .. py:attribute:: image :type: Image .. py:attribute:: path :type: str .. py:attribute:: type :type: MapRenderOutputPlaneType .. py:class:: MapRenderOutputPlaneType Bases: :py:obj:`Enum` Map render output plane type. .. py:attribute:: image :value: 'image' .. py:attribute:: path :value: 'path' .. py:attribute:: svg :value: 'svg' .. py:class:: MapView(*args, **kwargs) Bases: :py:obj:`Data` Map view. .. py:attribute:: bounds :type: Bounds .. py:attribute:: center :type: Point .. py:attribute:: dpi :type: int .. py:attribute:: mmSize :type: Size .. py:attribute:: pxSize :type: Size .. py:attribute:: rotation :type: int .. py:attribute:: scale :type: int .. py:class:: Metadata(*args, **kwargs) Bases: :py:obj:`Data` Metadata. .. py:attribute:: abstract :type: Optional[str] .. py:attribute:: accessConstraints :type: Optional[list[MetadataAccessConstraint]] .. py:attribute:: attribution :type: Optional[MetadataAttribution] .. py:attribute:: authorityIdentifier :type: Optional[str] .. py:attribute:: authorityName :type: Optional[str] .. py:attribute:: authorityUrl :type: Optional[str] .. py:attribute:: catalogCitationUid :type: Optional[str] .. py:attribute:: catalogUid :type: Optional[str] .. py:attribute:: contactAddress :type: Optional[str] .. py:attribute:: contactAddressType :type: Optional[str] .. py:attribute:: contactArea :type: Optional[str] .. py:attribute:: contactCity :type: Optional[str] .. py:attribute:: contactCountry :type: Optional[str] .. py:attribute:: contactEmail :type: Optional[str] .. py:attribute:: contactFax :type: Optional[str] .. py:attribute:: contactOrganization :type: Optional[str] .. py:attribute:: contactPerson :type: Optional[str] .. py:attribute:: contactPhone :type: Optional[str] .. py:attribute:: contactPosition :type: Optional[str] .. py:attribute:: contactProviderName :type: Optional[str] .. py:attribute:: contactProviderSite :type: Optional[str] .. py:attribute:: contactRole :type: Optional[str] .. py:attribute:: contactUrl :type: Optional[str] .. py:attribute:: contactZip :type: Optional[str] .. py:attribute:: dateBegin :type: Optional[str] .. py:attribute:: dateCreated :type: Optional[str] .. py:attribute:: dateEnd :type: Optional[str] .. py:attribute:: dateUpdated :type: Optional[str] .. py:attribute:: extraLinks :type: Optional[list[MetadataLink]] .. py:attribute:: fees :type: Optional[str] .. py:attribute:: image :type: Optional[str] .. py:attribute:: inspireDegreeOfConformity :type: Optional[str] .. py:attribute:: inspireKeywords :type: Optional[list[str]] .. py:attribute:: inspireMandatoryKeyword :type: Optional[str] .. py:attribute:: inspireResourceType :type: Optional[str] .. py:attribute:: inspireSpatialDataServiceType :type: Optional[str] .. py:attribute:: inspireSpatialScope :type: Optional[str] .. py:attribute:: inspireSpatialScopeName :type: Optional[str] .. py:attribute:: inspireTheme :type: Optional[str] .. py:attribute:: inspireThemeName :type: Optional[str] .. py:attribute:: inspireThemeNameEn :type: Optional[str] .. py:attribute:: isoMaintenanceFrequencyCode :type: Optional[str] .. py:attribute:: isoQualityConformanceExplanation :type: Optional[str] .. py:attribute:: isoQualityConformanceQualityPass :type: Optional[bool] .. py:attribute:: isoQualityConformanceSpecificationDate :type: Optional[str] .. py:attribute:: isoQualityConformanceSpecificationTitle :type: Optional[str] .. py:attribute:: isoQualityLineageSource :type: Optional[str] .. py:attribute:: isoQualityLineageSourceScale :type: Optional[int] .. py:attribute:: isoQualityLineageStatement :type: Optional[str] .. py:attribute:: isoRestrictionCode :type: Optional[str] .. py:attribute:: isoScope :type: Optional[str] .. py:attribute:: isoScopeName :type: Optional[str] .. py:attribute:: isoServiceFunction :type: Optional[str] .. py:attribute:: isoSpatialRepresentationType :type: Optional[str] .. py:attribute:: isoSpatialResolution :type: Optional[str] .. py:attribute:: isoTopicCategories :type: Optional[list[str]] .. py:attribute:: keywords :type: Optional[list[str]] .. py:attribute:: language :type: Optional[str] .. py:attribute:: language3 :type: Optional[str] .. py:attribute:: languageName :type: Optional[str] .. py:attribute:: license :type: Optional[MetadataLicense] .. py:attribute:: metaLinks :type: Optional[list[MetadataLink]] .. py:attribute:: name :type: Optional[str] .. py:attribute:: parentIdentifier :type: Optional[str] .. py:attribute:: serviceMetaLink :type: Optional[MetadataLink] .. py:attribute:: title :type: Optional[str] .. py:class:: MetadataAccessConstraint(*args, **kwargs) Bases: :py:obj:`Data` Metadata AccessConstraint. .. py:attribute:: title :type: Optional[str] .. py:attribute:: type :type: Optional[str] .. py:class:: MetadataAttribution(*args, **kwargs) Bases: :py:obj:`Data` Metadata Attribution. .. py:attribute:: title :type: Optional[str] .. py:attribute:: url :type: Optional[Url] .. py:class:: MetadataLicense(*args, **kwargs) Bases: :py:obj:`Data` Metadata License. .. py:attribute:: title :type: Optional[str] .. py:attribute:: url :type: Optional[Url] .. py:class:: MetadataLink(*args, **kwargs) Bases: :py:obj:`Data` Link metadata. .. py:attribute:: about :type: Optional[str] .. py:attribute:: description :type: Optional[str] .. py:attribute:: format :type: Optional[str] .. py:attribute:: formatVersion :type: Optional[str] .. py:attribute:: function :type: Optional[str] .. py:attribute:: mimeType :type: Optional[str] .. py:attribute:: scheme :type: Optional[str] .. py:attribute:: title :type: Optional[str] .. py:attribute:: type :type: Optional[str] .. py:attribute:: url :type: Optional[Url] .. py:class:: MiddlewareManager Bases: :py:obj:`Node` Configurable GWS object. .. py:method:: objects() -> list[Node] Return a list of registered middleware objects. .. py:method:: register(obj: Node, name: str, depends_on: Optional[list[str]] = None) Register an object as a middleware. .. py:class:: Model Bases: :py:obj:`Node` Data Model. .. py:attribute:: defaultSort :type: list[SearchSort] .. py:attribute:: fields :type: list[ModelField] .. py:attribute:: geometryCrs :type: Optional[Crs] .. py:attribute:: geometryName :type: str .. py:attribute:: geometryType :type: Optional[GeometryType] .. py:attribute:: isEditable :type: bool .. py:attribute:: loadingStrategy :type: FeatureLoadingStrategy .. py:attribute:: title :type: str .. py:attribute:: uidName :type: str .. py:attribute:: withTableView :type: bool .. py:method:: create_feature(feature: Feature, mc: ModelContext) -> FeatureUid .. py:method:: delete_feature(feature: Feature, mc: ModelContext) -> FeatureUid .. py:method:: describe() -> Optional[DataSetDescription] .. py:method:: feature_from_props(props: FeatureProps, mc: ModelContext) -> Feature .. py:method:: feature_to_props(feature: Feature, mc: ModelContext) -> FeatureProps .. py:method:: feature_to_view_props(feature: Feature, mc: ModelContext) -> FeatureProps .. py:method:: field(name: str) -> Optional[ModelField] .. py:method:: find_features(search: SearchQuery, mc: ModelContext) -> list[Feature] .. py:method:: get_features(uids: Iterable[str | int], mc: ModelContext) -> list[Feature] .. py:method:: init_feature(feature: Feature, mc: ModelContext) .. py:method:: related_models() -> list[Model] .. py:method:: update_feature(feature: Feature, mc: ModelContext) -> FeatureUid .. py:method:: validate_feature(feature: Feature, mc: ModelContext) -> bool .. py:class:: ModelContext(*args, **kwargs) Bases: :py:obj:`Data` Model context. .. py:attribute:: dbConnection :type: sqlalchemy.Connection .. py:attribute:: dbSelect :type: ModelDbSelect .. py:attribute:: maxDepth :type: int :value: 0 .. py:attribute:: op :type: ModelOperation .. py:attribute:: project :type: Project .. py:attribute:: relDepth :type: int :value: 0 .. py:attribute:: search :type: SearchQuery .. py:attribute:: target :type: ModelReadTarget .. py:attribute:: user :type: User .. py:class:: ModelDbSelect(*args, **kwargs) Bases: :py:obj:`Data` Database select statement. .. py:attribute:: columns :type: list[sqlalchemy.Column] .. py:attribute:: geometryWhere :type: list .. py:attribute:: keywordWhere :type: list .. py:attribute:: order :type: list .. py:attribute:: where :type: list .. py:class:: ModelField Bases: :py:obj:`Node` Model field. .. py:attribute:: attributeType :type: AttributeType .. py:attribute:: isAuto :type: bool .. py:attribute:: isPrimaryKey :type: bool .. py:attribute:: isRequired :type: bool .. py:attribute:: isUnique :type: bool .. py:attribute:: model :type: Model .. py:attribute:: name :type: str .. py:attribute:: supportsFilterSearch :type: bool :value: False .. py:attribute:: supportsGeometrySearch :type: bool :value: False .. py:attribute:: supportsKeywordSearch :type: bool :value: False .. py:attribute:: title :type: str .. py:attribute:: validators :type: list[ModelValidator] .. py:attribute:: values :type: list[ModelValue] .. py:attribute:: widget :type: Optional[ModelWidget] .. py:method:: after_create(feature: Feature, mc: ModelContext) .. py:method:: after_create_related(to_feature: Feature, mc: ModelContext) .. py:method:: after_delete(feature: Feature, mc: ModelContext) .. py:method:: after_select(features: list[Feature], mc: ModelContext) .. py:method:: after_update(feature: Feature, mc: ModelContext) .. py:method:: before_create(feature: Feature, mc: ModelContext) .. py:method:: before_create_related(to_feature: Feature, mc: ModelContext) .. py:method:: before_delete(feature: Feature, mc: ModelContext) .. py:method:: before_select(mc: ModelContext) .. py:method:: before_update(feature: Feature, mc: ModelContext) .. py:method:: describe() -> Optional[ColumnDescription] .. py:method:: do_init(feature: Feature, mc: ModelContext) .. py:method:: do_init_related(to_feature: Feature, mc: ModelContext) .. py:method:: do_validate(feature: Feature, mc: ModelContext) .. py:method:: find_relatable_features(search: SearchQuery, mc: ModelContext) -> list[Feature] .. py:method:: from_props(feature: Feature, mc: ModelContext) .. py:method:: from_record(feature: Feature, mc: ModelContext) .. py:method:: prop_to_python(feature: Feature, value, mc: ModelContext) .. py:method:: python_to_prop(feature: Feature, value, mc: ModelContext) .. py:method:: python_to_raw(feature: Feature, value, mc: ModelContext) .. py:method:: raw_to_python(feature: Feature, value, mc: ModelContext) .. py:method:: related_models() -> list[Model] .. py:method:: to_props(feature: Feature, mc: ModelContext) .. py:method:: to_record(feature: Feature, mc: ModelContext) .. py:class:: ModelManager Bases: :py:obj:`Node` Model manager. .. py:method:: default_model() -> Model .. py:method:: editable_models(project: Project, user: User) -> list[Model] .. py:method:: find_model(*objects, user: User = None, access: Access = None) -> Optional[Model] .. py:method:: get_model(uid: str, user: User = None, access: Access = None) -> Optional[Model] .. py:class:: ModelOperation Bases: :py:obj:`Enum` Model operation. .. py:attribute:: create :value: 'create' .. py:attribute:: delete :value: 'delete' .. py:attribute:: read :value: 'read' .. py:attribute:: update :value: 'update' .. py:class:: ModelReadTarget Bases: :py:obj:`Enum` Target for the read operation. .. py:attribute:: editForm :value: 'editForm' The feature is to be displayed in an edit form . .. py:attribute:: editList :value: 'editList' The feature is to be displayed in an editable list view. .. py:attribute:: list :value: 'list' The feature is to be displayed in a list view. .. py:attribute:: map :value: 'map' The feature is to be drawn on a map. .. py:attribute:: searchResults :value: 'searchResults' The feature is to be displayed in the search results list. .. py:class:: ModelValidationError(*args, **kwargs) Bases: :py:obj:`Data` Validation error. .. py:attribute:: fieldName :type: str .. py:attribute:: message :type: str .. py:class:: ModelValidator Bases: :py:obj:`Node` Model Validator. .. py:attribute:: message :type: str .. py:attribute:: ops :type: set[ModelOperation] .. py:method:: validate(field: ModelField, feature: Feature, mc: ModelContext) -> bool .. py:class:: ModelValue Bases: :py:obj:`Node` Model value. .. py:attribute:: isDefault :type: bool .. py:attribute:: ops :type: set[ModelOperation] .. py:method:: compute(field: ModelField, feature: Feature, mc: ModelContext) .. py:class:: ModelWidget Bases: :py:obj:`Node` Model widget. .. py:attribute:: supportsTableView :type: bool :value: True .. py:class:: Node Bases: :py:obj:`Object` Configurable GWS object. .. py:attribute:: children :type: list[Node] Child objects. .. py:attribute:: config :type: Config Configuration for this object. .. py:attribute:: extName :type: str Full extension name like ``gws.ext.object.layer.wms``. .. py:attribute:: extType :type: str Extension type like ``wms``. .. py:attribute:: parent :type: Node Parent object. .. py:attribute:: root :type: Root Root object. .. py:attribute:: uid :type: str Unique ID. .. py:method:: activate() Activation hook. .. py:method:: cfg(key: str, default=None) Fetch a configuration property. :param key: Property key. If it contains dots, fetch nested properties. :param default: Default to return if the property is not found. :returns: A property value. .. py:method:: configure() Configuration hook. .. py:method:: create_child(classref: ClassRef, config: Config = None, **kwargs) Create a child object. :param classref: Class reference. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: A newly created object or ``None`` if the object cannot be initialized. .. py:method:: create_child_if_configured(classref: ClassRef, config=None, **kwargs) Create a child object if the configuration is not None. :param classref: Class reference. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: A newly created object or ``None`` if the configuration is ``None`` or the object cannot be initialized. .. py:method:: create_children(classref: ClassRef, configs: list[Config], **kwargs) Create a list of child objects from a list of configurations. :param classref: Class reference. :param configs: List of configurations. :param \*\*kwargs: Additional configuration properties. :returns: A list of newly created objects. .. py:method:: enter_middleware(req: WebRequester) -> Optional[WebResponder] Begin middleware processing. :param req: Requester object. :returns: A Responder object or ``None``. .. py:method:: exit_middleware(req: WebRequester, res: WebResponder) Finish middleware processing. :param req: Requester object. :param res: Current responder object. .. py:method:: find_all(classref: ClassRef) Find all children that match a specific class. :param classref: Class reference. :returns: A list of objects. .. py:method:: find_ancestors(classref: Optional[ClassRef] = None) Find node ancestors that match a specific class. :param classref: Class reference. :returns: A list of objects. .. py:method:: find_closest(classref: ClassRef) Find the closest node ancestor that matches a specific class. :param classref: Class reference. :returns: An object or ``None``. .. py:method:: find_descendants(classref: Optional[ClassRef] = None) Find node descendants that match a specific class. :param classref: Class reference. :returns: A list of objects in the depth-first order. .. py:method:: find_first(classref: ClassRef) Find the first child that matches a specific class. :param classref: Class reference. :returns: An object or ``None``. .. py:method:: initialize(config) .. py:method:: is_a(classref: ClassRef) Check if a the node matches the class reference. :param classref: Class reference. :returns: A boolean. .. py:method:: post_configure() Post-configuration hook. .. py:method:: pre_configure() Pre-configuration hook. .. py:method:: register_middleware(name: str, depends_on: Optional[list[str]] = None) Register itself as a middleware handler. :param name: Handler name. :param depends_on: List of handler names this handler depends on. .. py:exception:: NotFoundError Bases: :py:obj:`Error` Generic 'object not found' error. .. py:class:: NumberFormat Bases: :py:obj:`Enum` Enumeration indicating the number format. .. py:attribute:: currency :value: 'currency' Locale currency format .. py:attribute:: decimal :value: 'decimal' Locale decimal format. .. py:attribute:: grouped :value: 'grouped' Locale grouped format. .. py:attribute:: percent :value: 'percent' Locale percent format. .. py:class:: NumberFormatter Locale-aware number formatter. .. py:method:: currency(n, currency: str, *args, **kwargs) -> str Returns formatted currency value. .. py:method:: decimal(n, *args, **kwargs) -> str Returns formatted decimal value. .. py:method:: format(fmt: NumberFormat | str, n, *args, **kwargs) -> str Formats the number with respect to the locale. :param fmt: Format type or a python `format` string :param n: Number. :param kwargs: Passes the currency parameter forward. :returns: A formatted number. .. py:method:: grouped(n, *args, **kwargs) -> str Returns formatted decimal value with group separators. .. py:method:: percent(n, *args, **kwargs) -> str Returns formatted percent value. .. py:class:: Object GWS object. .. py:attribute:: permissions :type: dict[Access, Acl] Mapping from an access mode to a list of ACL tuples. .. py:method:: props(user: User) -> Props Generate a ``Props`` struct for this object. :param user: The user for which the props should be generated. .. py:class:: Origin Bases: :py:obj:`Enum` Grid origin. .. py:attribute:: lb :value: 'sw' left bottom .. py:attribute:: lt :value: 'nw' left top .. py:attribute:: ne :value: 'ne' north-east .. py:attribute:: nw :value: 'nw' north-west .. py:attribute:: rb :value: 'se' right bottom .. py:attribute:: rt :value: 'ne' right top .. py:attribute:: se :value: 'se' south-east .. py:attribute:: sw :value: 'sw' south-west .. py:class:: OwsAuthorization(*args, **kwargs) Bases: :py:obj:`Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: password :type: str .. py:attribute:: type :type: str .. py:attribute:: username :type: str .. py:class:: OwsCapabilities(*args, **kwargs) Bases: :py:obj:`Data` OWS capabilities structure. .. py:attribute:: metadata :type: Metadata .. py:attribute:: operations :type: list[OwsOperation] .. py:attribute:: sourceLayers :type: list[SourceLayer] .. py:attribute:: tileMatrixSets :type: list[TileMatrixSet] .. py:attribute:: version :type: str .. py:class:: OwsImageFormat(*args, **kwargs) Bases: :py:obj:`Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: mimeTypes :type: list[str] Mime types for this format. .. py:attribute:: options :type: dict Image options. .. py:class:: OwsOperation(*args, **kwargs) Bases: :py:obj:`Data` OWS operation. .. py:attribute:: allowedParameters :type: dict[str, list[str]] .. py:attribute:: constraints :type: dict[str, list[str]] .. py:attribute:: formats :type: list[str] .. py:attribute:: handlerName :type: str .. py:attribute:: params :type: dict[str, str] .. py:attribute:: postUrl :type: Url .. py:attribute:: preferredFormat :type: str .. py:attribute:: url :type: Url .. py:attribute:: verb :type: OwsVerb .. py:class:: OwsProtocol Bases: :py:obj:`Enum` Supported OWS protocol. .. py:attribute:: CSW :value: 'CSW' .. py:attribute:: WCS :value: 'WCS' .. py:attribute:: WFS :value: 'WFS' .. py:attribute:: WMS :value: 'WMS' .. py:attribute:: WMTS :value: 'WMTS' .. py:class:: OwsProvider Bases: :py:obj:`Node` OWS services Provider. .. py:attribute:: alwaysXY :type: bool .. py:attribute:: authorization :type: Optional[OwsAuthorization] .. py:attribute:: bounds :type: Optional[Bounds] .. py:attribute:: forceCrs :type: Crs .. py:attribute:: maxRequests :type: int .. py:attribute:: metadata :type: Metadata .. py:attribute:: operations :type: list[OwsOperation] .. py:attribute:: protocol :type: OwsProtocol .. py:attribute:: sourceLayers :type: list[SourceLayer] .. py:attribute:: url :type: Url .. py:attribute:: version :type: str .. py:attribute:: wgsExtent :type: Optional[Extent] .. py:method:: get_features(args: SearchQuery, source_layers: list[SourceLayer]) -> list[FeatureRecord] .. py:method:: get_operation(verb: OwsVerb, method: Optional[RequestMethod] = None) -> Optional[OwsOperation] .. py:class:: OwsService Bases: :py:obj:`Node` OWS Service. .. py:attribute:: alwaysXY :type: bool Force lon/lat order for geographic projections. .. py:attribute:: defaultFeatureCount :type: int Default limit of features per page. .. py:attribute:: imageFormats :type: list[OwsImageFormat] Supported image formats. .. py:attribute:: isOwsCommon :type: bool :value: False Conforms to OGC Web Services Common Standard. .. py:attribute:: isRasterService :type: bool :value: False Service provides raster services. .. py:attribute:: isVectorService :type: bool :value: False Service provides vector services. .. py:attribute:: maxFeatureCount :type: int Max limit of features per page. .. py:attribute:: metadata :type: Metadata Service metadata. .. py:attribute:: name :type: str Service name. .. py:attribute:: project :type: Optional[Project] Project this service is configured for. .. py:attribute:: protocol :type: OwsProtocol Supported protocol. .. py:attribute:: rootLayer :type: Optional[Layer] Root layer of the service. .. py:attribute:: searchTolerance :type: UomValue Default tolerance for spatial search. .. py:attribute:: supportedBounds :type: list[Bounds] Supported bounds. .. py:attribute:: supportedOperations :type: list[OwsOperation] Supported operations. .. py:attribute:: supportedVersions :type: list[str] Supported versions. .. py:attribute:: templates :type: list[Template] Service templates. .. py:attribute:: updateSequence :type: str Service update sequence. .. py:attribute:: withInspireMeta :type: bool Include INSPIRE metadata. .. py:attribute:: withStrictParams :type: bool Strict parameter checking. .. py:method:: handle_request(req: WebRequester) -> ContentResponse Handle a service request. .. py:method:: layer_is_suitable(layer: Layer) -> bool True if layer can be used in this service. .. py:class:: OwsVerb Bases: :py:obj:`Enum` OWS verb. .. py:attribute:: CreateStoredQuery :value: 'CreateStoredQuery' .. py:attribute:: DescribeCoverage :value: 'DescribeCoverage' .. py:attribute:: DescribeFeatureType :value: 'DescribeFeatureType' .. py:attribute:: DescribeLayer :value: 'DescribeLayer' .. py:attribute:: DescribeRecord :value: 'DescribeRecord' .. py:attribute:: DescribeStoredQueries :value: 'DescribeStoredQueries' .. py:attribute:: DropStoredQuery :value: 'DropStoredQuery' .. py:attribute:: GetCapabilities :value: 'GetCapabilities' .. py:attribute:: GetFeature :value: 'GetFeature' .. py:attribute:: GetFeatureInfo :value: 'GetFeatureInfo' .. py:attribute:: GetFeatureWithLock :value: 'GetFeatureWithLock' .. py:attribute:: GetLegendGraphic :value: 'GetLegendGraphic' .. py:attribute:: GetMap :value: 'GetMap' .. py:attribute:: GetPrint :value: 'GetPrint' .. py:attribute:: GetPropertyValue :value: 'GetPropertyValue' .. py:attribute:: GetRecordById :value: 'GetRecordById' .. py:attribute:: GetRecords :value: 'GetRecords' .. py:attribute:: GetTile :value: 'GetTile' .. py:attribute:: ListStoredQueries :value: 'ListStoredQueries' .. py:attribute:: LockFeature :value: 'LockFeature' .. py:attribute:: Transaction :value: 'Transaction' .. py:class:: PermissionsConfig Permissions configuration. .. py:attribute:: all :type: Optional[AclStr] All permissions. .. py:attribute:: create :type: Optional[AclStr] Permission to create new objects. .. py:attribute:: delete :type: Optional[AclStr] Permission to delete objects. .. py:attribute:: edit :type: Optional[AclStr] A combination of write, create and delete. .. py:attribute:: read :type: Optional[AclStr] Permission to read the object. .. py:attribute:: write :type: Optional[AclStr] Permission to change the object. .. py:data:: Point :type: TypeAlias Point coordinates ``[x, y]``. .. py:class:: Printer Bases: :py:obj:`Node` Printer object. .. py:attribute:: models :type: list[Model] .. py:attribute:: qualityLevels :type: list[TemplateQualityLevel] .. py:attribute:: template :type: Template .. py:attribute:: title :type: str .. py:class:: PrinterManager Bases: :py:obj:`Node` Print Manager. .. py:method:: cancel_job(job: Job) .. py:method:: get_job(uid: str, user: User) -> Optional[Job] .. py:method:: printers_for_project(project: Project, user: User) -> list[Printer] .. py:method:: result_path(job: Job) -> str .. py:method:: run_job(request: PrintRequest, user: User) .. py:method:: start_job(request: PrintRequest, user: User) -> Job .. py:method:: status(job: Job) -> PrintJobResponse .. py:class:: PrintJobResponse(*args, **kwargs) Bases: :py:obj:`Response` Print job information response. .. py:attribute:: jobUid :type: str .. py:attribute:: progress :type: int .. py:attribute:: state :type: JobState .. py:attribute:: stepName :type: str .. py:attribute:: stepType :type: str .. py:attribute:: url :type: str .. py:class:: PrintMap(*args, **kwargs) Bases: :py:obj:`Data` Map properties for printing. .. py:attribute:: backgroundColor :type: Optional[int] .. py:attribute:: bbox :type: Optional[Extent] .. py:attribute:: center :type: Optional[Point] .. py:attribute:: planes :type: list[PrintPlane] .. py:attribute:: rotation :type: Optional[int] .. py:attribute:: scale :type: int .. py:attribute:: styles :type: Optional[list[StyleProps]] .. py:attribute:: visibleLayers :type: Optional[list[str]] .. py:class:: PrintPlane(*args, **kwargs) Bases: :py:obj:`Data` Print plane. .. py:attribute:: bitmapData :type: Optional[bytes] .. py:attribute:: bitmapHeight :type: Optional[int] .. py:attribute:: bitmapMode :type: Optional[str] .. py:attribute:: bitmapWidth :type: Optional[int] .. py:attribute:: cssSelector :type: Optional[str] .. py:attribute:: features :type: Optional[list[FeatureProps]] .. py:attribute:: layerUid :type: Optional[str] .. py:attribute:: opacity :type: Optional[float] .. py:attribute:: soupPoints :type: Optional[list[Point]] .. py:attribute:: soupTags :type: Optional[list[Any]] .. py:attribute:: subLayers :type: Optional[list[str]] .. py:attribute:: type :type: PrintPlaneType .. py:attribute:: url :type: Optional[str] .. py:class:: PrintPlaneType Bases: :py:obj:`Enum` Print plane type. .. py:attribute:: bitmap :value: 'bitmap' .. py:attribute:: features :value: 'features' .. py:attribute:: raster :value: 'raster' .. py:attribute:: soup :value: 'soup' .. py:attribute:: url :value: 'url' .. py:attribute:: vector :value: 'vector' .. py:class:: PrintRequest(*args, **kwargs) Bases: :py:obj:`Request` Print request. .. py:attribute:: args :type: Optional[dict] .. py:attribute:: crs :type: Optional[CrsName] .. py:attribute:: dpi :type: Optional[int] .. py:attribute:: maps :type: Optional[list[PrintMap]] .. py:attribute:: outputFormat :type: Optional[str] .. py:attribute:: outputSize :type: Optional[Size] .. py:attribute:: printerUid :type: Optional[str] .. py:attribute:: type :type: PrintRequestType .. py:class:: PrintRequestType Bases: :py:obj:`Enum` Type of the print request. .. py:attribute:: map :value: 'map' .. py:attribute:: template :value: 'template' .. py:class:: Project Bases: :py:obj:`Node` Project object. .. py:attribute:: actions :type: list[Action] .. py:attribute:: assetsRoot :type: Optional[WebDocumentRoot] .. py:attribute:: client :type: Client .. py:attribute:: finders :type: list[Finder] .. py:attribute:: localeUids :type: list[str] .. py:attribute:: map :type: Map .. py:attribute:: metadata :type: Metadata .. py:attribute:: models :type: list[Model] .. py:attribute:: owsServices :type: list[OwsService] .. py:attribute:: printers :type: list[Printer] .. py:attribute:: templates :type: list[Template] .. py:class:: Props(*args, **kwargs) Bases: :py:obj:`Data` Object properties. .. py:attribute:: uid :type: str :value: '' Unique ID. .. py:function:: props_of(obj: Object, user: User, *context) -> Optional[Props] .. py:class:: RedirectResponse(*args, **kwargs) Bases: :py:obj:`Response` Web redirect response. .. py:attribute:: headers :type: dict Additional headers. .. py:attribute:: location :type: str Redirect URL. .. py:data:: Regex :type: TypeAlias Regular expression, as used in Python. .. py:class:: RelationshipDescription(*args, **kwargs) Bases: :py:obj:`Data` Database relationship description. .. py:attribute:: foreignKeys :type: str .. py:attribute:: fullName :type: str .. py:attribute:: name :type: str .. py:attribute:: referredKeys :type: str .. py:attribute:: schema :type: str .. py:class:: Request(*args, **kwargs) Bases: :py:obj:`Data` Command request. .. py:attribute:: localeUid :type: Optional[str] Locale ID for this request. .. py:attribute:: projectUid :type: Optional[str] Unique ID of the project. .. py:class:: RequestMethod Bases: :py:obj:`Enum` Web request method. .. py:attribute:: CONNECT :value: 'CONNECT' .. py:attribute:: DELETE :value: 'DELETE' .. py:attribute:: GET :value: 'GET' .. py:attribute:: HEAD :value: 'HEAD' .. py:attribute:: OPTIONS :value: 'OPTIONS' .. py:attribute:: PATCH :value: 'PATCH' .. py:attribute:: POST :value: 'POST' .. py:attribute:: PUT :value: 'PUT' .. py:attribute:: TRACE :value: 'TRACE' .. py:class:: Response(*args, **kwargs) Bases: :py:obj:`Data` Command response. .. py:attribute:: error :type: Optional[ResponseError] Response error. .. py:attribute:: status :type: int Response status or exit code. .. py:class:: ResponseError(*args, **kwargs) Bases: :py:obj:`Data` Response error. .. py:attribute:: code :type: Optional[int] Error code. .. py:attribute:: info :type: Optional[str] Information about the error. .. py:exception:: ResponseTooLargeError Bases: :py:obj:`Error` Generic error when a response is too large. .. py:class:: Root(specs: SpecRuntime) Root node of the object tree. .. py:attribute:: app :type: Application Application object. .. py:attribute:: configErrors :type: list List of configuration errors. .. py:attribute:: configStack :type: list[Node] .. py:attribute:: nodes :type: list[Node] .. py:attribute:: specs :type: SpecRuntime Specs runtime. .. py:attribute:: uidCount :type: int .. py:attribute:: uidMap :type: dict[str, Node] .. py:method:: activate() .. py:method:: create(classref: ClassRef, parent: Optional[Node] = None, config: Config = None, **kwargs) Create an object. :param classref: Class reference. :param parent: Parent object. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: A newly created object or ``None`` if the object cannot be initialized. .. py:method:: create_application(config: Config = None, **kwargs) -> Application Create the Application object. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: The Application object. .. py:method:: create_shared(classref: ClassRef, config: Config = None, **kwargs) Create a shared object, attached directly to the root. :param classref: Class reference. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: A newly created object or ``None`` if the object cannot be initialized. .. py:method:: create_temporary(classref: ClassRef, config: Config = None, **kwargs) Create a temporary object, not attached to the tree. :param classref: Class reference. :param config: Configuration. :param \*\*kwargs: Additional configuration properties. :returns: A newly created object or ``None`` if the object cannot be initialized. .. py:method:: find_all(classref: ClassRef) Find all objects that match a specific class. :param classref: Class reference. :returns: A list of objects. .. py:method:: find_first(classref: ClassRef) Find the first object that match a specific class. :param classref: Class reference. :returns: An object or ``None``. .. py:method:: get(uid: str = None, classref: Optional[ClassRef] = None) Get an object by its unique ID. :param uid: Object uid. :param classref: Class reference. If provided, ensures that the object matches the reference. :returns: An object or ``None``. .. py:method:: initialize(obj, config) .. py:method:: object_count() -> int Return the number of objects in the tree. .. py:method:: post_initialize() Post-initialization hook. .. py:class:: SearchManager Bases: :py:obj:`Node` Search Manager. .. py:method:: run_search(search: SearchQuery, user: User) -> list[SearchResult] .. py:class:: SearchOgcFilter(*args, **kwargs) Bases: :py:obj:`Data` Search filter. .. py:attribute:: name :type: str .. py:attribute:: operator :type: str .. py:attribute:: shape :type: Shape .. py:attribute:: subFilters :type: list[SearchOgcFilter] .. py:attribute:: value :type: str .. py:class:: SearchQuery(*args, **kwargs) Bases: :py:obj:`Data` Search query. .. py:attribute:: access :type: Access .. py:attribute:: all :type: bool .. py:attribute:: bounds :type: Bounds .. py:attribute:: extraColumns :type: list .. py:attribute:: extraParams :type: dict .. py:attribute:: extraWhere :type: list .. py:attribute:: keyword :type: str .. py:attribute:: layers :type: list[Layer] .. py:attribute:: limit :type: int .. py:attribute:: ogcFilter :type: SearchOgcFilter .. py:attribute:: project :type: Project .. py:attribute:: relDepth :type: int .. py:attribute:: resolution :type: float .. py:attribute:: shape :type: Shape .. py:attribute:: sort :type: list[SearchSort] .. py:attribute:: tolerance :type: UomValue .. py:attribute:: uids :type: list[str] .. py:class:: SearchResult(*args, **kwargs) Bases: :py:obj:`Data` Search result. .. py:attribute:: feature :type: Feature .. py:attribute:: finder :type: Finder .. py:attribute:: layer :type: Layer .. py:class:: SearchSort(*args, **kwargs) Bases: :py:obj:`Data` Search sort specification. .. py:attribute:: fieldName :type: str .. py:attribute:: reverse :type: bool .. py:class:: ServerManager Bases: :py:obj:`Node` Server configuration manager. .. py:attribute:: templates :type: list[Template] .. py:method:: create_server_configs(target_dir: str, script_path: str, pid_paths: dict) Create server configuration files. .. py:class:: ServerMonitor Bases: :py:obj:`Node` File Monitor facility. .. py:method:: add_directory(path: str, pattern: Regex) Add a directory to monitor. :param path: Directory path. :param pattern: Regex pattern for files to watch. .. py:method:: add_file(path: str) Add a file to watch. :param path: File path. .. py:method:: start() Start the monitor. .. py:class:: Shape Bases: :py:obj:`Object` Geo-referenced geometry. .. py:attribute:: crs :type: Crs CRS of this shape. .. py:attribute:: type :type: GeometryType Geometry type. .. py:attribute:: x :type: Optional[float] X-coordinate for Point geometries, None otherwise. .. py:attribute:: y :type: Optional[float] Y-coordinate for Point geometries, None otherwise. .. py:method:: area() -> float Computes the area of the geometry. .. py:method:: bounds() -> Bounds Returns a Bounds object that bounds this shape. .. py:method:: centroid() -> Shape Returns a centroid as a Point shape. .. py:method:: contains(other: Shape) -> bool Returns True if this shape contains the other. .. py:method:: covered_by(other: Shape) -> bool Returns True if this shape is covered by the other. .. py:method:: covers(other: Shape) -> bool Returns True if this shape covers the other. .. py:method:: crosses(other: Shape) -> bool Returns True if this shape crosses the other. .. py:method:: disjoint(other: Shape) -> bool Returns True if this shape does not intersect with the other. .. py:method:: equals(other: Shape) -> bool Returns True if this shape is equal to the other. .. py:method:: intersection(*others: Shape) -> Shape Computes an intersection of this shape and other shapes. .. py:method:: intersects(other: Shape) -> bool Returns True if this shape intersects with the other. .. py:method:: is_empty() -> bool Returns True if this shape is empty. .. py:method:: is_ring() -> bool Returns True if this shape is a ring. .. py:method:: is_simple() -> bool Returns True if this shape is 'simple'. .. py:method:: is_valid() -> bool Returns True if this shape is valid. .. py:method:: overlaps(other: Shape) -> bool Returns True if this shape overlaps the other. .. py:method:: to_ewkb() -> bytes Returns an EWKB representation of this shape as a binary string. .. py:method:: to_ewkb_hex() -> str Returns an EWKB representation of this shape as a hex string. .. py:method:: to_ewkt() -> str Returns an EWKT representation of this shape. .. py:method:: to_geojson(always_xy=False) -> dict Returns a GeoJSON representation of this shape. .. py:method:: to_multi() -> Shape Converts a singly-geometry shape to a multi-geometry one. .. py:method:: to_props() -> ShapeProps Returns a GeoJSON representation of this shape. .. py:method:: to_type(new_type: GeometryType) -> Shape Converts a geometry to another type. .. py:method:: to_wkb() -> bytes Returns a WKB representation of this shape as a binary string. .. py:method:: to_wkb_hex() -> str Returns a WKB representation of this shape as a hex string. .. py:method:: to_wkt() -> str Returns a WKT representation of this shape. .. py:method:: tolerance_polygon(tolerance, quad_segs=None) -> Shape Builds a buffer polygon around the shape. .. py:method:: touches(other: Shape) -> bool Returns True if this shape touches the other. .. py:method:: transformed_to(crs: Crs) -> Shape Returns this shape transformed to another CRS. .. py:method:: union(others: list[Shape]) -> Shape Computes a union of this shape and other shapes. .. py:method:: within(other: Shape) -> bool Returns True if this shape is within the other. .. py:class:: ShapeProps(*args, **kwargs) Bases: :py:obj:`Props` Shape properties. .. py:attribute:: crs :type: str .. py:attribute:: geometry :type: dict .. py:data:: Size :type: TypeAlias Size ``[width, height]``. .. py:class:: SortOptions(*args, **kwargs) Bases: :py:obj:`Data` Sort options. .. py:attribute:: fieldName :type: str .. py:attribute:: reverse :type: bool :value: False .. py:class:: SourceLayer(*args, **kwargs) Bases: :py:obj:`Data` Generic OGC Layer. .. py:attribute:: aLevel :type: int .. py:attribute:: aPath :type: str .. py:attribute:: aUid :type: str .. py:attribute:: dataSource :type: dict .. py:attribute:: defaultStyle :type: Optional[SourceStyle] .. py:attribute:: imageFormat :type: str .. py:attribute:: isExpanded :type: bool .. py:attribute:: isGroup :type: bool .. py:attribute:: isImage :type: bool .. py:attribute:: isQueryable :type: bool .. py:attribute:: isVisible :type: bool .. py:attribute:: layers :type: list[SourceLayer] .. py:attribute:: legendUrl :type: Url .. py:attribute:: metadata :type: Metadata .. py:attribute:: name :type: str .. py:attribute:: opacity :type: int .. py:attribute:: properties :type: dict .. py:attribute:: resourceUrls :type: dict .. py:attribute:: scaleRange :type: list[float] .. py:attribute:: sourceId :type: str .. py:attribute:: styles :type: list[SourceStyle] .. py:attribute:: supportedCrs :type: list[Crs] .. py:attribute:: tileMatrixIds :type: list[str] .. py:attribute:: tileMatrixSets :type: list[TileMatrixSet] .. py:attribute:: title :type: str .. py:attribute:: wgsBounds :type: Bounds .. py:class:: SourceStyle(*args, **kwargs) Bases: :py:obj:`Data` Generic OGC Style. .. py:attribute:: isDefault :type: bool .. py:attribute:: legendUrl :type: Url .. py:attribute:: metadata :type: Metadata .. py:attribute:: name :type: str .. py:class:: SpecReadOption Bases: :py:obj:`Enum` Read options. .. py:attribute:: acceptExtraProps :value: 'acceptExtraProps' Accept extra object properties. .. py:attribute:: allowMissing :value: 'allowMissing' Allow otherwise required properties to be missing. .. py:attribute:: caseInsensitive :value: 'caseInsensitive' Case insensitive search for properties. .. py:attribute:: convertValues :value: 'convertValues' Try to convert values to specified types. .. py:attribute:: ignoreExtraProps :value: 'ignoreExtraProps' Silently ignore extra object properties. .. py:attribute:: verboseErrors :value: 'verboseErrors' Provide verbose error messages. .. py:class:: SpecRuntime Specification runtime. .. py:attribute:: appBundlePaths :type: list[str] List of client bundle paths. .. py:attribute:: manifest :type: ApplicationManifest Application manifest. .. py:attribute:: version :type: str Application version. .. py:method:: command_descriptor(command_category: CommandCategory, command_name: str) -> Optional[ExtCommandDescriptor] Get a command descriptor. :param command_category: Command category. :param command_name: Command name. :returns: A descriptor or ``None`` if the command is not found. .. py:method:: get_class(classref: ClassRef, ext_type: Optional[str] = None) -> Optional[type] Get a class object for a class reference. :param classref: Class reference. :param ext_type: Extension type. :returns: A class or ``None`` if the reference is not found. .. py:method:: object_descriptor(type_name: str) -> Optional[ExtObjectDescriptor] Get an object descriptor. :param type_name: Object type name. :returns: A descriptor or ``None`` if the type is not found. .. py:method:: parse_classref(classref: ClassRef) -> tuple[Optional[type], str, str] Parse a class reference. :param classref: Class reference. :returns: A tuple ``(class object, class name, extension name)``. .. py:method:: read(value, type_name: str, path: str = '', options=Optional[set[SpecReadOption]]) Read a raw value according to a spec. :param value: Raw value from config or request. :param type_name: Object type name. :param path: Config file path. :param options: Read options. :returns: A parsed object. .. py:method:: register_object(ext_name: ClassRef, obj_type: str, cls: type) Dynamically register an extension object. .. py:class:: StorageManager Bases: :py:obj:`Node` Storage manager. .. py:attribute:: providers :type: list[StorageProvider] .. py:method:: create_provider(cfg: Config, **kwargs) -> StorageProvider .. py:method:: find_provider(uid: Optional[str] = None) -> Optional[StorageProvider] .. py:class:: StorageProvider Bases: :py:obj:`Node` Storage provider. .. py:method:: delete(category: str, name: str) .. py:method:: list_names(category: str) -> list[str] .. py:method:: read(category: str, name: str) -> Optional[StorageRecord] .. py:method:: write(category: str, name: str, data: str, user_uid: str) .. py:class:: StorageRecord(*args, **kwargs) Bases: :py:obj:`Data` Storage record. .. py:attribute:: created :type: int .. py:attribute:: data :type: str .. py:attribute:: name :type: str .. py:attribute:: updated :type: int .. py:attribute:: userUid :type: str .. py:class:: Style CSS Style object. .. py:attribute:: cssSelector :type: str .. py:attribute:: text :type: str .. py:attribute:: values :type: StyleValues .. py:class:: StyleProps(*args, **kwargs) Bases: :py:obj:`Props` CSS Style properties. .. py:attribute:: cssSelector :type: Optional[str] .. py:attribute:: text :type: Optional[str] .. py:attribute:: values :type: Optional[dict] .. py:class:: StyleValues(*args, **kwargs) Bases: :py:obj:`Data` CSS Style values. .. py:attribute:: fill :type: Color .. py:attribute:: icon :type: str .. py:attribute:: label_align :type: Literal[left, right, center] .. py:attribute:: label_background :type: Color .. py:attribute:: label_fill :type: Color .. py:attribute:: label_font_family :type: str .. py:attribute:: label_font_size :type: int .. py:attribute:: label_font_style :type: Literal[normal, italic] .. py:attribute:: label_font_weight :type: Literal[normal, bold] .. py:attribute:: label_line_height :type: int .. py:attribute:: label_max_scale :type: int .. py:attribute:: label_min_scale :type: int .. py:attribute:: label_offset_x :type: int .. py:attribute:: label_offset_y :type: int .. py:attribute:: label_padding :type: list[int] .. py:attribute:: label_placement :type: Literal[start, end, middle] .. py:attribute:: label_stroke :type: Color .. py:attribute:: label_stroke_dasharray :type: list[int] .. py:attribute:: label_stroke_dashoffset :type: int .. py:attribute:: label_stroke_linecap :type: Literal[butt, round, square] .. py:attribute:: label_stroke_linejoin :type: Literal[bevel, round, miter] .. py:attribute:: label_stroke_miterlimit :type: int .. py:attribute:: label_stroke_width :type: int .. py:attribute:: marker :type: Literal[circle, square, arrow, cross] .. py:attribute:: marker_fill :type: Color .. py:attribute:: marker_size :type: int .. py:attribute:: marker_stroke :type: Color .. py:attribute:: marker_stroke_dasharray :type: list[int] .. py:attribute:: marker_stroke_dashoffset :type: int .. py:attribute:: marker_stroke_linecap :type: Literal[butt, round, square] .. py:attribute:: marker_stroke_linejoin :type: Literal[bevel, round, miter] .. py:attribute:: marker_stroke_miterlimit :type: int .. py:attribute:: marker_stroke_width :type: int .. py:attribute:: offset_x :type: int .. py:attribute:: offset_y :type: int .. py:attribute:: point_size :type: int .. py:attribute:: stroke :type: Color .. py:attribute:: stroke_dasharray :type: list[int] .. py:attribute:: stroke_dashoffset :type: int .. py:attribute:: stroke_linecap :type: Literal[butt, round, square] .. py:attribute:: stroke_linejoin :type: Literal[bevel, round, miter] .. py:attribute:: stroke_miterlimit :type: int .. py:attribute:: stroke_width :type: int .. py:attribute:: with_geometry :type: Literal[all, none] .. py:attribute:: with_label :type: Literal[all, none] .. py:class:: Template Bases: :py:obj:`Node` Template object. .. py:attribute:: mapSize :type: UomSize Default map size for the template. .. py:attribute:: mimeTypes :type: list[str] MIME types the template can generate. .. py:attribute:: pageMargin :type: UomExtent Default page margin for printing. .. py:attribute:: pageSize :type: UomSize Default page size for printing. .. py:attribute:: subject :type: str Template subject (category). .. py:attribute:: title :type: str Template title. .. py:method:: render(tri: TemplateRenderInput) -> ContentResponse Render the template and return the generated response. .. py:class:: TemplateArgs(*args, **kwargs) Bases: :py:obj:`Data` Template arguments. .. py:attribute:: app :type: Application Application object. .. py:attribute:: date :type: DateFormatter Locale-aware date formatter. .. py:attribute:: gwsBaseUrl :type: str GWS server base url. (deprecated in 8.1) .. py:attribute:: gwsVersion :type: str GWS version. (deprecated in 8.1) .. py:attribute:: locale :type: Locale Current locale. .. py:attribute:: number :type: NumberFormatter Locale-aware number formatter. .. py:attribute:: time :type: TimeFormatter Locale-aware time formatter. .. py:class:: TemplateManager Bases: :py:obj:`Node` Template manager. .. py:method:: find_template(subject: str, where: list[Node], user: User = None, mime: str = None) -> Optional[Template] .. py:method:: template_from_path(path: str) -> Optional[Template] .. py:class:: TemplateQualityLevel(*args, **kwargs) Bases: :py:obj:`Data` Template quality level. .. py:attribute:: dpi :type: int .. py:attribute:: name :type: str .. py:class:: TemplateRenderInput(*args, **kwargs) Bases: :py:obj:`Data` Template render input. .. py:attribute:: args :type: dict | Data .. py:attribute:: crs :type: Crs .. py:attribute:: dpi :type: int .. py:attribute:: locale :type: Locale .. py:attribute:: maps :type: list[MapRenderInput] .. py:attribute:: mimeOut :type: str .. py:attribute:: notify :type: Callable .. py:attribute:: project :type: Project .. py:attribute:: user :type: User .. py:class:: TextSearchOptions(*args, **kwargs) Bases: :py:obj:`Data` Text search options. .. py:attribute:: caseSensitive :type: bool :value: False Use the case sensitive search. .. py:attribute:: minLength :type: int :value: 0 Minimal pattern length. .. py:attribute:: type :type: TextSearchType Type of the search. .. py:class:: TextSearchType Bases: :py:obj:`Enum` Text search type. .. py:attribute:: any :value: 'any' Match any substring. .. py:attribute:: begin :value: 'begin' Match the beginning of the string. .. py:attribute:: end :value: 'end' Match the end of the string. .. py:attribute:: exact :value: 'exact' Match the whole string. .. py:attribute:: like :value: 'like' Use the percent sign as a placeholder. .. py:class:: TileGrid(*args, **kwargs) Bases: :py:obj:`Data` Tile grid. .. py:attribute:: bounds :type: Bounds .. py:attribute:: origin :type: Origin .. py:attribute:: resolutions :type: list[float] .. py:attribute:: tileSize :type: int .. py:attribute:: uid :type: str .. py:class:: TileMatrix(*args, **kwargs) Bases: :py:obj:`Data` WMTS TileMatrix object. .. py:attribute:: extent :type: Extent .. py:attribute:: height :type: float .. py:attribute:: scale :type: float .. py:attribute:: tileHeight :type: float .. py:attribute:: tileWidth :type: float .. py:attribute:: uid :type: str .. py:attribute:: width :type: float .. py:attribute:: x :type: float .. py:attribute:: y :type: float .. py:class:: TileMatrixSet(*args, **kwargs) Bases: :py:obj:`Data` WMTS TileMatrixSet object. .. py:attribute:: crs :type: Crs .. py:attribute:: matrices :type: list[TileMatrix] .. py:attribute:: uid :type: str .. py:class:: TimeFormatter Locale-aware time formatter. .. py:method:: format(fmt: DateTimeFormat | str, time: Optional[Union[datetime.time, str]] = None) -> str Formats the time. :param fmt: Format type or a `strftime` format string :param time: Time, if none is given the current time will be used as default. :returns: A formatted time string. .. py:method:: iso(time=None) -> str Returns the time and date in the ISO 8601 format. .. py:method:: long(time=None) -> str Returns the time in the medium format ``11:22:33``. .. py:method:: medium(time=None) -> str Returns the time in the medium format ``11:22:33``. .. py:method:: short(time=None) -> str Returns the time in the short format ``11:22``. .. py:function:: to_data_object(x) -> Data Convert a value to a ``Data`` object. If the argument is already a ``Data`` object, simply return it. If the argument is ``None``, an empty object is returned. :param x: A Mapping or ``None``. .. py:class:: Uom Bases: :py:obj:`Enum` Unit of measure. .. py:attribute:: ch :value: 'ch' chain (EPSG 9097) .. py:attribute:: cm :value: 'cm' centimetre (EPSG 1033) .. py:attribute:: deg :value: 'deg' degree (EPSG 9102) .. py:attribute:: dm :value: 'dm' decimeter dm .. py:attribute:: fath :value: 'fath' fathom (EPSG 9014) .. py:attribute:: ft :value: 'ft' foot (EPSG 9002) .. py:attribute:: grad :value: 'grad' grad (EPSG 9105) .. py:attribute:: inch :value: 'in' inch in .. py:attribute:: km :value: 'km' kilometre (EPSG 9036) .. py:attribute:: kmi :value: 'kmi' nautical mile (EPSG 9030) .. py:attribute:: link :value: 'link' link (EPSG 9098) .. py:attribute:: m :value: 'm' metre (EPSG 9001) .. py:attribute:: mi :value: 'mi' statute mile (EPSG 9093) .. py:attribute:: mm :value: 'mm' millimetre (EPSG 1025) .. py:attribute:: pt :value: 'pt' point .. py:attribute:: px :value: 'px' pixel .. py:attribute:: rad :value: 'rad' radian (EPSG 9101) .. py:attribute:: us_ch :value: 'us-ch' us survey chain (EPSG 9033) .. py:attribute:: us_ft :value: 'us-ft' us survey foot (EPSG 9003) .. py:attribute:: us_in :value: 'us-in' us survey inch us_in .. py:attribute:: us_mi :value: 'us-mi' us survey mile (EPSG 9035) .. py:attribute:: us_yd :value: 'us-yd' us survey yard us_yd .. py:attribute:: yd :value: 'yd' yard (EPSG 9096) .. py:data:: UomExtent :type: TypeAlias Extent with a unit. .. py:data:: UomExtentStr :type: TypeAlias Extent with a unit like ``["1mm", "2mm", "3mm", "4mm"]``. .. py:data:: UomPoint :type: TypeAlias A Point with a unit. .. py:data:: UomPointStr :type: TypeAlias A Point with a unit like ``["1mm", "2mm"]``. .. py:data:: UomSize :type: TypeAlias A Size with a unit. .. py:data:: UomSizeStr :type: TypeAlias A Size with a unit like ``["1mm", "2mm"]``. .. py:data:: UomValue :type: TypeAlias A value with a unit. .. py:data:: UomValueStr :type: TypeAlias A value with a unit like ``5mm``. .. py:data:: Url :type: TypeAlias URL. .. py:class:: User Bases: :py:obj:`Object` User object. .. py:attribute:: attributes :type: dict Public user attributes. .. py:attribute:: authProvider :type: AuthProvider User authorization provider. .. py:attribute:: authToken :type: str Token used for authorization. .. py:attribute:: data :type: dict Private user data. .. py:attribute:: displayName :type: str User display name. .. py:attribute:: email :type: str User email. .. py:attribute:: isGuest :type: bool User is a Guest. .. py:attribute:: localUid :type: str User uid within its authorization provider. .. py:attribute:: loginName :type: str User login name. .. py:attribute:: mfaSecret :type: str MFA secret. .. py:attribute:: mfaUid :type: str MFA adapter uid. .. py:attribute:: roles :type: set[str] User roles. .. py:attribute:: uid :type: str Global user uid. .. py:method:: acl_bit(access: Access, obj: Object) -> Optional[int] Get the ACL bit for a specific object. :param access: Access mode. :param obj: Requested object. :returns: ``1`` or ``0`` if the user's permissions have the bit and ``None`` otherwise. .. py:method:: acquire(uid: str = None, classref: Optional[ClassRef] = None, access: Optional[Access] = None) -> Optional[Object] Get a readable object by uid. :param uid: Object uid. :param classref: Class reference. If provided, ensures that the object matches the reference. :param access: Access mode, assumed ``Access.read`` if omitted. :returns: A readable object or ``None`` if the object does not exists or user doesn't have a permission. .. py:method:: can(access: Access, obj: Object, *context) -> bool Check if the user can access an object. :param access: Access mode. :param obj: Requested object. :param \*context: Further objects to check. :returns: ``True`` is access is granted. .. py:method:: can_create(obj: Object, *context) -> bool Check if the user has "create" permission on an object. .. py:method:: can_delete(obj: Object, *context) -> bool Check if the user has "delete" permission on an object. .. py:method:: can_edit(obj: Object, *context) -> bool Check if the user has "edit" permissions on an object. .. py:method:: can_read(obj: Object, *context) -> bool Check if the user has "read" permission on an object. .. py:method:: can_use(obj: Object, *context) -> bool Check if the user has "read" permission on an object. .. py:method:: can_write(obj: Object, *context) -> bool Check if the user has "write" permission on an object. .. py:method:: require(uid: str = None, classref: Optional[ClassRef] = None, access: Optional[Access] = None) -> Object Get a readable object by uid and fail if not found. :param uid: Object uid. :param classref: Class reference. If provided, ensures that the object matches the reference. :param access: Access mode, assumed ``Access.read`` if omitted. :returns: A readable object. :raises ``NotFoundError`` if the object doesn't exist.: :raises ``ForbiddenError`` if the user cannot read the object.: .. py:method:: require_layer(uid=None) -> Layer Get a readable Layer object. :param uid: Layer uid. :returns: A Layer object. .. py:method:: require_project(uid: str = None) -> Project Get a readable Project object. :param uid: Project uid. :returns: A Project object. .. py:class:: WebCors(*args, **kwargs) Bases: :py:obj:`Data` CORS options. .. py:attribute:: allowCredentials :type: bool .. py:attribute:: allowHeaders :type: str .. py:attribute:: allowMethods :type: str .. py:attribute:: allowOrigin :type: str .. py:class:: WebDocumentRoot(*args, **kwargs) Bases: :py:obj:`Data` Web document root. .. py:attribute:: allowMime :type: list[str] Allowed mime types. .. py:attribute:: denyMime :type: list[str] Restricted mime types. .. py:attribute:: dir :type: DirPath Local directory. .. py:class:: WebManager Bases: :py:obj:`Node` Web manager. .. py:attribute:: sites :type: list[WebSite] Configured web sites. .. py:method:: site_from_environ(environ: dict) -> WebSite Returns a site object for the given request environment. :param environ: WSGI environment. :returns: A Site object. .. py:class:: WebRequester Web Requester object. .. py:attribute:: environ :type: dict Request environment. .. py:attribute:: isApi :type: bool The request is an 'api' request. .. py:attribute:: isGet :type: bool The request is a 'get' request. .. py:attribute:: isPost :type: bool The request is a 'post' request. .. py:attribute:: isSecure :type: bool The request is secure. .. py:attribute:: method :type: RequestMethod Request method. .. py:attribute:: root :type: Root Object tree root. .. py:attribute:: session :type: AuthSession Current session. .. py:attribute:: site :type: WebSite Website the request is processed for. .. py:attribute:: user :type: User Current use. .. py:method:: api_responder(response: Response) -> WebResponder Return a Responder object for an Api (structured) response. :param response: Response object. :returns: A Responder. .. py:method:: command() -> str Command name to execute. .. py:method:: content_responder(response: ContentResponse) -> WebResponder Return a Responder object for a content response. :param response: Response object. :returns: A Responder. .. py:method:: cookie(key: str, default: str = '') -> str Get a cookie. :param key: Cookie name. :param default: Default value. :returns: A cookie value. .. py:method:: data() -> Optional[bytes] Get POST data. :returns: Data bytes or ``None`` if request is not a POST. .. py:method:: env(key: str, default: str = '') -> str Get an environment variable. :param key: Variable name. :param default: Default value. :returns: A variable value. .. py:method:: error_responder(exc: Exception) -> WebResponder Return a Responder object for an Exception. :param exc: An Exception. :returns: A Responder. .. py:method:: has_param(key: str) -> bool Check if a GET parameter exists. :param key: Parameter name. .. py:method:: header(key: str, default: str = '') -> str Get a header. :param key: Header name. :param default: Default value. :returns: A header value. .. py:method:: param(key: str, default: str = '') -> str Get a GET parameter. :param key: Parameter name. :param default: Default value. :returns: A parameter value. .. py:method:: params() -> dict GET parameters. .. py:method:: redirect_responder(response: RedirectResponse) -> WebResponder Return a Responder object for a redirect response. :param response: Response object. :returns: A Responder. .. py:method:: set_session(session: AuthSession) Attach a session to the requester. :param session: A Session object. .. py:method:: struct() -> dict Structured JSON payload. .. py:method:: text() -> Optional[str] Get POST data as a text. :returns: Data string or ``None`` if request is not a POST. .. py:method:: url_for(request_path: str, **kwargs) -> str Return a canonical Url for the given request path. :param request_path: Request path. :param \*\*kwargs: Additional GET parameters. :returns: An URL. .. py:class:: WebResponder Web Responder object. .. py:attribute:: status :type: int Response status. .. py:method:: add_header(key: str, value: str) Add a header. :param key: Header name. :param value: Header value. .. py:method:: delete_cookie(key: str, **kwargs) Delete a cookie. :param key: Cookie name. :param \*\*kwargs: Cookie options. .. py:method:: send_response(environ: dict, start_response: Callable) Send the response to the client. :param environ: WSGI environment. :param start_response: WSGI ``start_response`` function. .. py:method:: set_cookie(key: str, value: str, **kwargs) Set a cookie. :param key: Cookie name. :param value: Cookie value. :param \*\*kwargs: Cookie options. .. py:method:: set_status(status: int) Set the response status. :param status: HTTP status code. .. py:class:: WebRewriteRule(*args, **kwargs) Bases: :py:obj:`Data` Rewrite rule. .. py:attribute:: options :type: dict Extra options. .. py:attribute:: pattern :type: Regex URL matching pattern. .. py:attribute:: reversed :type: bool Reversed rewrite rule. .. py:attribute:: target :type: str Rule target, with dollar placeholders. .. py:class:: WebSite Bases: :py:obj:`Node` Web site. .. py:attribute:: assetsRoot :type: Optional[WebDocumentRoot] Root directory for assets. .. py:attribute:: corsOptions :type: WebCors CORS options. .. py:attribute:: errorPage :type: Optional[Template] Error page template. .. py:attribute:: host :type: str Host name for this site. .. py:attribute:: rewriteRules :type: list[WebRewriteRule] Rewrite rule. .. py:attribute:: staticRoot :type: WebDocumentRoot Root directory for static files. .. py:method:: url_for(req: WebRequester, path: str, **kwargs) -> str Rewrite a request path to an Url. :param req: Web Requester. :param path: Raw request path. :param \*\*kwargs: Extra GET params. :returns: A rewritten URL. .. py:class:: XmlElement Bases: :py:obj:`Iterable` XML Element. Extends ``ElementTree.Element`` (https://docs.python.org/3/library/xml.etree.elementtree.html#element-objects). .. py:attribute:: attrib :type: dict Dictionary of element attributes. .. py:attribute:: caseInsensitive :type: bool Element is case-insensitive. .. py:attribute:: lcName :type: str Element name (tag without a namespace) in lower case. .. py:attribute:: name :type: str Element name (tag without a namespace). .. py:attribute:: tag :type: str Tag name, with an optional namespace in the Clark notation. .. py:attribute:: tail :type: Optional[str] Text after this element's end tag. .. py:attribute:: text :type: Optional[str] Text before first subelement. .. py:method:: add(tag: str, attrib: Optional[dict] = None, **extra) -> XmlElement Creates a new ``XmlElementImpl`` and adds it as a child. :param tag: XML tag. :param attrib: XML attributes ``{key, value}``. :returns: A XmlElementImpl. .. py:method:: append(subelement: XmlElement) Adds the element subelement to the end of this element’s internal list of subelements. .. py:method:: attr(key: str, default=None) Finds the value for a given key in the ``XmlElementImpl``. :param key: Key of the attribute. :param default: The default return. :returns: The vale of the key, If the key is not found the default is returned. .. py:method:: children() -> list[XmlElement] Returns the children of the current ``XmlElementImpl``. .. py:method:: clear() Resets an element. .. py:method:: extend(subelements: Iterable[XmlElement]) Appends subelements from a sequence object with zero or more elements. .. py:method:: find(path: str) -> Optional[XmlElement] Finds first matching element by tag name or path. .. py:method:: findall(path: str) -> list[XmlElement] Finds all matching subelements by name or path. .. py:method:: findfirst(*paths) -> Optional[XmlElement] Returns the first element in the current element. :param paths: Path as ``tag/tag2/tag3`` to the Element to search in. :returns: Returns the first found element. .. py:method:: findtext(path: str, default: Optional[str] = None) -> str Finds text for first matching element by name or path. .. py:method:: get(key: str, default=None) Returns the value to a given key. .. py:method:: insert(index: int, subelement: XmlElement) Inserts subelement at the given position in this element. .. py:method:: items() -> Iterable[tuple[str, Any]] Returns the element attributes as a sequence of (name, value) pairs. .. py:method:: iter(tag: Optional[str] = None) -> Iterable[XmlElement] Creates a tree iterator. .. py:method:: iterfind(path: Optional[str] = None) -> Iterable[XmlElement] Returns an iterable of all matching subelements by name or path. .. py:method:: itertext() -> Iterable[str] Creates a text iterator and returns all inner text. .. py:method:: keys() -> Iterable[str] Returns the elements attribute names as a list. .. py:method:: remove(other: XmlElement) Removes the other element from the element. .. py:method:: set(key: str, value: Any) Set the attribute key on the element to value. .. py:method:: textdict(*paths, deep=False) -> dict[str, str] Collects texts from child-elements. :param paths: Path as ``tag/tag2/tag3`` to the Element to collect texts from. :param deep: If ``False`` it only looks into direct children, otherwise it searches for texts in the complete children-tree. :returns: A dict containing all the text from the child-elements. .. py:method:: textlist(*paths, deep=False) -> list[str] Collects texts from child-elements. :param paths: Path as ``tag/tag2/tag3`` to the Element to collect texts from. :param deep: If ``False`` it only looks into direct children, otherwise it searches for texts in the complete children-tree. :returns: A list containing all the text from the child-elements. .. py:method:: textof(*paths) -> str Returns the text of a given child-element. :param paths: Path as ``tag/tag2/tag3`` to the Element. :returns: The text of the element. .. py:method:: to_dict() -> dict Creates a dictionary from an XmlElement object. .. py:method:: to_list(fold_tags: bool = True, remove_namespaces: bool = False) -> list Parse an XML element into a list of arguments. :param fold_tags: If true, folds nested tag names into ``parent/child`` names. :param remove_namespaces: If true, removes all namespaces. .. py:method:: to_string(extra_namespaces: Optional[list[XmlNamespace]] = None, compact_whitespace: bool = False, remove_namespaces: bool = False, with_namespace_declarations: bool = False, with_schema_locations: bool = False, with_xml_declaration: bool = False) -> str Converts the Element object to a string. :param extra_namespaces: Extra namespaces to add to the document. :param compact_whitespace: Remove all whitespace outside of tags and elements. :param remove_namespaces: Remove all namespace references. :param with_namespace_declarations: Include the namespace declarations. :param with_schema_locations: Include schema locations. :param with_xml_declaration: Include the xml declaration. :returns: An XML string. .. py:class:: XmlNamespace(*args, **kwargs) Bases: :py:obj:`Data` XML namespace. .. py:attribute:: extendsGml :type: bool Namespace schema extends the GML3 schema. .. py:attribute:: schemaLocation :type: Url Namespace schema location. .. py:attribute:: uid :type: str Unique ID. .. py:attribute:: uri :type: Url Namespace uri. .. py:attribute:: version :type: str Namespace version. .. py:attribute:: xmlns :type: str Default prefix for this Namespace.