Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Classes | Functions | Variables
myst_parser.inventory Namespace Reference

Classes

class  InventoryFileReader
 
class  InventoryItemType
 
class  InventoryType
 
class  InvMatch
 

Functions

InventoryType from_sphinx (SphinxInventoryType inv)
 
SphinxInventoryType to_sphinx (InventoryType inv)
 
InventoryType load (IO stream, str|None base_url=None)
 
InventoryType _load_v1 (InventoryFileReader stream, str|None base_url)
 
InventoryType _load_v2 (InventoryFileReader stream, str|None base_url)
 
re.Pattern[str] _create_regex (str pat)
 
bool match_with_wildcard (str name, str|None pattern)
 
Iterator[InvMatchfilter_inventories (dict[str, InventoryType] inventories, *str|None invs=None, str|None domains=None, str|None otypes=None, str|None targets=None)
 
Iterator[InvMatchfilter_sphinx_inventories (dict[str, SphinxInventoryType] inventories, *str|None invs=None, str|None domains=None, str|None otypes=None, str|None targets=None)
 
str filter_string (str|None invs, str|None domains, str|None otype, str|None target, *str delimiter=":")
 
InventoryType fetch_inventory (str uri, *None|float timeout=None, None|str base_url=None)
 
 inventory_cli (None|list[str] inputs=None)
 

Variables

int _BUFSIZE = 16 * 1024
 

Detailed Description

Logic for dealing with sphinx style inventories (e.g. `objects.inv`).

These contain mappings of reference names to ids, scoped by domain and object type.

This is adapted from the Sphinx inventory.py module.
We replicate it here, so that it can be used without Sphinx.

Function Documentation

◆ _create_regex()

re.Pattern[str] myst_parser.inventory._create_regex ( str  pat)
protected
Create a regex from a pattern, that can include `*` wildcards,
to match 0 or more characters.

`\*` is translated as a literal `*`.

◆ _load_v1()

InventoryType myst_parser.inventory._load_v1 ( InventoryFileReader  stream,
str | None  base_url 
)
protected
Load inventory data (format v1) from a stream.

◆ _load_v2()

InventoryType myst_parser.inventory._load_v2 ( InventoryFileReader  stream,
str | None  base_url 
)
protected
Load inventory data (format v2) from a stream.

◆ fetch_inventory()

InventoryType myst_parser.inventory.fetch_inventory ( str  uri,
*None | float   timeout = None,
None | str   base_url = None 
)
Fetch an inventory from a URL or local path.

◆ filter_inventories()

Iterator[InvMatch] myst_parser.inventory.filter_inventories ( dict[str, InventoryType inventories,
*str | None   invs = None,
str | None   domains = None,
str | None   otypes = None,
str | None   targets = None 
)
Filter a set of inventories.

Filters are strings that can include `*` wildcards, to match 0 or more characters.
To include a literal `*` in the pattern, use `\*`.

:param inventories: Mapping of inventory name to inventory data
:param invs: the inventory key filter
:param domains: the domain name filter
:param otypes: the object type filter
:param targets: the target name filter

◆ filter_sphinx_inventories()

Iterator[InvMatch] myst_parser.inventory.filter_sphinx_inventories ( dict[str, SphinxInventoryType]  inventories,
*str | None   invs = None,
str | None   domains = None,
str | None   otypes = None,
str | None   targets = None 
)
Filter a set of sphinx style inventories.

Filters are strings that can include `*` wildcards, to match 0 or more characters.
To include a literal `*` in the pattern, use `\*`.

:param inventories: Mapping of inventory name to inventory data
:param invs: the inventory key filter
:param domains: the domain name filter
:param otypes: the object type filter
:param targets: the target name filter

◆ filter_string()

str myst_parser.inventory.filter_string ( str | None  invs,
str | None  domains,
str | None  otype,
str | None  target,
*str   delimiter = ":" 
)
Create a string representation of the filter, from the given arguments.

◆ from_sphinx()

InventoryType myst_parser.inventory.from_sphinx ( SphinxInventoryType  inv)
Convert from a Sphinx compliant format.

◆ inventory_cli()

myst_parser.inventory.inventory_cli ( None | list[str]   inputs = None)
Command line interface for fetching and parsing an inventory.

◆ load()

InventoryType myst_parser.inventory.load ( IO  stream,
str | None   base_url = None 
)
Load inventory data from a stream.

◆ match_with_wildcard()

bool myst_parser.inventory.match_with_wildcard ( str  name,
str | None  pattern 
)
Match a whole name with a pattern, that can include `*` wildcards,
to match 0 or more characters.

To include a literal `*` in the pattern, use `\*`.

◆ to_sphinx()

SphinxInventoryType myst_parser.inventory.to_sphinx ( InventoryType  inv)
Convert to a Sphinx compliant format.