pihole_lib.models package

Submodules

pihole_lib.models.base module

Base model classes.

class pihole_lib.models.base.StrictModel(**data)[source]

Bases: BaseModel

Base model with Pydantic v2 config.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.base.TimedResponse(**data)[source]

Bases: StrictModel

Base for API responses with timing information.

took: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.base.ProcessedSuccess(**data)[source]

Bases: StrictModel

Generic success item in processing result.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.base.ProcessedError(**data)[source]

Bases: StrictModel

Generic error item in processing result.

item: str
error: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.base.ProcessedResult(**data)[source]

Bases: StrictModel

Generic processing result.

success: list[ProcessedSuccess]
errors: list[ProcessedError]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.client_mgmt module

Client management models.

class pihole_lib.models.client_mgmt.Client(**data)[source]

Bases: StrictModel

Pi-hole client entry.

client: str
name: str
comment: str | None
groups: list[int]
id: int
date_added: int
date_modified: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientRequest(**data)[source]

Bases: StrictModel

Request model for creating or updating a client.

client: str | None
comment: str | None
groups: list[int]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientUpdateRequest(**data)[source]

Bases: StrictModel

Request model for updating an existing client.

comment: str | None
groups: list[int]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientBatchDeleteItem(**data)[source]

Bases: StrictModel

Item for batch client deletion.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientProcessedSuccess(**data)[source]

Bases: StrictModel

Success item in client processing result.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientProcessedError(**data)[source]

Bases: StrictModel

Error item in client processing result.

item: str
error: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientProcessedResult(**data)[source]

Bases: StrictModel

Processing result for client operations.

success: list[ClientProcessedSuccess]
errors: list[ClientProcessedError]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.client_mgmt.ClientsResponse(**data)[source]

Bases: TimedResponse

Response model for client operations.

clients: list[Client]
processed: ClientProcessedResult | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.client_mgmt.ClientSuggestionsResponse(**data)[source]

Bases: TimedResponse

Response model for client suggestions.

clients: list[Client]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.dhcp module

DHCP models.

class pihole_lib.models.dhcp.DHCPLease(**data)[source]

Bases: StrictModel

DHCP lease information.

expires: int
name: str
hwaddr: str
ip: str
clientid: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.dhcp.DHCPLeasesInfo(**data)[source]

Bases: StrictModel

DHCP leases information.

leases: list[DHCPLease]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.dns module

DNS models.

class pihole_lib.models.dns.DNSRecord(**data)[source]

Bases: StrictModel

DNS record information.

domain: str
target: str
record_type: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.dns.DNSConfig(**data)[source]

Bases: StrictModel

DNS configuration information.

upstreams: list[str]
records: list[DNSRecord]
port: int
query_logging: bool
dnssec: bool
blocking: dict[str, Any]
property blocking_active: bool

Whether DNS blocking is active.

property hosts: list[DNSRecord]

List of A records (host entries).

property cname_records: list[DNSRecord]

List of CNAME records.

classmethod from_raw_config(raw_config)[source]

Create DNSConfig from raw API response.

Return type:

DNSConfig

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.dns.DNSConfigInfo(**data)[source]

Bases: StrictModel

DNS configuration response information.

config: dict
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.dns.DNSBlockingStatus(**data)[source]

Bases: TimedResponse

DNS blocking status information.

blocking: str
timer: int | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.domains module

Domain models.

class pihole_lib.models.domains.DomainType(value)[source]

Bases: str, Enum

Pi-hole domain types.

ALLOW = 'allow'
DENY = 'deny'
__format__(format_spec)

Returns format using actual value type unless __str__ has been overridden.

class pihole_lib.models.domains.DomainKind(value)[source]

Bases: str, Enum

Pi-hole domain kinds.

EXACT = 'exact'
REGEX = 'regex'
__format__(format_spec)

Returns format using actual value type unless __str__ has been overridden.

class pihole_lib.models.domains.Domain(**data)[source]

Bases: StrictModel

Pi-hole domain entry.

domain: str
unicode: str
type: DomainType
kind: DomainKind
comment: str | None
groups: list[int]
enabled: bool
id: int
date_added: int
date_modified: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainsResponse(**data)[source]

Bases: TimedResponse

Response for domains endpoints.

