项目作者: myleswrite

项目描述 :
A CSV to Kirby CM content page converter
高级语言: Python
项目地址: git://github.com/myleswrite/Comma-to-Colon.git
创建时间: 2019-03-01T14:17:44Z
项目社区:https://github.com/myleswrite/Comma-to-Colon

开源协议:MIT License

下载


Comma to Colon

A Python 3 script to convert a CSV file to a folder of Kirby CMS content files.

If you’re moving from A N Other CMS to Kirby you’ve probably got to transfer the pages and blog posts from the older system. Assuming these are stored in an SQL file you can export them as CSV and run that file (after a bit of tidying up) through this script to generate a folder full of Kirby .txt content files.

How it works

  • Run the Python script.
  • Select the CSV file you wish to convert.
  • Input the .yml file name you wish to use. Each row of the csv will be turned into a name.txt file in its own folder.
  • Select where you want to save the created files and folders.
  • The first row of the CSV file is taken to be a header row for the columns. One of these headers must be ‘title’ (lower case) but the rest can be anything you like.
  • The script will create YAML files using the cells in the header row to create the categories (ie the CSV header maintext would become maintext: in the YAML file.

Python modules

Several Python modules are required for the Comma to Colon:

  • CSV — For reading and writing CSV files
  • OS — For accessing the file system
  • Tkinter — For file dialog boxes (you could rewrite the script to remove this one if you don’t want to use Tkinter)

Kirby licences

Try Kirby for free: https://getkirby.com/ then buy a licence when you realise just how great a CMS it is.

If you feel like buying me a cup of tea for writing the script, tip me here: https://www.paypal.me/mylesw42