Ingestors

Configure ingestors to fetch content into the website.

Ingestors are used to fetch content from other sources and pull them into the website. They can be configured to run periodically (such as every 5 minutes, every hour, or daily) and can also respond in response to a webhook from an external source.

Most ingestors know how to check for content that has been updated since they last ran. This makes them efficient to run frequently.

Ingestor Adapters

Each ingestor is configured with an adapter which determines how the ingestor works, and depends on what remote system it is connecting to.

Each adapter has different settings which controls its behaviour.

IndigoAdapter

The IndigoAdapter fetches content from an Indigo API for a specific place.

Setting
Description
Example

token

API token for calling the Indigo API. Required.

abc1232

api_url

URL of the Indigo API. Must NOT end in a slash. Required.

https://example.com/v3

places

Space-separated list of place codes to fetch documents for. Use wildcards to fetch all localities in a place. Required.

bw za-* za-gp

add_topics

Space-separated list of topic slugs to add to the imported documents. Optional.

economy

include_doctypes

Space-separated list of FRBR document types to include when importing. Optional.

act doc

exclude_doctypes

Space-separated list of FRBR document types to exclude when importing. Optional.

act doc

include_subtypes

Space-separated list of FRBR document subtypes to include when importing. Optional.

by-law book

exclude_subtypes

Space-separated list of FRBR document subtypes to exclude when importing. Optional.

by-law book

include_actors

Space-separated list of FRBR actors to include when importing. Optional.

parliament

exclude_actors

Space-separated list of FRBR actors to exclude when importing. Optional.

parliament

IndigoTopicAdapter

The IndigoTopicAdapter fetches content from an Indigo API that is tagged with a particular taxonomy topic.

Uses the same settings as the IndigoAdapter, as well as:

Setting
Description
Example

topics

Space-separated list of topic slugs to fetch documents for. Required.

collections taxonomy-economy

GazetteAPIAdapter

The GazetteAPIAdapter fetches gazettes using the Peachjam Gazettes API.

Setting
Description
Example

api_url

URL of the API. Must not end in a slash. Required.

https://example.com/api

token

API authentication token. Required.

abc123

jurisdiction

Space-separated list of jurisdictions to fetch gazettes for. Use a wildcard to fetch all localities in a jurisdiction. Optional.

bw za-* za-gp

JudgmentAdapter

The JudgmentAdapter fetches Judgments using the Peachjam Judgments API.

Setting
Description
Example

api_url

URL of the API. Must not end in a slash. Required.

https://example.com/api

token

API authentication token. Required.

abc123

court_code

Code of the court to fetch judgments for. Required.

ZACC

registry_code

Code of the registry to fetch judgments for. Optional.

filters

Space-separated list of key=value pairs to filter the judgments on. Optional.

jurisdiction=za title__icontains=Test

JudgmentDeleteAdapter

The JudgmentDeleteAdapter compares the local collection of judgments (matching its filter settings) to the remote server, and deletes any that the remote server doesn't know about.

This adapter accepts the same settings as the JudgmentAdapter.

RatificationsAdapter

The RatificationsAdapter fetches ratification information from AfricanLII.org.

Ratification information is only collected for works that exist on the local website.

Setting
Description
Example

api_url

URL of the API. Must not end in a slash. Required.

https://example.com/api

token

API authentication token. Required.

abc123

include_countries

Space-separated two-letter country codes for countries to include. Optional.

za bw

exclude_countries

Space-separated two-letter country codes for countries to exclude. Optional.

za bw

GitbookAdapter

The GitbookAdapter fetches Markdown content from a GitHub repo that has been authored using GitBook. It expects the content to match GitBook's file layout and use of Markdown.

The repo can contain multiple documents and the adapter will import all of them, configured by a peachjam.yaml file at the root of the repository, using the format:

documents:
- title: Document 1
  expression_frbr_uri: /akn/za/doc/book/2020/example/eng@2020-01-01
  path: example
Setting
Description
Example

repo_name

Name of the GitHub repo. Required.

laws-africa/books

access_token

GitHub access token for authentication. Required.

gh-xxx-aaa

Last updated