domains: list[Domain]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.domains.DomainRequest(**data)[source]

Bases: StrictModel

Request for adding/updating domains.

domain: str | None
type: DomainType | None
kind: DomainKind | None
comment: str | None
groups: list[int] | None
enabled: bool | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainBatchDeleteItem(**data)[source]

Bases: StrictModel

Item for batch domain deletion.

item: str
type: DomainType
kind: DomainKind
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainProcessedSuccess(**data)[source]

Bases: StrictModel

Successful domain processing result.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainProcessedError(**data)[source]

Bases: StrictModel

Failed domain processing result.

item: str
error: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainProcessedResult(**data)[source]

Bases: StrictModel

Domain processing results.

success: list[DomainProcessedSuccess]
errors: list[DomainProcessedError]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.domains.DomainMutationResponse(**data)[source]

Bases: TimedResponse

Response for domain mutation operations.

domains: list[Domain]
processed: DomainProcessedResult
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.domains.DomainBatchDeleteResponse(**data)[source]

Bases: TimedResponse

Response for batch domain deletion.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.ftl module

FTL and database models.

class pihole_lib.models.ftl.DatabaseUser(**data)[source]

Bases: StrictModel

Database file user information.

uid: int
name: str
info: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.DatabaseGroup(**data)[source]

Bases: StrictModel

Database file group information.

gid: int
name: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.DatabaseOwner(**data)[source]

Bases: StrictModel

Database file ownership information.

user: DatabaseUser
group: DatabaseGroup
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.DatabaseInfo(**data)[source]

Bases: StrictModel

Pi-hole database information.

size: int
type: str
mode: str
atime: int
mtime: int
ctime: int
owner: DatabaseOwner
queries: int
earliest_timestamp: int
queries_disk: int
earliest_timestamp_disk: int
sqlite_version: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.FTLDatabaseStats(**data)[source]

Bases: StrictModel

FTL database statistics.

gravity: int
groups: int
lists: int
clients: int
domains: dict
regex: dict
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.FTLClientStats(**data)[source]

Bases: StrictModel

FTL client statistics.

total: int
active: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.FTLDnsmasqStats(**data)[source]

Bases: StrictModel

FTL dnsmasq statistics.

dns_cache_inserted: int
dns_cache_live_freed: int
dns_queries_forwarded: int
dns_auth_answered: int
dns_local_answered: int
dns_stale_answered: int
dns_unanswered: int
dnssec_max_crypto_use: int
dnssec_max_sig_fail: int
dnssec_max_work: int
bootp: int
pxe: int
dhcp_ack: int
dhcp_decline: int
dhcp_discover: int
dhcp_inform: int
dhcp_nak: int
dhcp_offer: int
dhcp_release: int
dhcp_request: int
noanswer: int
leases_allocated_4: int
leases_pruned_4: int
leases_allocated_6: int
leases_pruned_6: int
tcp_connections: int
dhcp_leasequery: int
dhcp_lease_unassigned: int
dhcp_lease_actve: int
dhcp_lease_unknown: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.FTLStats(**data)[source]

Bases: StrictModel

FTL statistics.

database: FTLDatabaseStats
privacy_level: int
query_frequency: int
clients: FTLClientStats
pid: int
uptime: float
mem_percent: float
cpu_percent: float
allow_destructive: bool
dnsmasq: FTLDnsmasqStats
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.ftl.FTLInfo(**data)[source]

Bases: StrictModel

Pi-hole FTL information wrapper.

ftl: FTLStats
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.groups module

Group models.

class pihole_lib.models.groups.Group(**data)[source]

Bases: StrictModel

Pi-hole group information.

name: str
comment: str | None
enabled: bool
id: int
date_added: int
date_modified: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.groups.GroupRequest(**data)[source]

Bases: StrictModel

Request model for creating or updating a group.

name: str
comment: str | None
enabled: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.groups.GroupProcessedSuccess(**data)[source]

Bases: StrictModel

Success item in group processing result.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.groups.GroupProcessedError(**data)[source]

Bases: StrictModel

Error item in group processing result.

item: str
error: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.groups.GroupProcessedResult(**data)[source]

Bases: StrictModel

Processing result for group operations.

success: list[GroupProcessedSuccess]
errors: list[GroupProcessedError]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.groups.GroupsResponse(**data)[source]

