home / docs / sections

sections

4 rows where breadcrumbs = "["Internals for plugins", "The datasette.utils module"]", breadcrumbs contains "Internals for plugins" and references = "[]"

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: breadcrumbs (array)

id ▼ page ref title content breadcrumbs references
internals:internals-utils-async-call-with-supported-arguments internals internals-utils-async-call-with-supported-arguments await async_call_with_supported_arguments(fn, Async version of call_with_supported_arguments . Use this for async def callback functions. async datasette.utils. async_call_with_supported_arguments fn ** kwargs Async version of call_with_supported_arguments() . Calls await fn(...) with the subset of **kwargs matching its signature. Parameters fn -- An async callable kwargs -- All available keyword arguments Returns The return value of await fn(...) ["Internals for plugins", "The datasette.utils module"] []
internals:internals-utils-call-with-supported-arguments internals internals-utils-call-with-supported-arguments call_with_supported_arguments(fn, Call fn , passing it only those keyword arguments that match its function signature. This implements a dependency injection pattern - the caller provides all available arguments, and the function receives only the ones it declares as parameters. This is useful in plugins that want to define callback functions that only declare the arguments they need. For example: from datasette.utils import call_with_supported_arguments def my_callback(request, datasette): ... # This will pass only request and datasette, ignoring other kwargs: call_with_supported_arguments( my_callback, request=request, datasette=datasette, database=database, table=table, ) datasette.utils. call_with_supported_arguments fn ** kwargs Call fn with the subset of **kwargs matching its signature. This implements dependency injection: the caller provides all available keyword arguments and the function receives only the ones it declares as parameters. Parameters fn -- A callable (sync function) kwargs -- All available keyword arguments Returns The return value of fn ["Internals for plugins", "The datasette.utils module"] []
internals:internals-utils-named-parameters internals internals-utils-named-parameters named_parameters(sql) Derive the list of :named parameters referenced in a SQL query. datasette.utils. named_parameters sql : str List [ str ] Given a SQL statement, return a list of named parameters that are used in the statement e.g. for select * from foo where id=:id this would return ["id"] ["Internals for plugins", "The datasette.utils module"] []
internals:internals-utils-parse-metadata internals internals-utils-parse-metadata parse_metadata(content) This function accepts a string containing either JSON or YAML, expected to be of the format described in Metadata . It returns a nested Python dictionary representing the parsed data from that string. If the metadata cannot be parsed as either JSON or YAML the function will raise a utils.BadMetadataError exception. datasette.utils. parse_metadata content : str dict Detects if content is JSON or YAML and parses it appropriately. ["Internals for plugins", "The datasette.utils module"] []

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [sections] (
   [id] TEXT PRIMARY KEY,
   [page] TEXT,
   [ref] TEXT,
   [title] TEXT,
   [content] TEXT,
   [breadcrumbs] TEXT,
   [references] TEXT
);
Powered by Datasette · Queries took 1.2ms