muck_out.types
These are the basic types of objects muck_out transforms things to
Activity
Bases: Common
This represents a first draft of a json-schema that every activities exchanged between servers MUST satisfy and be able to parse. Here ‘being able to parse’ means making it to the point, where depending on the type, you decide what side effects to perform.
Generally, the fields actor, to, and cc (and maybe bcc — not transported) represent how the message is being delivered. The fields actor, type, object, target, content represent how the message is processed by the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_context
|
str | list[Any] | None
|
|
None
|
id
|
str
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
required |
to
|
list[str]
|
Array of actors this activity or object is addressed to. It is sane to assume that an activity is addressed to at least one person. |
required |
cc
|
list[str]
|
Array of actors this activity or object is carbon copied to. |
[]
|
published
|
datetime | None
|
Moment of this activity or object being published |
None
|
type
|
str
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
required |
actor
|
str
|
id of the actor performing this activity. One can assume that the activity is signed by this actor (in some form). |
required |
object
|
str | Object | None
|
|
None
|
target
|
str | dict[str, Any] | None
|
The target, not sure if needed, included for completeness |
None
|
content
|
str | None
|
The content used for example to represent the Emote for a like |
None
|
Source code in muck_out/types/validated/__init__.py
ActivityStub
Bases: Common
This represents a first draft of a json-schema that every activities exchanged between servers MUST satisfy and be able to parse. Here ‘being able to parse’ means making it to the point, where depending on the type, you decide what side effects to perform.
Generally, the fields actor, to, and cc (and maybe bcc — not transported) represent how the message is being delivered. The fields actor, type, object, target, content represent how the message is processed by the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_context
|
list[Union[str, dict]] | None
|
The Json-LD context |
['https://www.w3.org/ns/activitystreams']
|
id
|
str | None
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
None
|
type
|
str | None
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
None
|
to
|
list[str]
|
Array of actors this activity or object is addressed to. It is sane to assume that an activity is addressed to at least one person. |
[]
|
cc
|
list[str]
|
Array of actors this activity or object is carbon copied to. |
[]
|
published
|
datetime | None
|
Moment of this activity or object being published |
None
|
actor
|
str | None
|
id of the actor performing this activity. One can assume that the activity is signed by this actor (in some form). |
None
|
object
|
str | None
|
The object of the activity |
None
|
target
|
str | None
|
The target, not sure if needed, included for completeness |
None
|
content
|
str | None
|
The content used for example to represent the Emote for a like |
None
|
Source code in muck_out/types/stubs/activity.py
Actor
Bases: CommonAll, CommonActor
Describes an ActivityPub actor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inbox
|
str | None
|
The inbox of the actor |
None
|
outbox
|
str | None
|
The outbox of the actor |
None
|
followers
|
str | None
|
The followers collection of the actor |
None
|
following
|
str | None
|
The following collection of the actor |
None
|
summary
|
str | None
|
Description of the actor |
None
|
name
|
str | None
|
Display name of the actor |
None
|
url
|
list[dict[str, Any]]
|
A list of urls connected to the actor |
[]
|
attachment
|
list[Annotated[Union[Annotated[PropertyValue, Tag], Annotated[dict, Tag]], Discriminator]]
|
attachments … currently used for property values |
[]
|
tag
|
list[Annotated[Union[Annotated[Hashtag, Tag], Annotated[Mention, Tag], Annotated[ObjectLink, Tag], Annotated[dict, Tag], Annotated[dict, BeforeValidator, Tag]], Discriminator]]
|
A list of objects that expand on the summary of the actor |
[]
|
manually_approves_followers
|
bool | None
|
If set to false, one can assume that te actor automatically replies to follow requests |
None
|
field_context
|
str | list[Any] | None
|
|
None
|
id
|
str
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
required |
type
|
str
|
The type of Actor |
required |
icon
|
dict | None
|
The avatar of the actor |
None
|
also_known_as
|
list[str] | None
|
Other uris associated with the actor |
None
|
preferred_username
|
str | None
|
|
None
|
identifiers
|
list[str]
|
An ordered list of identifiers |
[]
|
Source code in muck_out/types/validated/actor.py
ActorStub
Bases: CommonAll, CommonActor
Describes an ActivityPub actor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inbox
|
str | None
|
The inbox of the actor |
None
|
outbox
|
str | None
|
The outbox of the actor |
None
|
followers
|
str | None
|
The followers collection of the actor |
None
|
following
|
str | None
|
The following collection of the actor |
None
|
summary
|
str | None
|
Description of the actor |
None
|
name
|
str | None
|
Display name of the actor |
None
|
url
|
list[dict[str, Any]]
|
A list of urls connected to the actor |
[]
|
attachment
|
list[Annotated[Union[Annotated[PropertyValue, Tag], Annotated[dict, Tag]], Discriminator]]
|
attachments … currently used for property values |
[]
|
tag
|
list[Annotated[Union[Annotated[Hashtag, Tag], Annotated[Mention, Tag], Annotated[ObjectLink, Tag], Annotated[dict, Tag], Annotated[dict, BeforeValidator, Tag]], Discriminator]]
|
A list of objects that expand on the summary of the actor |
[]
|
manually_approves_followers
|
bool | None
|
If set to false, one can assume that te actor automatically replies to follow requests |
None
|
field_context
|
list[Union[str, dict]] | None
|
The Json-LD context |
['https://www.w3.org/ns/activitystreams']
|
id
|
str | None
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
None
|
type
|
str | None
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
None
|
icon
|
dict | None
|
The avatar of the actor |
None
|
also_known_as
|
list[str] | None
|
Other uris associated with the actor |
None
|
preferred_username
|
str | None
|
|
None
|
identifiers
|
list[str]
|
An ordered list of identifiers |
[]
|
Source code in muck_out/types/stubs/actor.py
Collection
Bases: CommonAll
Abstracts all the ActivityPub collection concepts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_context
|
str | list[Any] | None
|
|
None
|
id
|
str
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
required |
type
|
str
|
Type of object |
required |
items
|
list[str] | None
|
The items |
None
|
next
|
str | None
|
|
None
|
prev
|
str | None
|
|
None
|
first
|
str | None
|
|
None
|
last
|
str | None
|
|
None
|
total_items
|
int | None
|
|
None
|
Source code in muck_out/types/validated/collection.py
CollectionStub
Bases: CommonAll
Abstracts all the ActivityPub collection concepts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_context
|
list[Union[str, dict]] | None
|
The Json-LD context |
['https://www.w3.org/ns/activitystreams']
|
id
|
str | None
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
None
|
type
|
str | None
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
None
|
items
|
list[str]
|
The items |
[]
|
next
|
str | None
|
|
None
|
prev
|
str | None
|
|
None
|
first
|
str | None
|
|
None
|
last
|
str | None
|
|
None
|
total_items
|
int | None
|
|
None
|
Source code in muck_out/types/stubs/collection.py
Object
Bases: Common, CommonObject
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
updated
|
datetime | None
|
Moment of this object being updated |
None
|
summary
|
str | None
|
The summary of the object |
None
|
name
|
str | None
|
The name of the object |
None
|
in_reply_to
|
str | None
|
The object being replied to. Currently a string. Not sure if this is what I want. |
None
|
context
|
str | None
|
The context of the object |
None
|
tag
|
list[Annotated[Union[Annotated[Hashtag, Tag], Annotated[Mention, Tag], Annotated[ObjectLink, Tag], Annotated[dict, Tag], Annotated[dict, BeforeValidator, Tag]], Discriminator]]
|
A list of objects that expand on the content of the object |
[]
|
field_context
|
str | list[Any] | None
|
|
None
|
id
|
str
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
required |
to
|
list[str]
|
Array of actors this activity or object is addressed to. It is sane to assume that an activity is addressed to at least one person. |
required |
cc
|
list[str]
|
Array of actors this activity or object is carbon copied to. |
[]
|
published
|
datetime | None
|
Moment of this activity or object being published |
None
|
type
|
str
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
required |
attributed_to
|
str
|
id of the actor that authored this object |
required |
content
|
str | None
|
The content of the object |
None
|
content_plain
|
Annotated[str, BeforeValidator] | None
|
The content of the object stripped of html |
None
|
attachment
|
list[dict[str, Any]] | None
|
A list of objects that are attached to the original object |
None
|
url
|
list[dict[str, Any]]
|
A list of urls that expand on the content of the object |
[]
|
sensitive
|
bool | None
|
Marks the object as sensitive. Currently, used by everyone, a better way would be an element of the tag list that labels the object as sensitive due a reason |
None
|
Source code in muck_out/types/validated/object.py
ObjectStub
Bases: Common, CommonObject
Stub object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
updated
|
datetime | None
|
Moment of this object being updated |
None
|
summary
|
str | None
|
The summary of the object |
None
|
name
|
str | None
|
The name of the object |
None
|
in_reply_to
|
str | None
|
The object being replied to. Currently a string. Not sure if this is what I want. |
None
|
context
|
str | None
|
The context of the object |
None
|
tag
|
list[Annotated[Union[Annotated[Hashtag, Tag], Annotated[Mention, Tag], Annotated[ObjectLink, Tag], Annotated[dict, Tag], Annotated[dict, BeforeValidator, Tag]], Discriminator]]
|
A list of objects that expand on the content of the object |
[]
|
field_context
|
list[Union[str, dict]] | None
|
The Json-LD context |
['https://www.w3.org/ns/activitystreams']
|
id
|
str | None
|
id of the activity or object, can be assumed to be globally unique. Some activities such as a Follow request will require an id to be valid. Servers may assume an id to be required. As assigning an id is ‘trivial’, one should assign one. |
None
|
type
|
str | None
|
Type of the activity or activity. Side effects of this activity are determine by this type. |
None
|
to
|
list[str]
|
Array of actors this activity or object is addressed to. It is sane to assume that an activity is addressed to at least one person. |
[]
|
cc
|
list[str]
|
Array of actors this activity or object is carbon copied to. |
[]
|
published
|
datetime | None
|
Moment of this activity or object being published |
None
|
attributed_to
|
str | None
|
id of the actor that authored this object |
None
|
content
|
str | None
|
The content of the object |
None
|
attachment
|
list[dict[str, Any]]
|
A list of objects that are attached to the original object |
[]
|
url
|
list[dict[str, Any]]
|
A list of urls that expand on the content of the object |
[]
|
sensitive
|
bool | None
|
Marks the object as sensitive. Currently, used by everyone, a better way would be an element of the tag list that labels the object as sensitive due a reason |
None
|