Bases: TimedResponse

Response model for group operations.

groups: list[Group]
processed: GroupProcessedResult | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.host module

Host system models.

class pihole_lib.models.host.HostUname(**data)[source]

Bases: StrictModel

Host system uname information.

domainname: str
machine: str
nodename: str
release: str
sysname: str
version: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDMIBios(**data)[source]

Bases: StrictModel

Host DMI BIOS information.

vendor: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDMIBoard(**data)[source]

Bases: StrictModel

Host DMI board information.

name: str | None
vendor: str | None
version: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDMIProduct(**data)[source]

Bases: StrictModel

Host DMI product information.

name: str | None
family: str | None
version: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDMISystem(**data)[source]

Bases: StrictModel

Host DMI system information.

vendor: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDMI(**data)[source]

Bases: StrictModel

Host DMI/SMBIOS information.

bios: HostDMIBios
board: HostDMIBoard
product: HostDMIProduct
sys: HostDMISystem
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostDetails(**data)[source]

Bases: StrictModel

Host system details.

uname: HostUname
model: str | None
dmi: HostDMI
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.host.HostInfo(**data)[source]

Bases: StrictModel

Pi-hole host system information wrapper.

host: HostDetails
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.lists module

List models.

class pihole_lib.models.lists.ListType(value)[source]

Bases: str, Enum

Pi-hole list types.

ALLOW = 'allow'
BLOCK = 'block'
__format__(format_spec)

Returns format using actual value type unless __str__ has been overridden.

class pihole_lib.models.lists.PiHoleList(**data)[source]

Bases: StrictModel

Pi-hole domain list.

address: str
type: ListType
comment: str | None
groups: list[int]
enabled: bool
id: int
date_added: int
date_modified: int
date_updated: int
number: int
invalid_domains: int
abp_entries: int
status: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.AddListRequest(**data)[source]

Bases: StrictModel

Request model for adding a new Pi-hole list.

address: str
comment: str | None
groups: list[int]
enabled: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.UpdateListRequest(**data)[source]

Bases: StrictModel

Request model for updating an existing Pi-hole list.

comment: str | None
type: ListType
groups: list[int]
enabled: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.BatchDeleteItem(**data)[source]

Bases: StrictModel

Item for batch delete operation.

item: str
type: ListType
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.ListProcessedSuccess(**data)[source]

Bases: StrictModel

Success item in list processing result.

item: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.ListProcessedError(**data)[source]

Bases: StrictModel

Error item in list processing result.

item: str
error: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.ListProcessedResult(**data)[source]

Bases: StrictModel

Processing result for list operations.

success: list[ListProcessedSuccess]
errors: list[ListProcessedError]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.lists.ListsResponse(**data)[source]

Bases: TimedResponse

Response model for list operations.

lists: list[PiHoleList]
processed: ListProcessedResult | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.messages module

Message models.

class pihole_lib.models.messages.Message(**data)[source]

Bases: StrictModel

Pi-hole system message.

id: int
timestamp: int
type: str
plain: str
html: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.messages.MessagesInfo(**data)[source]

Bases: StrictModel

Pi-hole messages information.

messages: list[Message]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.messages.MessagesCountInfo(**data)[source]

Bases: StrictModel

Pi-hole messages count information.

count: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.network module

Network models.

class pihole_lib.models.network.NetworkDeviceAddress(**data)[source]

Bases: StrictModel

Network device address information.

ip: str
hostname: str | None
last_query: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkDevice(**data)[source]

Bases: StrictModel

Network device information.

id: int
hwaddr: str
interface: str
name: str
first_seen: int
last_query: int
num_queries: int
addresses: list[NetworkDeviceAddress]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkDevicesResponse(**data)[source]

Bases: TimedResponse

Response for network devices endpoint.

devices: list[NetworkDevice]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.network.NetworkGateway(**data)[source]

Bases: StrictModel

Network gateway information.

family: str
interface: str
address: str
local: list[str]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkGatewayResponse(**data)[source]

Bases: TimedResponse

Response for network gateway endpoint.

gateway: list[NetworkGateway]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.network.NetworkGatewayDetailedResponse(**data)[source]

Bases: TimedResponse

Response for detailed network gateway endpoint.

