Skip to main content


Generating Youtube Keywords Tag Using Python

In this tutorial I will show you how I generate youtube keywords using probability and random result from a given string.

This may not be the ultimate amazing script but it can do some what close to what I need.

Example... Suppose I want to generate keywords for youtube tags something like using this string...

"Mixed Vegetable Salami Flambé Vodka Sauté"

taken from a youtube video https://www.youtube.com/watch?v=eDuqrtM9FZE

Once I have all the mixed and matched keywords generated I can later remove the duplicate ones using excel file.

And check which keywords would be stronger using tubebuddy or some other source.

Lets just stick to python for now....

Here is the script


>>> import random
>>> def suffle(text):
 x = text.split()
 for i in x:
  if len(x) >= len(x):
   print(' '.join(random.sample(x,len(x))))
   print(' '.join(random.sample(x,4)))
   print(' ' .join(random.sample(x,3)))
   print(' ' .join(random.sample(x,2)))
   print(' ' .join(random.sample(x,1)))



So what I did was I split the text from a single string. and using for i loop i reparated them using random.sample and len(x) will count how many individual words we have in a string.

>>> suffle("Mixed Vegetable Salami Flambé Vodka Sauté")
Sauté Vodka Mixed Flambé Salami Vegetable
Mixed Flambé Vegetable Salami
Vegetable Vodka Salami
Flambé Vegetable
Vegetable
Salami Flambé Mixed Vegetable Vodka Sauté
Vegetable Sauté Flambé Vodka
Vegetable Vodka Sauté
Sauté Vodka
Salami
Mixed Salami Vodka Flambé Sauté Vegetable
Flambé Mixed Salami Vodka
Vodka Flambé Sauté
Vodka Sauté
Salami
Vodka Mixed Sauté Salami Flambé Vegetable
Mixed Vodka Sauté Vegetable
Vodka Sauté Vegetable
Mixed Vegetable
Salami
Flambé Vegetable Salami Mixed Vodka Sauté
Salami Vegetable Sauté Flambé
Flambé Sauté Mixed
Mixed Salami
Sauté
Vodka Sauté Flambé Mixed Vegetable Salami
Flambé Vegetable Vodka Sauté
Mixed Vodka Flambé
Vodka Flambé
Mixed



Now I can just copy them to a excel file and remove the duplicate and later start my process of finding the stronger keywords etc.

Hope this Idea of mine would help you too in your projects or something.
Or given you another idea to do something interesting.
If you have anything in mind and like to share do comment below.
Till then.

Enjoy Coding!!!


🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Top 11 Essential Python Tips and Tricks

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram