### PSV Output Example with Different Data Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_PH.md This example demonstrates the PSV output with different generated data, showcasing the variety of content that can be produced by the `psv` method. ```text "ID"|"Name"|"Address"|"Favorite Color" "1"|"Robert Giles"|"B09 L09 10th Road, Mabolo Estates Phase 1, Valenzuela, 1356 Metro Manila"|"black" "2"|"Melissa Myers"|"31st Floor Wolfe Condominiums 1, 2593 44th Road, Bulalacao, 4294 Palawan"|"gray" "3"|"John Ortiz"|"5103 Neptune Extension, Palali Village Phase 1, Pagudpud, 4887 Batanes"|"purple" "4"|"Kimberly Taylor"|"Block 20 Lot 37 Neptune Road, Baldwin Subdivision, Merida, 7330 Agusan del Norte"|"silver" "5"|"George Allen"|"Block 02 Lot 52 Pluto Street, Martin Cove Phase 5, Carmen, 6614 Southern Leyte"|"white" "6"|"Nicole Henson"|"Block 02 Lot 54 Dunn Cove Phase 3, Morales Road Extension, Lapu-Lapu, 1863 Cavite"|"black" "7"|"April Carson"|"3121 Franklin Drive, Labangan, 2996 Camarines Sur"|"maroon" "8"|"Thomas Burton"|"B09 L18 Venus Street, Cresta Estates 5, Caloocan, 0486 Metro Manila"|"black" "9"|"David Edwards"|"689 Taurus Street, Juno Subdivision 6, San Isidro, 2580 Cavite"|"teal" "10"|"Alexa Hernandez"|"B11 L80 Williams Estates Phase 3, Chico Drive Extension, San Pascual, 2381 Kalinga"|"maroon" ``` -------------------------------- ### PSV Output Example with Different Data and Fields Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_PH.md This example shows PSV output with different generated data, including variations in addresses and colors, demonstrating the flexibility of the `psv` method. ```text "ID"|"Name"|"Address"|"Favorite Color" "1"|"David Williams"|"1162 Onyx Street, Kamias Estates, Binidayan, 4147 Pangasinan"|"lime" "2"|"Robert Burnett"|"8155 Arayat Drive, Mandaluyong, 0741 Metro Manila"|"gray" "3"|"Renee Frey"|"3245 Hydra Avenue, Caloocan, 0600 Metro Manila"|"teal" "4"|"Donna Mora"|"Room 824 Hinton Place, 9589 56th Drive, Buguey, 7261 Zamboanga Sibugay"|"aqua" "5"|"Alyssa Fox"|"6521H Emerald Road, El Nido, 5799 Bohol"|"navy" "6"|"Isaiah Wilcox"|"7994 73rd Extension, Rosas Village, Pasay, 1420 Metro Manila"|"lime" "7"|"Shelly Daniels"|"5575 Mercury Street, Arteche, 9650 Camiguin"|"aqua" "8"|"Richard Kirby"|"2nd Floor Black Apartments, 1088 17th Avenue, Alfonso, 4958 Palawan"|"purple" "9"|"Rebecca Melton"|"Block 17 Lot 65 Berry Village 2, Polaris Street, Don Carlos, 3036 Romblon"|"white" "10"|"Samantha Olson"|"B01 L85 Yang Drive, Coconut Cove Phase 8, Inabanga, 8640 Zamboanga del Norte"|"teal" ``` -------------------------------- ### Install Faker Source: https://github.com/joke2k/faker/blob/master/README.rst Install the Faker package using pip. This is the first step to using Faker in your project. ```bash pip install Faker ``` -------------------------------- ### PSV Output Example with Different Data and Fields Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_PH.md This example showcases PSV output with a different set of generated data, illustrating the variety of names, addresses, and colors that can be produced. ```text "ID"|"Name"|"Address"|"Favorite Color" "1"|"James Martin"|"910-F Olson Boulevard, Sumilao, 7334 Surigao del Norte"|"yellow" "2"|"William Jenkins"|"Block 02 Lot 13 Tabayoc Boulevard, George Estates 6, Boljoon, 4717 Sorsogon"|"gray" "3"|"James Frank"|"9997 Saturn Road, Lipa, 4514 Benguet"|"gray" "4"|"Elizabeth Sweeney"|"Block 24 Lot 88 Stone Street, Johnson Subdivision, Obando, 9021 Zamboanga del Norte"|"navy" "5"|"Richard Jones"|"7966 Agate Street, Marikina, 0870 Metro Manila"|"maroon" "6"|"Stacey Burton"|"6884 Cucumber Street, Simmons Subdivision 2, Boliney, 3552 Bataan"|"maroon" "7"|"Christopher Blevins"|"Block 01 Lot 64 Jade Avenue, Martinez Cove, Lubuagan, 8824 Compostela Valley"|"black" "8"|"Crystal Diaz"|"3356 A Capricorn Street, Kayapa, 3361 Albay"|"white" "9"|"Shannon Lopez"|"Block 05 Lot 04 Cox Village, Jasper Street, Pasay, 0776 Metro Manila"|"silver" "10"|"Ashley Carpenter MD"|"8329 F 31st Street, Katipunan, 9025 Lanao del Sur"|"gray" ``` -------------------------------- ### Example Zip Archive Output Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_PH.md This is an example of the byte output generated by the zip() method. It represents a compressed zip file. ```bytes b'PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae\\i\xa8d\x8bg\x00\x00\x00%\x00\x00\x00\x15\x00\x00\x00bMhfKFIkfzeySZLifSLv1BZh91AY&SY\xdc\x1a\xd9\xb0\x00\x00\x02\xff\xfc\xc4\x10$\x00\x00!@\x08A\xa1\x00@\x81\x08\x00\x08\x8a\x02 \x02\x02\x00\x0c\x11\xa0@\x80\x90 \x00#\r\x0c\x86FG\xa8\xc4h\xf54\xfdHa\x82`L\x044d\xd3\x0b\x10if\xa5\xb9\x0e \xc6\xb4\xa5\x19\x14:\x89\xfcs?@\x13p\xa5?\x17rE8P\x90\xdc\x1a\xd9\xb0PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae\\\x0bMl_j\x00\x00\x00&\x00\x00\x00\x15\x00\x00\x00ZePhnjgImPOXOZCbruYv2BZh91AY&SY\xd0,\x9b\x8c\x00\x00\x05{\xff\x98\x00\xc2\x80\x02@\x00\x18 \xc8#\x00\x04\x80%`\x10\x00\x00H \x12\x00\x00\xc2\x00\x01@\x00\x01 \x00#\x03@\xd1\xa0\xd3F\x9e\x93\xd4\xd3\xc2\x86\x18&\x04\xc0CFM0\x81W\xb8F\x019\xbf7\x88m%\xf4\x87\xa9G\xb3\xb1\x04\xd1\x0c\x98\xaa\xbf\x8b\xb9"\x9c(Hh\x16M\xc6\x00PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae\\W\x1f\t\xd3Y\x00\x00\x00\x1f\x00\x00\x00\x15\x00\x00\x00OasyULMHULGVNaTjMvui3BZh91AY&SYh>\xf2\x07\x00\x00\x0b_w\xa0\x08@\x00\x10\x02\x00\x01 \x11\x00\x82h\x00 \x10$\x00H\x08\x00\xe0\x08\x02\x00\x08\xa0\x00#\x18\x0056\x80i\xa8Q\xa1\xa0\x00\x00\x1bjD\x9e\xf0\x13\xe8\x00\xdb\x1b\x01\x974Z\x86\xf8Fg\xf8\xbb\x92)\xc2\x84\x83A\xf7\x908PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xff\x9a\xa4\xb80\x00\x00\x00\x05\x00\x00\x00\x15\x00\x00\x00oIvbbCXoQbJuBCBCMUEP4BZh91AY&SYQ\xb0\xcc\xc4\x00\x00\x01\x91*\x10\x00\x00\x08\x00\x02\x01\x00\x00\x04 \x000\xcd\x00\xc1\xa0lqw$S\x85\t\x05\x1b\x0c\xcc@PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\ccg\xdd\xf5:\x00\x00\x00\n\x00\x00\x00\x15\x00\x00\x00liFGZzRSZzXnrBPlcVnQ5BZh91AY&SY\r\xbbG-\x00\x00\x03\xf50\x80\x02\x01\x00@\x00\x10\x90\x08\x00\x00\x02\x00\x01\x00\x10 \x001\x000 \x18\x9aQ(\xaem\xf8\xbb\x92)\xc2\x84\x80m\xda9hPK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xe4\x8d\x08VF\x00\x00\x00\x13\x00\x00\x00\x15\x00\x00\x00yDcGDDesgytrTGfIZsOI6BZh91AY&SY\xbe\x00\xee)\x00\x00\x05\x95G\x84\x01\x01\x10\x10"\x00`@\x00\x82*\x00\x01\x00D \x00"\x9a2\x0c\x13j\x14\xd3#\x13\x13\x13\x9b\xc7^\x1e\x18f\x9adz\x87\xc5\xdc\x91N\x14$/\x80;\x8a@PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\x00\xc5V9J\x00\x00\x00\x10\x00\x00\x00\x15\x00\x00\x00qpQriYKPzfExqeqosLgt7BZh91AY&SY9P\xfa\x18\x00\x00\x06{\xf4\xc0\x00\x00\x10\x00@\x01\x00!\x00\xc0\x00\x00\x08\x04\x00\x00\x11\x00\x90 \x00\x08\x00 \x00"\x13C&\xd46\x850\x00M?\xa9\x1c\x9e\xc1\x1e\xa2h\xd8\xbb\x92)\xc2\x84\x81\xca\x87\xd0\xc0PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\x9a\xf0:\xc1,\x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00MuzhhVhgvUoDfSURuixn8BZh91AY&SY\xe9\xbc5\x99\x00\x00\x00\x02D\x000\x02\x00\x00\x01 \x00!\x9ah3M\x0c\xbc]\xc9\x14\xe1BC\xa6\xf0\xd6dPK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\~$0%. \x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00VQeHQNJxURrwPpQhjlmg9BZh91AY&SYq\xf0R\xe6\x00\x00\x01\x88\x8a\x10\x00\x08\x00\x00@\x00\x01 \x00!\x9ah3M\x17<]\xc9\x14\xe1BA\xc7\xc1K\x98PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\x8fw6\x12. \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00ggmCISEHzAIopGGjkCRq10BZh91AY&SY)\x11\xedq\x00\x00\x00\xa8\x05\x00@\x00@@\x00\x00 \x00!\x9ah3M\x0c\xbc]\xc9\x14\xe1B@\xa4G\xb5\xc4PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xcd\x06\x9b\xac. \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00TqPlrzBMbMPaDahTcVIN11BZh91AY&SYD\xe0\x0b\r\x00\x00\x00\x82\x8c\x00\x10\x02\x00\x00@\x04\x00 \x00!\x9ah3M\x17<]\xc9\x14\xe1BA\x13\x80,4PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\x8aN\xc6\x94, \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00ZXGZUkLFlaxahkEgVONT12BZh91AY&SY\xc8\xbe\xdef\x00\x00\x00\x80\x12\x80@\x88\x00\x00\x08 \x00!\x9ah3M\x13<]\xc9\x14\xe1BC"\xfby\x98PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\x1c4\x137, \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00QApPrIWZNWaRLNuMRWJV13BZh91AY&SY\xa1\x1f\xc1\xe0\x00\x00\x01\x83\x00\x80\x800\x00\x04\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BB\x84\x7f\x07\x80PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xc4\xdd_\xcd* \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00eWAAEjzzmYgWAKZPLTEh14BZh91AY&SY\xcb\xed\x82\xc0\x00\x00\x01\x08\x08(\x00\x00\x88 \x00!\x9ah3M\x07<]\xc9\x14\xe1BC/\xb6\x0b\x00PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xf2(v\xb0. \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00tgDBFNDFevZMjLjJoJiZ15BZh91AY&SY\x8a\xc7\xe6\x90\x00\x00\x01X\x04\x02\x00\x00\x01\x08\x00\x00\x10 \x00!\x9ah3M\x17<]\xc9\x14\xe1BB+\x1f\x9a@PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\d?\x97\xf7. \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00drUPWErzzmTdrYDXaQGS16BZh91AY&SY\xd2\xeby\xf8\x00\x00\x01\x90E\x10\x00\x00\x08\x00\x80\x00@ \x00!\x9ah3M\x17<]\xc9\x14\xe1BCK\xad\xe7\xe0PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xc6)\x81\xe3, \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00ybSQxfPppiPaqiPpjEQe17BZh91AY&SY-d \x9f\x00\x00\x00\x84\x12\t\x00\x00\x02\x00\x80 \x00!\x9ah3M0\xbc]\xc9\x14\xe1B@\xb5\x90\x82|PK\x03\x04.\x00\x00\x00\x0c\x00\x88K\xae(\\xfa\x14\xe1\x1a. \x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00JDZiemkZLRXbSrsnVMXq18BZh91AY&SY\xff\xe0\x1bb\x00\x00\x01@\x82\x80\x80\x10\x00\x00\x02\x10\x00 ' ``` -------------------------------- ### Python Docstring with Examples Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md Illustrates the structure of a Python docstring with embedded examples using the :examples: directive. Ensure all :sample: lines are collected at the end of the docstring. ```python def foo(): """Summary line Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor faucibus condimentum. Duis posuere lacinia porta. Quisque mauris nisl, mattis sed ornare eget, accumsan sit amet mauris. :examples: >>> Faker.seed(0) >>> for _ in range(5): ... fake.foo() ... 1 1 1 1 1 >>> Faker.seed(1000) >>> for _ in range(10): ... fake.foo() ... 1 1 1 1 1 1 1 1 1 1 """ pass ``` -------------------------------- ### PSV Output Example with Header and Row IDs Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_PH.md This is an example of the PSV output generated when `include_row_ids` is set to `True` and a custom header is provided. Each row is prefixed with an ID and fields are separated by pipe symbols. ```text "ID"|"Name"|"Address"|"Favorite Color" "1"|"Norma Fisher"|"7962 Hibok-Hibok Street, Antares Grove, Prosperidad, 2420 Kalinga"|"green" "2"|"Lisa King"|"Room 605 Molave Tower, 1650 Opal Drive, Tingloy, 8237 Sarangani"|"lime" "3"|"Joseph Brown"|"1529 Planet Street, Villareal, 7004 Sultan Kudarat"|"lime" "4"|"Felicia Cross"|"3131 Camia Drive, Calinog, 6812 Siquijor"|"maroon" "5"|"Francisco Romero"|"4939 Chico Street, San Nicolas, 8762 Zamboanga Sibugay"|"white" "6"|"Tracey Morrison"|"B20 L50 Sunstone Drive, Lopez Estates Phase 1, Tagbilaran, 4539 Ilocos Sur"|"lime" "7"|"Michael Anderson"|"1315 Virgo Road Extension, Saint Bernard, 2978 Rizal"|"fuchsia" "8"|"Daniel Shelton"|"Block 15 Lot 64 Neptune Avenue, Tucker Homes 4, Guinayangan, 7066 Tawi-Tawi"|"olive" "9"|"Daniel Norton"|"1649 90th Drive, Shariff Saydona Mustapha, 4447 Romblon"|"silver" "10"|"Alyssa Reid"|"1962 Atok Expressway, Johnson Cove, Del Carmen, 2607 Benguet"|"lime" ``` -------------------------------- ### Generate Start Digits for Phone Numbers (Python) Source: https://github.com/joke2k/faker/blob/master/docs/locales/az_AZ.md Generates a single starting digit for Azerbaijani phone numbers. This is often used in conjunction with other phone number generation methods. Ensure Faker is installed and the az_AZ locale is loaded. ```python >>> Faker.seed(0) >>> for _ in range(5): ... fake.start_digit() ... ``` -------------------------------- ### Docstring with Multiple :sample: Lines Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md An example of a Python docstring containing multiple ':sample:' lines, demonstrating how the system processes them. Malformed lines are discarded, and valid ones are used for generating examples. ```python # Source code docstring def foo(): """Summary line Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor faucibus condimentum. :sample: Duis posuere lacinia porta. Quisque mauris nisl, mattis sed ornare eget, accumsan sit amet mauris. :sample size=10 seed=1000: """ return 1 ``` -------------------------------- ### start_digit Source: https://github.com/joke2k/faker/blob/master/docs/locales/az_AZ.md Generates the starting digit for an Azerbaijani phone number. ```APIDOC ## start_digit() ### Description Generates the starting digit for an Azerbaijani phone number. ### Method `start_digit()` ### Parameters None ### Response - **return** (str) - The starting digit. ### Request Example ```python fake.start_digit() ``` ### Response Example ``` '8' ``` ``` -------------------------------- ### Generate EAN Barcode with Multiple Prefixes (Python) Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_CA.md Generates an EAN barcode that can start with any of the provided prefixes. This example uses ('45', '49'). ```python from faker import Faker fake = Faker() Faker.seed(0) for _ in range(5): print(fake.ean(prefixes=('45', '49'))) ``` -------------------------------- ### Basic :sample: Usage Example Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md Demonstrates the default behavior of the :sample: pseudo-role when no size, seed, or kwargs are specified. It generates 5 sample outputs using a default seed of 0. ```python >>> Faker.seed(0) >>> for _ in range(5): ... fake.method1() ... # Output 1 # Output 2 # Output 3 # Output 4 # Output 5 ``` -------------------------------- ### Generate EAN Barcode with Prefixes (Python) Source: https://github.com/joke2k/faker/blob/master/docs/locales/en_CA.md Generates an EAN barcode starting with specified prefixes. This example shows usage with a single prefix ('00'). ```python from faker import Faker fake = Faker() Faker.seed(0) for _ in range(5): print(fake.ean(prefixes=('00', ))) ``` -------------------------------- ### Generate Date Between Two Dates Source: https://github.com/joke2k/faker/blob/master/docs/locales/ar_DZ.md Get a random date between two specified dates. Defaults to the UNIX epoch for the start date and the current date/time for the end date. ```python >>> Faker.seed(0) >>> for _ in range(5): ... fake.date_between_dates() ... datetime.date(2026, 5, 14) datetime.date(2026, 5, 14) datetime.date(2026, 5, 14) datetime.date(2026, 5, 14) datetime.date(2026, 5, 14) ``` -------------------------------- ### Generate a zip archive with custom parameters Source: https://github.com/joke2k/faker/blob/master/docs/locales/fil_PH.md This example demonstrates generating a zip archive with specific `uncompressed_size`, `num_files`, `min_file_size`, and `compression` type. Ensure Faker is seeded for reproducible results. ```python >>> Faker.seed(0) >>> for _ in range(5): ... fake.zip(uncompressed_size=256, num_files=32, min_file_size=4, compression='bz2') ... ``` ```python b'PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae\\g#\x1c\xdc\xa4\x00\x00\x00S\x00\x00\x00\x15\x00\x00\x00RNvnAvOpyEVAoNGnVZQU1BZh91AY&SY\xb9;q\x1c\x00\x00\x08\xff\xff\xc0\xc0H\x00\xca3\x98\x88\x90T\x00\x81\xe0A`\\\x02\x16\x0e\x1098\x03\x01\x02D\x01\x11\x1b\x00,4 \x00T`\x98\x83&CA\x88h\r4\x1902\x86i\xa4\xf2d1\x06\x99\x19\x1a4i\x82h\xc8\xf5\x03h\xd0dOQ\xea1\xa41r\x01\xe79\xfa\x9c\xfbY_\xc3\x16Y\xaa\r\'\xfc-\x03|P\x03\xd9"\x8a\x13\x18\xa3\x0c\xb5\x13\xce$\\xce\x10\xdbm_\x84\x02\x10\x13\x84?OY\xf9\xe0\x1d\x19\x047.9HSZ\xf7S\x18\xf7\x8b\xb9"\x9c(H\\\x9d\xb8\x8e\x00PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae\\\xe3\x16p\xa63\x00\x00\x00\x07\x00\x00\x00\x15\x00\x00\x00SlQGWFdgjRgeRgFkYLyL2BZh91AY&SY\x91t\x99\xe9\x00\x00\x00X\xc2\x00\x08\x0c\x00\x08\x00 \x00\x02\x00\x00 \x00"\x03e\x08`4\x11|]\xc9\x14\xe1BBE\xd2g\xa4PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae\\\xce\xb1p\xb9k\x00\x00\x00*\x00\x00\x00\x15\x00\x00\x00HsjAcfZksMRViIYdJRrn3BZh91AY&SY\x1d"\xce\x8d\x00\x00\x12w\xff\xc1\x00@\x80\x00`\n\x01$ \x10\x00\x10\x10@\x00\x88\x01\x80\x08\x05\x80!\x02%\x00\x16\x10!\x00 \x00#\x01\xa0\x00i\xe5\x03jz\x9bj\x86\x18&\x04\xc0CFM0u\x97\xc1\x0e4vD\xecW\x03{\\xd2\xaf\tO\x90\x90eT\x11\xcd\x83\x01\'\x1f\x8b\xb9"\x9c(H\x0e\x91gF\x80PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae\\W\xc7$\x8a4\x00\x00\x00\n\x00\x00\x00\x15\x00\x00\x00dKxUVFacqRcQYvCYYRga4BZh91AY&SY\xef\xae\x0bX\x00\x00\x04\xc90 \x80\x10\x04"\x02\x00\x10 \x00 \x001\x06LA\x03L&F\x11A\xcf\x17rE8P\x90\xef\xae\x0bXPK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\f9\x8d0\x00\x00\x00\x05\x00\x00\x00\x15\x00\x00\x00oYfSueoxPSgBHsToacJD5BZh91AY&SY\xf0\x17\x17\x12\x00\x00\x00 \x0b\x82\x00\x00\x01\x00\x01\x00\x10\x00\x02 \x00!\x83A\x9a\tpqw$S\x85\t\x0f\x01qq PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\92\xddA\xdb0\x00\x00\x00\x05\x00\x00\x00\x15\x00\x00\x00TjtphorteObohEsZgfLW6BZh91AY&SY\xb6\xce\xa9\x04\x00\x00\x00\x924\x04\x00\x00\x08\x00\x10\x00@\x00\x01 \x00!\x83A\x9a\t\xa8qw$S\x85\t\x0bl\xea\x90@PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\xba\x1b]T.\x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00pfDzrPQggzbrJiiDPZeQ7BZh91AY&SYy\xcf\x8a\x94\x00\x00\x01`\x84\x04\x00\x00\x00\xa0\x00\x02\x00 \x00!\x9ah3M\x17<]\xc9\x14\xe1BA\xe7>* PPK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\04t\xb4\x91.\x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00fCpVOLlelZEijfQSbBNk8BZh91AY&SY(\x27$\x8d\x00\x00\x01\xa1D\x02\x00\x00\x10\x08\x00\x00\x08 \x00!\x9ah3M\x0c\xbc]\xc9\x14\xe1B@\xa0\x9c\x924PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\bb\x81J0*\x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00ZPGfxsRfFzDHwBJURZHT9BZh91AY&SYy\xadb\xa8\x00\x00\x00@\x10\x04\x00\x14\x01 \x00!\x9ah3M2\xbc]\xc9\x14\xe1BA\xe6\xb5\x8a\xa0PK\x03\x04.\x00\x00\x00\x0c\x00\x8cK\xae(\\' ``` -------------------------------- ### date_between_dates(date_start: date | datetime | timedelta | str | int | None = None, date_end: date | datetime | timedelta | str | int | None = None) → date Source: https://github.com/joke2k/faker/blob/master/docs/locales/ar_EG.md Get a random date between two given dates, with optional start and end dates. ```APIDOC ## date_between_dates(date_start: date | datetime | timedelta | str | int | None = None, date_end: date | datetime | timedelta | str | int | None = None) -> date ### Description Get a random date between the two given dates. If no dates are provided, it defaults to the UNIX epoch and the current date and time. ### Method `date_between_dates(date_start: date | datetime | timedelta | str | int | None = None, date_end: date | datetime | timedelta | str | int | None = None)` ### Parameters #### Query Parameters - **date_start** (date | datetime | timedelta | str | int | None) - Optional - A `DateParseType`. Defaults to the UNIX epoch. - **date_end** (date | datetime | timedelta | str | int | None) - Optional - A `DateParseType`. Defaults to the current date and time. ### Response #### Success Response (200) - **date** (date) - A Date object representing a random date within the specified range. ### Request Example ```python from faker import Faker fake = Faker() print(fake.date_between_dates()) ``` ### Response Example ```json { "date": "2026-05-14" } ``` ``` -------------------------------- ### Faker Command-Line Interface Examples Source: https://context7.com/joke2k/faker/llms.txt Illustrates various ways to use the Faker command-line interface for generating single values, localized output, repeated values, profiles, and custom providers. Output can also be redirected to files. ```bash # Single fake value $ faker name # 'Ryan Gallagher' ``` ```bash # Localised output $ faker -l de_DE address # Samira-Niemeier-Allee 56 # 94812 Biedenkopf ``` ```bash # Repeat N times with separator $ faker -r 3 -s ";" name # Willam Kertzmann; # Josiah Maggio; # Gayla Schmitt; ``` ```bash # Profile with selected fields $ faker profile ssn,birthdate # {'ssn': '628-10-1085', 'birthdate': '2008-03-29'} ``` ```bash # Custom provider via import path $ faker -i faker_credit_score credit_score_full ``` ```bash # Redirect to file $ faker -r 1000 -l en_US name -o names.txt ``` ```bash # Generate documentation for all providers $ python -m faker > docs.txt $ python -m faker --lang=de_DE > docs_de.txt ``` -------------------------------- ### Customizing Sample Size and Arguments with :sample: Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md Shows how to customize the number of samples generated and pass specific arguments to the provider method using the :sample: pseudo-role. This example requests 10 samples and passes arguments 'a=1', 'b=2', 'c=3'. ```python >>> Faker.seed(0) >>> for _ in range(10): ... fake.method1(a=1, b=2, c=3) ... # Output 1 # Output 2 # Output 3 # Output 4 # Output 5 # Output 6 # Output 7 # Output 8 # Output 9 # Output 10 ``` -------------------------------- ### Generate PSV data with Faker in Python Source: https://github.com/joke2k/faker/blob/master/docs/locales/tl_PH.md Uses Faker's psv() method to create pipe-separated values with custom headers and data columns. The example shows fake names, addresses, and colors with sequential row IDs. Requires Faker library installation. ```python Faker.seed(0) for _ in range(5): fake.psv(header=('Name', 'Address', 'Favorite Color'), data_columns=('{{name}}', '{{address}}', '{{safe_color_name}}'), num_rows=10, include_row_ids=True) ``` -------------------------------- ### Generate a zip archive with default parameters Source: https://github.com/joke2k/faker/blob/master/docs/locales/fil_PH.md This example shows how to generate a zip archive using the default parameters of the zip() method. The output is a bytes object representing the zip file. ```python b'PK\x03\x04\x14\x00\x00\x00\x00\x00\x8cK\xae\\OH\xa6[\x88\x00\x00\x00\x88\x00\x00\x00\x15\x00\x00\x00DyHKewLhhibhzUGoPJPV1\x86Q\xaf\xa9J\xc0\x9cx\xc1\xb1\xc7\xf1\x9c\xd1\xd02NK\x026h8\x88V\xc0+\x12\x05;\xb9\xf6\xa27\xe7\xbc\x81\xf9uQ\'V\rU\xd1j\xe0\xcf\x87\nD\xc6W\xe1\x1b\xc0,\xcf\xabw\xe9\x14\xf54\x89\xfb\xc9\xf2\x87\x5cu\xbaQ\x9aI\xe9##\xf4\xc9\xd1/\x87\xf6u8\x97H\xb80F\x1dFe\x03\x10\xcf\xfb6\xf2\xb1\xaf1\x02{t\xfe\x9f\x8cs\x04\xfd\xb5\xae.\'\x9c\xd8s\xbc\xc3Jv\x93f\xf6\xb7\x90\xc4B=\xcd\xb5\xf1u\xbf\xb7PK\x03\x04\x14\x00\x00\x00\x00\x00\x8cK\xae\\\xd0\xb4\x8e\xd42\x00\x00\x002\x00\x00\x00\x15\x00\x00\x00wsuNZTypxrmjXzftuAYY2p\xcc\x9f\xf9w\xa1\x00/\xf1\xa2\xc9t\xdc\x18\x14\xd0/\x86f\xa7[9\\\xba\x0ew\x16\x04\xc3\x02B;f)\xeee\x00\xd4"Zwt\xd4\xc3\xf3\x00\xdfk\xc3\x15PK\x03\x04\x14\x00\x00\x00\x00\x00\x8cK\xae\\p\x0c\x9d\xfe \x00\x00\x00 \x00\x00\x00\x15\x00\x00\x00GoEKRJHEeXLoKGItDIkA36\xf3?\xe5\xf0[\xe8\xadA\xd5\x82\xc1(\xabw\xe8\x7f\xb3\xf6\xd2\x0c\xe4\x03\xcf\xe4r\xdb{\x81\xf4\xf3HPK\x03\x04\x14\x00\x00\x00\x00\x00\x8cK\xae\\\xae\x8c"\xf0&\x00\x00\x00&\x00\x00\x00\x15\x00\x00\x00loHFWYBepAJXibTPNyJv4bU\xc8\x18\xad`\xa7]\xdeM\xfcm\xe1\x10|\xf9\xa2d\x00\x16\x1fD|\xe2r7\xd9\x92\xad\xfcbS\xbe\xb6\xe0\xc8\xe0\xa2PK\x01\x02\x14\x03\x14\x00\x00\x00\x00\x00\x8cK\xae\\OH\xa6[\x88\x00\x00\x00\x88\x00\x00\x00\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00\x00DyHKewLhhibhzUGoPJPVPK\x01\x02\x14\x03\x14\x00\x00\x00\x00\x00\x8cK\xae\\\xd0\xb4\x8e\xd42\x00\x00\x002\x00\x00\x00\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\xbb\x00\x00\x00wsuNZTypxrmjXzftuAYY2PK\x01\x02\x14\x03\x14\x00\x00\x00\x00\x00\x8cK\xae\\p\x0c\x9d\xfe \x00\x00\x00 \x00\x00\x00\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01 \x01\x00\x00GoEKRJHEeXLoKGItDIkA3PK\x01\x02\x14\x03\x14\x00\x00\x00\x00\x00\x8cK\xae\\\xae\x8c"\xf0&\x00\x00\x00&\x00\x00\x00\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01s\x01\x00\x00loHFWYBepAJXibTPNyJv4PK\x05\x06\x00\x00\x00\x00\x04\x00\x04\x00\x0c\x01\x00\x00\xcc\x01\x00\x00\x00\x00' ``` -------------------------------- ### Generate CSV data with Faker in Python Source: https://github.com/joke2k/faker/blob/master/docs/locales/fil_PH.md Uses Faker's csv method to generate structured CSV data with custom headers and data columns. The example includes name, address, and favorite color fields, and can include row IDs. Requires the Faker library to be installed. ```python Faker.seed(0) for _ in range(5): fake.csv(header=('Name', 'Address', 'Favorite Color'), data_columns=('{{name}}', '{{address}}', '{{safe_color_name}}'), num_rows=10, include_row_ids=True) ``` -------------------------------- ### Run Project Tests Source: https://github.com/joke2k/faker/blob/master/README.rst Execute the project's tests using the `tox` command. This is a standard way to ensure the library functions correctly. ```bash $ tox ``` -------------------------------- ### Automating Sample Usage with :sample: Pseudo-role Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md This is the basic syntax for the :sample: pseudo-role, used to automatically generate sample usage sections in documentation. It supports specifying the number of samples, an initial seed, and keyword arguments. ```default :sample[ size=SIZE][ seed=SEED]:[ KWARGS] ``` -------------------------------- ### past_datetime Source: https://github.com/joke2k/faker/blob/master/docs/locales/az_AZ.md Generates a random datetime object between a specified start date and one second ago. Supports various date formats for the start date and timezone information. ```APIDOC ## past_datetime(start_date: date | datetime | timedelta | str | int = '-30d', tzinfo: tzinfo | None = None) -> datetime ### Description Get a datetime object based on a random date between a given date and 1 second ago. ### Parameters #### Path Parameters - **start_date** (date | datetime | timedelta | str | int) - Optional - A `DateParseType`. Defaults to `"-30d"` - **tzinfo** (tzinfo | None) - Optional - timezone, instance of datetime.tzinfo subclass ### Request Example ```pycon >>> Faker.seed(0) >>> for _ in range(5): ... fake.past_datetime() ... datetime.datetime(2026, 5, 9, 17, 27, 7, 594731) datetime.datetime(2026, 5, 7, 3, 11, 44, 54467) datetime.datetime(2026, 4, 27, 0, 16, 48, 116942) datetime.datetime(2026, 4, 22, 3, 53, 18, 957843) datetime.datetime(2026, 4, 29, 17, 35, 10, 566513) ``` ### Response #### Success Response (datetime) - Returns a `datetime.datetime` object. ### Response Example ```python datetime.datetime(2026, 5, 9, 17, 27, 7, 594731) ``` ``` -------------------------------- ### Generate Provider Documentation Source: https://github.com/joke2k/faker/blob/master/README.rst Generate documentation for the default locale's providers by running the Faker module as a script. This creates a `docs.txt` file. ```bash $ python -m faker > docs.txt ``` -------------------------------- ### Generate Provider Documentation Source: https://github.com/joke2k/faker/blob/master/docs/index.md Generate documentation for Faker providers. Use the `--lang` flag to specify a locale for documentation generation. ```bash $ python -m faker > docs.txt ``` ```bash $ python -m faker --lang=de_DE > docs_de.txt ``` -------------------------------- ### Faker Command Line Interface Help Source: https://github.com/joke2k/faker/blob/master/docs/index.md Display help information for the Faker command-line interface. This shows available options for generating fake data, specifying locales, output files, and custom providers. ```console faker [-h] [--version] [-o output] [-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}] [-r REPEAT] [-s SEP] [-i package.containing.custom_provider] [fake] [fake argument [fake argument ...]] ``` -------------------------------- ### Specifying Seed for Reproducible Output with :sample: Source: https://github.com/joke2k/faker/blob/master/docs/writing-docs.md Illustrates how to use the 'seed' parameter within the :sample: pseudo-role to ensure reproducible output. This example uses seed 12345 and argument 'a=2' to generate 5 samples. ```python >>> Faker.seed(12345) >>> for _ in range(5): ... fake.method1(a=2) ... # Output 1 # Output 2 # Output 3 # Output 4 # Output 5 ``` -------------------------------- ### Generate Dates Between Custom Start and Default End - Python Source: https://github.com/joke2k/faker/blob/master/docs/locales/hu_HU.md Generates a random Date object between a specified start date (e.g., one week ago) and today. Useful for recent historical data. ```python >>> Faker.seed(0) >>> for _ in range(5): ... fake.date_between(start_date='-1w') ... datetime.date(2026, 5, 12) datetime.date(2026, 5, 12) datetime.date(2026, 5, 9) datetime.date(2026, 5, 8) datetime.date(2026, 5, 10) ```