gateway: list[NetworkGateway]
routes: list[dict]
interfaces: list[dict]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.network.NetworkInterfaceStats(**data)[source]

Bases: StrictModel

Network interface statistics.

rx_bytes: dict[str, str | float]
tx_bytes: dict[str, str | float]
bits: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkInterfaceAddress(**data)[source]

Bases: StrictModel

Network interface address information.

family: str
scope: str
flags: list[str]
prefixlen: int
address: str
address_type: str
local: str | None
local_type: str | None
broadcast: str | None
broadcast_type: str | None
label: str | None
prefered: int
valid: int
cstamp: float
tstamp: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkInterface(**data)[source]

Bases: StrictModel

Network interface information.

name: str
speed: int | None
type: str
flags: list[str]
state: str
carrier: bool
proto_down: bool
address: str
broadcast: str
perm_address: str | None
stats: NetworkInterfaceStats
addresses: list[NetworkInterfaceAddress] | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkInterfacesResponse(**data)[source]

Bases: TimedResponse

Response for network interfaces endpoint.

interfaces: list[NetworkInterface]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.network.NetworkRoute(**data)[source]

Bases: StrictModel

Network route information.

table: int
family: str
protocol: str
scope: str
type: str
flags: list[str]
gateway: str | None
oif: str
dst: str
prefsrc: str | None
priority: int | None
pref: int | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.network.NetworkRoutesResponse(**data)[source]

Bases: TimedResponse

Response for network routes endpoint.

routes: list[NetworkRoute]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.network.NetworkDeviceDeleteResponse(**data)[source]

Bases: TimedResponse

Response for network device deletion.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.padd module

PADD (Pi-hole API Dashboard Data) models.

class pihole_lib.models.padd.PADDQueries(**data)[source]

Bases: StrictModel

PADD queries information.

total: int
blocked: int
percent_blocked: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDCache(**data)[source]

Bases: StrictModel

PADD cache information.

size: int
inserted: int
evicted: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDMemory(**data)[source]

Bases: StrictModel

PADD memory information.

ram: RAMStats
swap: MemoryStats
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDSystem(**data)[source]

Bases: StrictModel

PADD system information.

uptime: int
memory: PADDMemory
procs: int
cpu: CPUStats
ftl: FTLResourceUsage
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDNetworkBytes(**data)[source]

Bases: StrictModel

PADD network bytes information.

value: float
unit: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDNetworkInterface(**data)[source]

Bases: StrictModel

PADD network interface information.

addr: str | None
rx_bytes: PADDNetworkBytes | None
tx_bytes: PADDNetworkBytes | None
num_addrs: int
name: str
gw_addr: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDInterface(**data)[source]

Bases: StrictModel

PADD interface information.

v4: PADDNetworkInterface
v6: PADDNetworkInterface
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDVersionComponent(**data)[source]

Bases: StrictModel

PADD version component information.

version: str
branch: str | None
hash: str
date: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDVersionRemote(**data)[source]

Bases: StrictModel

PADD remote version information.

version: str | None
hash: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDVersionInfo(**data)[source]

Bases: StrictModel

PADD version component info.

local: PADDVersionComponent
remote: PADDVersionRemote
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDVersionDocker(**data)[source]

Bases: StrictModel

PADD Docker version information.

local: str
remote: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDVersion(**data)[source]

Bases: StrictModel

PADD version information.

core: PADDVersionInfo
web: PADDVersionInfo
ftl: PADDVersionInfo
docker: PADDVersionDocker
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDConfig(**data)[source]

Bases: StrictModel

PADD configuration information.

dhcp_active: bool
dhcp_start: str
dhcp_end: str
dhcp_ipv6: bool
dns_domain: str
dns_port: int
dns_num_upstreams: int
dns_dnssec: bool
dns_revServer_active: bool
privacy_level: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDSensors(**data)[source]

Bases: StrictModel

PADD sensors information.

cpu_temp: float | None
hot_limit: int
unit: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.padd.PADDInfo(**data)[source]

Bases: StrictModel

Pi-hole PADD (Pi-hole API Dashboard Data) information.

active_clients: int
gravity_size: int
top_domain: str | None
top_blocked: str | None
top_client: str | None
recent_blocked: str | None
blocking: str
queries: PADDQueries
cache: PADDCache
system: PADDSystem
node_name: str
host_model: str | None
iface: PADDInterface
version: PADDVersion
config: PADDConfig
percent_mem: float
percent_cpu: float
pid: int
sensors: PADDSensors
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.search module

