dara.cli module#

pydantic model DaraCli[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "DaraCli",
   "type": "object",
   "properties": {
      "server": {
         "anyOf": [
            {
               "$ref": "#/$defs/Server"
            },
            {
               "type": "null"
            }
         ]
      }
   },
   "$defs": {
      "Server": {
         "additionalProperties": false,
         "description": "Run the Dara server in a Web UI.",
         "properties": {
            "host": {
               "default": "127.0.0.1",
               "description": "The host address for the server.",
               "title": "Host",
               "type": "string"
            },
            "port": {
               "default": 8898,
               "description": "The port on which the server will run.",
               "title": "Port",
               "type": "integer"
            },
            "database_backend": {
               "default": "monty",
               "description": "The backend to use for the database.",
               "enum": [
                  "monty",
                  "mongodb"
               ],
               "title": "Database Backend",
               "type": "string"
            },
            "mongodb_host": {
               "default": "localhost",
               "description": "Host for MongoDB. Used only if database_backend is \"mongodb\".",
               "title": "Mongodb Host",
               "type": "string"
            },
            "mongodb_port": {
               "default": 27017,
               "description": "Port for MongoDB. Used only if database_backend is \"mongodb\".",
               "title": "Mongodb Port",
               "type": "integer"
            },
            "mongodb_database": {
               "default": "dara_server",
               "description": "Database name for MongoDB. Used only if database_backend is \"mongodb\".",
               "title": "Mongodb Database",
               "type": "string"
            },
            "mongodb_username": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Username for MongoDB. Used only if database_backend is \"mongodb\".",
               "title": "Mongodb Username"
            },
            "mongodb_password": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Password for MongoDB. Used only if database_backend is \"mongodb\".",
               "title": "Mongodb Password"
            },
            "montydb_path": {
               "default": "/home/runner/.dara-server/montydb",
               "description": "Path for MontyDB database. Used only if database_backend is \"monty\".",
               "title": "Montydb Path",
               "type": "string"
            }
         },
         "title": "Server",
         "type": "object"
      }
   },
   "required": [
      "server"
   ]
}

Fields:
field server: Annotated[Optional[Server]] [Required]#
Constraints:
  • __module__ = pydantic_settings.sources.types

  • __dict__ = {‘__module__’: ‘pydantic_settings.sources.types’, ‘__dict__’: <attribute ‘__dict__’ of ‘_CliSubCommand’ objects>, ‘__weakref__’: <attribute ‘__weakref__’ of ‘_CliSubCommand’ objects>, ‘__doc__’: None}

  • __weakref__ = <attribute ‘__weakref__’ of ‘_CliSubCommand’ objects>

cli_cmd()[source]#
Return type:

None

pydantic settings Server[source]#

Bases: DaraServerSettings

Run the Dara server in a Web UI.

Show JSON schema
{
   "title": "Server",
   "description": "Run the Dara server in a Web UI.",
   "type": "object",
   "properties": {
      "host": {
         "default": "127.0.0.1",
         "description": "The host address for the server.",
         "title": "Host",
         "type": "string"
      },
      "port": {
         "default": 8898,
         "description": "The port on which the server will run.",
         "title": "Port",
         "type": "integer"
      },
      "database_backend": {
         "default": "monty",
         "description": "The backend to use for the database.",
         "enum": [
            "monty",
            "mongodb"
         ],
         "title": "Database Backend",
         "type": "string"
      },
      "mongodb_host": {
         "default": "localhost",
         "description": "Host for MongoDB. Used only if database_backend is \"mongodb\".",
         "title": "Mongodb Host",
         "type": "string"
      },
      "mongodb_port": {
         "default": 27017,
         "description": "Port for MongoDB. Used only if database_backend is \"mongodb\".",
         "title": "Mongodb Port",
         "type": "integer"
      },
      "mongodb_database": {
         "default": "dara_server",
         "description": "Database name for MongoDB. Used only if database_backend is \"mongodb\".",
         "title": "Mongodb Database",
         "type": "string"
      },
      "mongodb_username": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Username for MongoDB. Used only if database_backend is \"mongodb\".",
         "title": "Mongodb Username"
      },
      "mongodb_password": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Password for MongoDB. Used only if database_backend is \"mongodb\".",
         "title": "Mongodb Password"
      },
      "montydb_path": {
         "default": "/home/runner/.dara-server/montydb",
         "description": "Path for MontyDB database. Used only if database_backend is \"monty\".",
         "title": "Montydb Path",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Config:
  • env_prefix: str = dara_server_

  • cli_parse_args: bool = True

  • cli_ignore_unknown_args: bool = True

Fields:

cli_cmd()[source]#
Return type:

None

main()[source]#
Return type:

None