Mit dem Faker-Modul können Sie viele Dummy-Daten erstellen.
pip install fake-factory
Diesmal ID, 10-stellige Nummer, 10 Wörter Erstellen Sie eine CSV-Datei im Format wie.
dummy.py
from faker import Factory
import csv
with open("dummy_data.csv", "w+") as f:
csv_writer = csv.writer(f)
fake = Factory.create()
for i in range(10000):
l = [fake.md5(), fake.random_number(10)]
l.extend(fake.words(10))
csv_writer.writerow(l)
Wenn du das machst
2109993cebbf9e68b5a74344798c19a3,0,sit,corrupti,eaque,perspiciatis,voluptatum,nihil,quaerat,corporis,asperiores,aut
3728284aa04584cafaaab4118fd77e58,1470,non,qui,vitae,aperiam,ut,est,facilis,perspiciatis,dolores,adipisci
ed599579acda23e99243372106f1f2f8,0,provident,sint,quidem,unde,omnis,perferendis,sint,dolorum,rerum,qui
a117e010335d11c8e88bcd8d359d9429,434500369,enim,atque,earum,nihil,voluptatem,omnis,enim,reiciendis,qui,facilis
b2524affecebe4f67f2dccfca6b6ddf2,6590,commodi,et,maxime,laudantium,eaque,nihil,omnis,perferendis,nesciunt,beatae
aefecf6b23019fbab30947f948b26a18,477210330,doloremque,fugit,est,ut,nobis,sed,aliquam,rem,asperiores,ducimus
834df95fc9e1dff879e3f1d63c870390,36,dolores,at,et,est,id,earum,nulla,ut,autem,ut
fd9a959e399b57749fcaf1b52e0388e0,13,minus,quaerat,tenetur,cumque,rerum,molestiae,repellat,autem,voluptas,repudiandae
f08d779d34eb463d9ee2653fe7f58e59,1746570,perspiciatis,maiores,saepe,porro,quia,iusto,facilis,inventore,repellat,provident
af31877a37fff42e8f624cbe5aa2ae57,5236,odit,neque,voluptatem,facere,corrupti,incidunt,est,et,id,quo
Sie können eine CSV wie bekommen Praktisch
Die Dummy-Daten, die erstellt werden können, sehen folgendermaßen aus
fake.add_provider fake.name
fake.address fake.null_boolean
fake.am_pm fake.numerify
fake.boolean fake.opera
fake.bothify fake.paragraph
fake.bs fake.paragraphs
fake.building_number fake.parse
fake.catch_phrase fake.phone_number
fake.century fake.postcode
fake.chrome fake.prefix
fake.city fake.provider
fake.city_prefix fake.providers
fake.city_suffix fake.pybool
fake.company fake.pydecimal
fake.company_email fake.pydict
fake.company_suffix fake.pyfloat
fake.country fake.pyint
fake.country_code fake.pyiterable
fake.credit_card_expire fake.pylist
fake.credit_card_full fake.pyset
fake.credit_card_number fake.pystr
fake.credit_card_provider fake.pystruct
fake.credit_card_security_code fake.pytuple
fake.date fake.random_digit
fake.date_time fake.random_digit_not_null
fake.date_time_ad fake.random_element
fake.date_time_between fake.random_int
fake.date_time_this_century fake.random_letter
fake.date_time_this_decade fake.random_number
fake.date_time_this_month fake.randomize_nb_elements
fake.date_time_this_year fake.safari
fake.day_of_month fake.safe_email
fake.day_of_week fake.secondary_address
fake.domain_name fake.seed
fake.domain_word fake.sentence
fake.email fake.sentences
fake.firefox fake.sha1
fake.first_name fake.sha256
fake.format fake.slug
fake.free_email fake.state
fake.free_email_domain fake.state_abbr
fake.geo_coordinate fake.street_address
fake.get_formatter fake.street_name
fake.get_providers fake.street_suffix
fake.internet_explorer fake.suffix
fake.ipv4 fake.text
fake.ipv6 fake.time
fake.iso8601 fake.timezone
fake.language_code fake.tld
fake.last_name fake.unix_time
fake.latitude fake.uri
fake.lexify fake.uri_extension
fake.linux_platform_token fake.uri_page
fake.linux_processor fake.uri_path
fake.locale fake.url
fake.longitude fake.user_agent
fake.mac_platform_token fake.user_name
fake.mac_processor fake.windows_platform_token
fake.md5 fake.word
fake.mime_type fake.words
fake.month fake.year
fake.month_name
Es deckt die meisten Adressen, Namen, Creca-Nummern, Daten usw. ab.
Recommended Posts