Search models.

class pihole_lib.models.search.SearchResultCounts(**data)[source]

Bases: StrictModel

Search result counts.

exact: int
regex: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.search.SearchGravityCounts(**data)[source]

Bases: StrictModel

Search gravity result counts.

allow: int
block: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.search.SearchResults(**data)[source]

Bases: StrictModel

Search results summary.

domains: SearchResultCounts
gravity: SearchGravityCounts
total: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.search.SearchParameters(**data)[source]

Bases: StrictModel

Search parameters used.

N: int
partial: bool
domain: str
debug: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.search.SearchData(**data)[source]

Bases: StrictModel

Search data container.

domains: list[PiHoleList]
gravity: list[PiHoleList]
results: SearchResults
parameters: SearchParameters
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.search.SearchResponse(**data)[source]

Bases: TimedResponse

Response for domain search operations.

search: SearchData
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.session module

Authentication and session models.

class pihole_lib.models.session.LoginInfo(**data)[source]

Bases: StrictModel

Pi-hole login page information.

https_port: int
dns: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.session.PiHoleAuthSession(**data)[source]

Bases: StrictModel

Pi-hole authentication session data.

valid: bool
totp: bool
sid: str
csrf: str
validity: int
message: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.session.ClientHeader(**data)[source]

Bases: StrictModel

HTTP header from client request.

name: str
value: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.session.ClientInfo(**data)[source]

Bases: StrictModel

Pi-hole client request information.

remote_addr: str
http_version: str
method: str
headers: list[ClientHeader]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.stats module

Statistics and history models.

class pihole_lib.models.stats.HistoryEntry(**data)[source]

Bases: StrictModel

History entry for activity graph data.

timestamp: int
total: int
cached: int
blocked: int
forwarded: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.HistoryResponse(**data)[source]

Bases: TimedResponse

Response for history endpoints.

history: list[HistoryEntry]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.ClientHistoryEntry(**data)[source]

Bases: StrictModel

Client history entry for per-client activity data.

timestamp: int
data: dict[str, int]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.ClientHistoryResponse(**data)[source]

Bases: TimedResponse

Response for client history endpoints.

history: list[ClientHistoryEntry]
clients: dict[str, str]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.DatabaseHistoryResponse(**data)[source]

Bases: TimedResponse

Response for database history endpoints.

history: list[HistoryEntry]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.DatabaseClientHistoryResponse(**data)[source]

Bases: TimedResponse

Response for database client history endpoints.

history: list[ClientHistoryEntry]
clients: dict[str, str]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.QueryEntry(**data)[source]

Bases: StrictModel

Individual query entry.

timestamp: int
type: str
domain: str
client: str
status: str
destination: str
reply_type: str
response_time: float
dnssec: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.QueriesResponse(**data)[source]

Bases: TimedResponse

Response for queries endpoint.

queries: list[QueryEntry]
cursor: int
records_total: int
records_filtered: int
draw: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.QuerySuggestions(**data)[source]

Bases: StrictModel

Query filter suggestions.

domain: list[str]
client_ip: list[str]
client_name: list[str]
upstream: list[str]
type: list[str]
status: list[str]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.QuerySuggestionsResponse(**data)[source]

Bases: TimedResponse

Response for query suggestions endpoint.

suggestions: QuerySuggestions
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.QueryTypesResponse(**data)[source]

Bases: TimedResponse

Response for query types endpoints.

types: dict[str, int]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.DatabaseSummaryResponse(**data)[source]

Bases: TimedResponse

Response for database summary endpoint.

sum_queries: int
sum_blocked: int
percent_blocked: float
total_clients: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.TopClient(**data)[source]

Bases: StrictModel

Top client entry.

ip: str
name: str | None
count: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.TopClientsResponse(**data)[source]

Bases: TimedResponse

Response for top clients endpoints.

clients: list[TopClient]
total_queries: int
blocked_queries: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.TopDomain(**data)[source]

Bases: StrictModel

Top domain entry.

domain: str
count: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.TopDomainsResponse(**data)[source]

Bases: TimedResponse

Response for top domains endpoints.

