Skip to content

command line tool

Installation

Install the package via

pip install funfedi_schema

The funfedi-schema command should then become available.

Validating an ActivityPub object

Suppose you have an ActivityPub object, e.g.

./examples/activity_pub/example2.json
{
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Note",
    "to": [
        "https://chatty.example/ben/"
    ],
    "attributedTo": "https://social.example/alyssa/",
    "content": "Say, did you finish reading that book I lent you?"
}

Then one can validate it using the command line tool using

funfedi-schema validate-activity-pub-object \
    ./examples/activity_pub/example2.json

The then generated output is

schema is invalid
'id' is a required property


schema_after_normalization is invalid
'id' is a required property


activity_streams_json_ld_compacted is invalid
[
  [
    "change",
    "to",
    [
      [
        "https://chatty.example/ben/"
      ],
      "https://chatty.example/ben/"
    ]
  ]
]

python -m funfedi_schema

Command line tool to run validation

Usage:

python -m funfedi_schema [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

schema

Commands to help handle schemas

Usage:

python -m funfedi_schema schema [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

dump

Usage:

python -m funfedi_schema schema dump [OPTIONS]

Options:

  --directory TEXT
  --help            Show this message and exit.

print

Prints the names schema

Usage:

python -m funfedi_schema schema print [OPTIONS] NAME

Options:

  --help  Show this message and exit.

validate-activity-pub-actor

Displays detailed validation of the ActivityPub actor given by file. File is supposed to be

Usage:

python -m funfedi_schema validate-activity-pub-actor [OPTIONS] FILE

Options:

  --help  Show this message and exit.

validate-activity-pub-object

Displays detailed validation of the ActivityPub object given by file. File is supposed to be

Usage:

python -m funfedi_schema validate-activity-pub-object [OPTIONS] FILE

Options:

  --help  Show this message and exit.

validate-test-data

Validates objects contained in test_data folder

Usage:

python -m funfedi_schema validate-test-data [OPTIONS] DATA_TYPE

Options:

  --help  Show this message and exit.