Skip to content

Instantly share code, notes, and snippets.

@refo
Created May 18, 2017 10:40
Show Gist options
  • Save refo/79da5d967b998de44eeaeac7d3c06df0 to your computer and use it in GitHub Desktop.
Save refo/79da5d967b998de44eeaeac7d3c06df0 to your computer and use it in GitHub Desktop.
Automate title to slug process.
# pip install django
# pip install clipboard
# pip install unidecode
from django.template import defaultfilters
import clipboard
from unidecode import unidecode
while True:
title = input("Input title: ")
slug = defaultfilters.slugify(unidecode(title))
print("Slug:")
print(slug)
slug = 'uri="' + slug + '"'
clipboard.copy(slug)
print("copied.")
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment