Importing Public Bodies

While it is possible to create public bodies individually through the admin interface, it might be more advisable to scrape a list from a website or crowdsource them with other people in a Google doc. You can then import these public bodies as a CSV file into Froide.

The format of the CSV file should be like in this Google Docs Spreadsheet. You could for example copy it and either fill in public bodies collaboratively or programmatically.


The format is quite simple.

(required) The name of the public body.
(optional) If you give no email, users will not be able to make requests to this public body. You can fill in email addresses later through the admin.
(required) Give the slug of the jurisdiction this public body belongs to.
(optional) Possible other, alternative names for the public body separated by commas.
(optional) A text description of the public body.
(optional) Slug for this public body’s topic. If not given, the public body topic with the highest rank attribute will be chosen.
(optional) Website for this public body.
(optional) if this public body has a parent, give it’s name here. The parent must be specified before in the CSV file.
(required) Give a classification (e.g. “ministry”). If you don’t want have the information, just fill in something general like “public body”.
(optional) Contact information apart from post address and email. E.g. phone or fax number. May contain line breaks.
(optional) Postal address of this public body.
(optional) Any further text that can be used to described this public body. This is used for search indexing and will not be displayed publicly.
(optional) Display this text for this public body when making a request to it.

If during import a public body with the same slug is found, it is skipped and not overwritten.

Importing through Admin

The admin interface that lists public bodies has an import form at the very bottom of the page. Give a HTTP or HTTPS url of your CSV file and press the import button. The file will be downloaded and imported. Any errors will be shown to you.

Importing via command line

The management command import_csv takes a URL or a path to a CSV file:

python import_csv public_bodies.csv --settings=froide.custom_settings