fact-sphere

fact-sphere is a Python library for Portal 2 Fact Sphere facts.

API Reference

Core

fact_sphere.audio(fact_type=None)

Get the audio for a random fact.

Parameters

fact_type (FactType) – The type of fact to return. Default: Get any type of fact.

Returns

An audio object.

Return type

Audio

fact_sphere.fact(fact_type=None)

Get the audio filepath, text and fact type for a random fact.

Parameters

fact_type (FactType) – The type of fact to return. Default: Get any type of fact.

Returns

A fact object.

Return type

Fact

fact_sphere.text(fact_type=None)

Get the text for a random fact.

Parameters

fact_type (FactType) – The type of fact to return. Default: Get any type of fact.

Returns

The fact text.

Return type

str

Helpers

class fact_sphere.FactType(value)

An enumeration.

FALSE = 'False Facts'
NEARLY_TRUE = 'Nearly True Facts'
NOT_FACTS = 'Not Facts'
PARTIALLY_TRUE = 'Partially True Facts'
PROBABLY_FALSE = 'Probably False Facts'
SUBJECTIVE_UNVERIFIABLE = 'Subjective or Unverifiable Facts'
TRUE = 'True Facts'
class fact_sphere.models.Audio(filepath)

A representation of fact audio.

filepath

The filepath to the fact audio.

Type

str

read()

Get the binary data from the fact audio file.

class fact_sphere.models.Fact(text, audio, type)

A representation of a fact.

audio

The fact audio.

Type

Audio

text

The fact text.

Type

str

type

The fact type.

Type

FactType