domains: list[TopDomain]
total_queries: int
blocked_queries: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.UpstreamStatistics(**data)[source]

Bases: StrictModel

Upstream server statistics.

response: float
variance: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.UpstreamServer(**data)[source]

Bases: StrictModel

Upstream server information.

ip: str
name: str
port: int
count: int
statistics: UpstreamStatistics | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.UpstreamsResponse(**data)[source]

Bases: TimedResponse

Response for upstreams endpoints.

upstreams: list[UpstreamServer]
total_queries: int
forwarded_queries: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.RecentBlockedResponse(**data)[source]

Bases: TimedResponse

Response for recent blocked domains endpoint.

blocked: list[str]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float
class pihole_lib.models.stats.SummaryQueries(**data)[source]

Bases: StrictModel

Summary queries information.

total: int
blocked: int
percent_blocked: float
unique_domains: int
forwarded: int
cached: int
frequency: float
types: dict[str, int]
status: dict[str, int]
replies: dict[str, int]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.SummaryClients(**data)[source]

Bases: StrictModel

Summary clients information.

total: int
active: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.SummaryGravity(**data)[source]

Bases: StrictModel

Summary gravity information.

domains_being_blocked: int
last_update: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.stats.SummaryResponse(**data)[source]

Bases: TimedResponse

Response for summary endpoint.

queries: SummaryQueries
clients: SummaryClients
gravity: SummaryGravity
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

pihole_lib.models.system module

System resource models.

class pihole_lib.models.system.MemoryStats(**data)[source]

Bases: StrictModel

Memory statistics (RAM or Swap).

total: int
free: int
used: int
percent_used: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.RAMStats(**data)[source]

Bases: MemoryStats

RAM statistics with available memory.

available: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

total: int
free: int
used: int
percent_used: float
class pihole_lib.models.system.Memory(**data)[source]

Bases: StrictModel

Combined RAM and swap memory information.

ram: RAMStats
swap: MemoryStats
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.CPULoad(**data)[source]

Bases: StrictModel

CPU load averages.

raw: list[float]
percent: list[float]
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.CPUStats(**data)[source]

Bases: StrictModel

CPU statistics.

nprocs: int
percent_cpu: float
load: CPULoad
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.FTLResourceUsage(**data)[source]

Bases: StrictModel

FTL process resource usage.

percent_mem: float
percent_cpu: float
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.NetworkBytes(**data)[source]

Bases: StrictModel

Network byte count with unit.

value: float
unit: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.SystemDetails(**data)[source]

Bases: StrictModel

System resource details.

uptime: int
memory: Memory
procs: int
cpu: CPUStats
ftl: FTLResourceUsage
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.system.SystemInfo(**data)[source]

Bases: StrictModel

Pi-hole system information wrapper.

system: SystemDetails
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.teleporter module

Teleporter models.

class pihole_lib.models.teleporter.TeleporterGravityOptions(**data)[source]

Bases: StrictModel

Teleporter gravity database import options.

group: bool
adlist: bool
adlist_by_group: bool
domainlist: bool
domainlist_by_group: bool
client: bool
client_by_group: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.teleporter.TeleporterImportOptions(**data)[source]

Bases: StrictModel

Pi-hole Teleporter import options.

config: bool
dhcp_leases: bool
gravity: TeleporterGravityOptions
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pihole_lib.models.version module

Version models.

class pihole_lib.models.version.VersionLocal(**data)[source]

Bases: StrictModel

Local version information.

version: str
branch: str | None
hash: str
date: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.version.VersionRemote(**data)[source]

Bases: StrictModel

Remote version information.

version: str | None
hash: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.version.ComponentVersion(**data)[source]

Bases: StrictModel

Component version information.

local: VersionLocal
remote: VersionRemote
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.version.DockerVersion(**data)[source]

Bases: StrictModel

Docker version information.

local: str | None
remote: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.version.VersionDetails(**data)[source]

Bases: StrictModel

Pi-hole version details for all components.

core: ComponentVersion
web: ComponentVersion
ftl: ComponentVersion
docker: DockerVersion
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pihole_lib.models.version.VersionInfo(**data)[source]

Bases: TimedResponse

Pi-hole version information response.

version: VersionDetails
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

took: float

Module contents

Data models for Pi-hole API responses.