Skip to content

Instantly share code, notes, and snippets.

@moonblade
Last active October 20, 2019 11:29
Show Gist options
  • Save moonblade/abf8052670a8db49386e486fcbec7182 to your computer and use it in GitHub Desktop.
Save moonblade/abf8052670a8db49386e486fcbec7182 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
from lorem.text import TextLorem
import random
import time
from datetime import datetime
def genDate():
d = random.randint(1, int(time.time()))
return datetime.fromtimestamp(d).strftime('%d-%m-%Y')
testCases = 1
minDates = 1
maxDates = 10
minSeperation = 1
maxSeperation = 10
gen=TextLorem(srange=(minSeperation, maxSeperation))
for x in range(testCases):
dates = random.randint(minDates, maxDates)
string = []
if random.random() > .5:
string.append(gen.sentence())
for y in range(dates):
if string:
string.append( gen.sentence())
string.append( genDate())
if random.random() > .5:
string.append(gen.sentence())
print(' '.join(string), dates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment