Skip to content

Finds all published entries from a single locale where it is unlocalised. Writes result to a CSV file. Then optionally reads the CSV file and unpublishes in a separate script.

License

Notifications You must be signed in to change notification settings

Contentstack-Solutions/python-findandunpublish-published-unlocalised-entries

Repository files navigation

python-unpublish-unlocalised

This set of scripts uses both the Content Management and Content Delivery APIs from Contentstack. Functions found in cma/ and cda/ folders.

Scripts in this repository:

  1. List Published Unlocalised entries - listPublishUnlocalised.py (Finds all entries that are published from a single locale to any locale where unlocalised. Writes the result to a readable CSV file.)
  2. Unpublish all entries found in CSV - unpublishEntriesFromCSV.py (Reads the CSV file from step 1 and unpublishes all of them.)

NOT OFFICIALLY SUPPORTED BY CONTENTSTACK

Prerequisites:

  • Contentstack Account.
  • Install Python 3 (Developed using Python 3.9.1 on Macbook).
  • Install Python package:
    • pip install requests

Define environmental variables

e.g. variables.env file:

CS_REGION=NA (Either NA or EU)
CS_APIKEY=blt972.....
CS_MANAGEMENTOKEN=cs....
CS_DELIVERYTOKEN=cs....
CS_USERNAME=someone@something.com (Not needed in this project)
CS_PASSWORD=password (Not needed in this project)

export CS_REGION CS_APIKEY CS_MANAGEMENTOKEN CS_DELIVERYTOKEN CS_USERNAME CS_PASSWORD

and run source variables.env in the terminal.

About

Finds all published entries from a single locale where it is unlocalised. Writes result to a CSV file. Then optionally reads the CSV file and unpublishes in a separate script.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages