fakedata-python 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ from . import data, fun, anime, animals
@@ -0,0 +1,19 @@
1
+ import random
2
+ from ..core import load_data
3
+
4
+ # Load datasets
5
+ animal_data = load_data('animal.json')
6
+ cat_fact_data = load_data('catfact.json')
7
+ dog_fact_data = load_data('dogfact.json')
8
+
9
+ def get_random(arr):
10
+ return random.choice(arr)
11
+
12
+ def random_animal():
13
+ return {"animal": get_random(animal_data['animals'])}
14
+
15
+ def cat_fact():
16
+ return {"fact": get_random(cat_fact_data['facts'])}
17
+
18
+ def dog_fact():
19
+ return {"fact": get_random(dog_fact_data['facts'])}
@@ -0,0 +1,37 @@
1
+ import random
2
+ from ..core import load_data
3
+
4
+ # Load datasets
5
+ quote_data = load_data('animequote.json')
6
+ fact_data = load_data('animefact.json')
7
+
8
+ def get_random(arr):
9
+ return random.choice(arr)
10
+
11
+ def quote():
12
+ item = get_random(quote_data['quotes'])
13
+ return {
14
+ "anime": item['anime'],
15
+ "quote": item['bruh'],
16
+ "character": item['character'],
17
+ "id": item.get('id')
18
+ }
19
+
20
+ def quotes_by_show(anime_name):
21
+ filtered = [q for q in quote_data['quotes'] if anime_name.lower() in q['anime'].lower()]
22
+ if not filtered:
23
+ return {"error": "No quotes found for this anime"}
24
+ item = get_random(filtered)
25
+ return {
26
+ "anime": item['anime'],
27
+ "quote": item['bruh'],
28
+ "character": item['character'],
29
+ "id": item.get('id')
30
+ }
31
+
32
+ def fact():
33
+ item = get_random(fact_data['facts'])
34
+ return {
35
+ "question": item['question'],
36
+ "answers": item['answers']
37
+ }
@@ -0,0 +1,179 @@
1
+ import random
2
+ import string
3
+ from ..core import load_data
4
+
5
+ # Load datasets
6
+ card_data = load_data('cardtype.json')
7
+ occupation_data = load_data('occupation.json')
8
+ domain_data = load_data('domain.json')
9
+ first_names = load_data('first.json')
10
+ middle_names = load_data('middle.json')
11
+ last_names = load_data('last.json')
12
+ emails = load_data('email.json')
13
+ street_data = load_data('street.json')
14
+ state_data = load_data('states.json')
15
+ state_codes = load_data('shortformstate.json')
16
+
17
+ def get_random(arr):
18
+ return random.choice(arr)
19
+
20
+ def generate_single_user(id_index=None):
21
+ first_name = get_random(first_names['names'])
22
+ middle_name = get_random(middle_names['father'])
23
+ last_name = get_random(last_names['surnames'])
24
+ email_provider = get_random(emails['mails'])
25
+ card_type = get_random(card_data['cards'])
26
+ occupation = get_random(occupation_data['occupations'])
27
+ domain = get_random(domain_data['domains'])
28
+ street = get_random(street_data['addresses'])
29
+ state = get_random(state_data['data'])
30
+
31
+ user_id = id_index if id_index is not None else random.randint(1, 1000)
32
+ age = random.randint(18, 38)
33
+ card_number = random.randint(10**15, 10**16 - 1)
34
+ card_expiry = f"{random.randint(1, 12)}/{random.randint(25, 35)}"
35
+ card_cvv = random.randint(100, 999)
36
+ lat = round(random.uniform(-90, 90), 6)
37
+ lng = round(random.uniform(-180, 180), 6)
38
+ ip = ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
39
+
40
+ gender_options = ["male", "female", "not provided"]
41
+ blood_groups = ["+O", "+A", "+B", "+AB", "-O", "-A", "-B", "-AB"]
42
+ departments = ["PDT Administration", "PDT Marketing", "Transportation", "Shipping", "Human Resources", "Operations", "Inventory", "Sales", "Finance", "Documentation", "Billing", "Control And Credit"]
43
+
44
+ phone_number = "".join(random.choices(string.digits, k=10))
45
+ password = "".join(random.choices(string.ascii_letters + string.digits + "#@$", k=8))
46
+
47
+ birth_year = random.randint(1970, 2010)
48
+ birth_month = random.randint(1, 12)
49
+ birth_day = random.randint(1, 28)
50
+
51
+ return {
52
+ "id": str(user_id),
53
+ "fullName": f"{first_name} {middle_name} {last_name}",
54
+ "firstName": first_name,
55
+ "lastName": middle_name,
56
+ "middleName": last_name,
57
+ "age": str(age),
58
+ "gender": get_random(gender_options),
59
+ "email": f"{first_name.lower()}@{email_provider}",
60
+ "phone": f"+1 {phone_number}",
61
+ "username": f"{first_name.lower()}{user_id}",
62
+ "password": password,
63
+ "birthDate": f"{birth_month}/{birth_day}/{birth_year}",
64
+ "bloodGroup": get_random(blood_groups),
65
+ "height": random.randint(100, 200),
66
+ "weight": random.randint(50, 100),
67
+ "domain": f"{first_name.lower()}{last_name.lower()}{domain['tlds']}",
68
+ "ip": ip,
69
+ "macaddress": ":".join(f"{random.randint(0, 255):02X}" for _ in range(6)),
70
+ "address": {
71
+ "street": f"Street {street['address']}",
72
+ "city": state['city'],
73
+ "state": state['state'],
74
+ "country": "United States Of America",
75
+ "zipCode": random.randint(10000, 99999),
76
+ "coordinates": {"latitude": str(lat), "longitude": str(lng)}
77
+ },
78
+ "university": f"{state['city']} University",
79
+ "bank": {
80
+ "nameOnCard": f"{first_name} {middle_name} {last_name}",
81
+ "cardNumber": str(card_number),
82
+ "cardType": card_type,
83
+ "cardExpiry": card_expiry,
84
+ "cardCvv": str(card_cvv),
85
+ },
86
+ "occupation": {
87
+ "title": occupation,
88
+ "salary": f"{random.randint(5000, 50000)}$",
89
+ "department": get_random(departments),
90
+ }
91
+ }
92
+
93
+ def user():
94
+ return generate_single_user()
95
+
96
+ def users(count=10):
97
+ return [generate_single_user(i + 1) for i in range(count)]
98
+
99
+ def get_email():
100
+ fn = get_random(first_names['names'])
101
+ ln = get_random(last_names['surnames'])
102
+ domain = get_random(emails['mails'])
103
+ return {"email": f"{fn.lower()}.{ln.lower()}@{domain}"}
104
+
105
+ def get_username():
106
+ fn = get_random(first_names['names'])
107
+ user_id = random.randint(1, 1000)
108
+ return {"username": f"{fn.lower()}{user_id}"}
109
+
110
+ def get_password(length=8):
111
+ charset = string.ascii_letters + string.digits + "#@$"
112
+ return {"password": "".join(random.choices(charset, k=length))}
113
+
114
+ def get_zip_code():
115
+ return {"zipCode": random.randint(10000, 99999)}
116
+
117
+ def get_coordinates():
118
+ return {
119
+ "latitude": str(round(random.uniform(-90, 90), 6)),
120
+ "longitude": str(round(random.uniform(-180, 180), 6))
121
+ }
122
+
123
+ def get_city():
124
+ return {"city": get_random(state_data['data'])['city']}
125
+
126
+ def get_state_code():
127
+ return {"stateCode": get_random(state_codes)}
128
+
129
+ def creditcard():
130
+ u = generate_single_user()
131
+ return {
132
+ "nameOnCard": u['bank']['nameOnCard'],
133
+ "cardNumber": u['bank']['cardNumber'],
134
+ "cardType": u['bank']['cardType'],
135
+ "cardExpiry": u['bank']['cardExpiry'],
136
+ "cardCvv": u['bank']['cardCvv'],
137
+ }
138
+
139
+ def address():
140
+ u = generate_single_user()
141
+ return {
142
+ "street": u['address']['street'],
143
+ "city": u['address']['city'],
144
+ "state": u['address']['state'],
145
+ "country": u['address']['country'],
146
+ "zipCode": u['address']['zipCode'],
147
+ "ip": u['ip'],
148
+ "macaddress": u['macaddress'],
149
+ "coordinates": u['address']['coordinates']
150
+ }
151
+
152
+ def resume(count=10):
153
+ resumes = []
154
+ for i in range(count):
155
+ u = generate_single_user(i + 1)
156
+ res = u.copy()
157
+ res.update({
158
+ "education": {
159
+ "level": get_random(["Bachelor's", "Master's", "PhD"]),
160
+ "major": get_random(["Computer Science", "Business", "Marketing"]),
161
+ "university": u['university'],
162
+ "graduationYear": random.randint(2020, 2025)
163
+ },
164
+ "skills": random.sample(["JavaScript", "Node.js", "React", "Python", "Docker"], k=3)
165
+ })
166
+ resumes.append(res)
167
+ return resumes
168
+
169
+ def biodata(count=10):
170
+ biodatas = []
171
+ for i in range(count):
172
+ u = generate_single_user(i + 1)
173
+ bio = u.copy()
174
+ bio.update({
175
+ "personalityType": get_random(["INTJ", "ENFP", "ISTP"]),
176
+ "favoriteMusic": get_random(["Rock", "Jazz", "Lofi"])
177
+ })
178
+ biodatas.append(bio)
179
+ return biodatas
@@ -0,0 +1,61 @@
1
+ import random
2
+ from ..core import load_data
3
+
4
+ # Load datasets
5
+ joke_data = load_data('joke.json')
6
+ fact_data = load_data('fact.json')
7
+ fortune_data = load_data('fortune.json')
8
+ pickup_data = load_data('pickup.json')
9
+ quote_data = load_data('quote.json')
10
+ pokemon_data = load_data('pokemon.json')
11
+
12
+ def get_random(arr):
13
+ return random.choice(arr)
14
+
15
+ def joke():
16
+ item = get_random(joke_data['jokes'])
17
+ return {
18
+ "id": item['id'],
19
+ "type": item['type'],
20
+ "setup": item['setup'],
21
+ "punchline": item['punchline']
22
+ }
23
+
24
+ def jokes_by_type(joke_type):
25
+ filtered = [j for j in joke_data['jokes'] if j['type'].lower() == joke_type.lower()]
26
+ if not filtered:
27
+ return {"error": "No jokes found for this type"}
28
+ item = get_random(filtered)
29
+ return {
30
+ "id": item['id'],
31
+ "type": item['type'],
32
+ "setup": item['setup'],
33
+ "punchline": item['punchline']
34
+ }
35
+
36
+ def fact():
37
+ return {"fact": get_random(fact_data['facts'])}
38
+
39
+ def fortune():
40
+ return {"fortune": get_random(fortune_data['fortunes'])}
41
+
42
+ def pickup():
43
+ return {"pickup": get_random(pickup_data['pickups'])}
44
+
45
+ def quote():
46
+ item = get_random(quote_data['quotes'])
47
+ return {
48
+ "quote": item['quote'],
49
+ "author": item['author']
50
+ }
51
+
52
+ def pokemon():
53
+ return get_random(pokemon_data)
54
+
55
+ def pokemon_by_type(poke_type):
56
+ filtered = [p for p in pokemon_data if
57
+ p['Type 1'].lower() == poke_type.lower() or
58
+ (p.get('Type 2') and p['Type 2'].lower() == poke_type.lower())]
59
+ if not filtered:
60
+ return {"error": "No pokemon found for this type"}
61
+ return get_random(filtered)
@@ -0,0 +1,29 @@
1
+ import fakedata
2
+
3
+ def test():
4
+ print("--- Testing fakedata Python Library ---")
5
+
6
+ # Data
7
+ user = fakedata.data.user()
8
+ print(f"\n[Data] Random User: {user['fullName']} from {user['address']['city']}")
9
+
10
+ email = fakedata.data.get_email()
11
+ print(f"[Data] Random Email: {email['email']}")
12
+
13
+ # Fun
14
+ poke = fakedata.fun.pokemon()
15
+ print(f"\n[Fun] Random Pokemon: {poke['name']} ({poke['Type 1']})")
16
+
17
+ joke = fakedata.fun.joke()
18
+ print(f"[Fun] Joke: {joke['setup']} -> {joke['punchline']}")
19
+
20
+ # Anime
21
+ quote = fakedata.anime.quotes_by_show("Naruto")
22
+ print(f"\n[Anime] Naruto Quote: {quote['quote']} - {quote['character']}")
23
+
24
+ # Animals
25
+ animal = fakedata.animals.random_animal()
26
+ print(f"\n[Animals] Random Animal: {animal['animal']}")
27
+
28
+ if __name__ == "__main__":
29
+ test()
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: fakedata-python
3
+ Version: 1.0.0
4
+ Summary: A versatile mock data and entertainment content generator ported to Python.
5
+ Author-email: abhay557 <abhaycormourya@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/abhay557/fakedata
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.7
11
+ Description-Content-Type: text/markdown
12
+
13
+ # fakedata (Python)
14
+
15
+ [![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/)
16
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
17
+
18
+ A high-performance, **zero-dependency** mock data generation engine ported to Python. Designed for testing, prototyping, and local development.
19
+
20
+ Whether you're building a backend prototype, seeding a database with thousands of records, or developing complex data-driven tests, `fakedata` provides a structured API for generating high-quality synthetic data across multiple domains.
21
+
22
+ ---
23
+
24
+ ## Key Features
25
+
26
+ - **Zero External Dependencies**: Uses only Python standard libraries (`json`, `random`, `pathlib`).
27
+ - **Modular Architecture**: Separate namespaces for data, entertainment, anime, and biology.
28
+ - **Rich Datasets**: Bundled with comprehensive JSON assets (Pokemon, Users, Industry-standard resumes).
29
+ - **Type Hinting**: Built-in support for IDE intellisense.
30
+ - **Fast Execution**: Optimized for generating large datasets with minimal overhead.
31
+
32
+ ---
33
+
34
+ ## Installation
35
+
36
+ Install the package locally:
37
+
38
+ ```bash
39
+ pip install .
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ import fakedata
48
+
49
+ # 1. Generate a comprehensive user profile
50
+ user_profile = fakedata.data.user()
51
+ print(f"Identity: {user_profile['fullName']} | City: {user_profile['address']['city']}")
52
+
53
+ # 2. Fetch specialized entertainment data
54
+ pokemon = fakedata.fun.pokemon()
55
+ random_joke = fakedata.fun.joke()
56
+
57
+ # 3. Filter specific anime content
58
+ naruto_quotes = fakedata.anime.quotes_by_show('Naruto')
59
+ ```
60
+
61
+ ---
62
+
63
+ ## API Documentation
64
+
65
+ ### Data Module (`fakedata.data`)
66
+ Focused on professional-grade mock data for PII and enterprise simulations.
67
+
68
+ | Method | Return Type | Description |
69
+ | :--- | :--- | :--- |
70
+ | `user()` | `dict` | Generates a full profile (Personal Details, Address, Job, Bank Info). |
71
+ | `users(count)` | `list` | Returns a list of `n` unique user profiles. |
72
+ | `creditcard()` | `dict` | Generates realistic credit card data (Number, Expiry, CVV). |
73
+ | `resume(count)` | `list` | Mock professional resumes with skills, experience, and education. |
74
+ | `get_password(len)`| `dict` | Secure random password generator (default length: 8). |
75
+ | `get_email()` | `dict` | Randomly generated email address. |
76
+ | `get_city()` | `dict` | Global city name. |
77
+
78
+ ### Fun (`fakedata.fun`)
79
+ Dynamic content for gaming and entertainment applications.
80
+
81
+ | Method | Return Type | Description |
82
+ | :--- | :--- | :--- |
83
+ | `pokemon()` | `dict` | Returns a random Pokemon with full stats, types, and abilities. |
84
+ | `pokemon_by_type(t)`| `dict` | Filters Pokemon by specific type (e.g., 'Fire', 'Water'). |
85
+ | `joke()` | `dict` | Randomly selected joke across various categories. |
86
+ | `fact()` | `dict` | General knowledge facts for engagement. |
87
+ | `fortune()` | `dict` | Philosophical or funny fortune cookies. |
88
+
89
+ ### Anime Module (`fakedata.anime`)
90
+ Curated datasets for anime-themed projects.
91
+
92
+ | Method | Return Type | Description |
93
+ | :--- | :--- | :--- |
94
+ | `quote()` | `dict` | Iconic quotes with character and show attribution. |
95
+ | `quotes_by_show(s)` | `dict` | All available quotes from a specific anime title. |
96
+ | `fact()` | `dict` | Specialized trivia regarding anime history and trivia. |
97
+
98
+ ### Animals Module (`fakedata.animals`)
99
+ Simple biological data and interesting facts.
100
+
101
+ | Method | Return Type | Description |
102
+ | :--- | :--- | :--- |
103
+ | `random_animal()` | `dict` | Returns a random animal profile. |
104
+ | `dog_fact()` | `dict` | Canine-specific trivia and biological facts. |
105
+ | `cat_fact()` | `dict` | Feline-specific trivia and statistics. |
106
+
107
+ ---
108
+
109
+ ## Testing
110
+
111
+ To run the local test suite:
112
+
113
+ ```bash
114
+ python test_python.py
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Development & Contributions
120
+
121
+ Contributions are welcome! If you'd like to add new datasets or modules, please follow these steps:
122
+
123
+ 1. Clone the repository.
124
+ 2. Implement your changes in `fakedata/modules/`.
125
+ 3. Add relevant tests in `tests/`.
126
+ 4. Submit a Pull Request.
127
+
128
+ ---
129
+
130
+ ## License
131
+
132
+ Distributed under the **MIT License**. See `LICENSE` for more information.
133
+
134
+ **Maintainer**: [abhay557](https://github.com/abhay557)
@@ -0,0 +1,34 @@
1
+ fakedata/__init__.py,sha256=GFurGog7LOBtwWDYPrn8_AyqTXya1IYjoKzn5tJ18ls,141
2
+ fakedata/core.py,sha256=ZiZ51aZ3cAG7n02Giliq0XO5nN-bbjLJWM3pZQ6gWT4,437
3
+ fakedata/test_python.py,sha256=BSdlxcxWcnbi6kvcIlJtFy-0kEeWBGG5k3VvhrjBJME,844
4
+ fakedata/helpers/animal.json,sha256=7z8dnJSwb_ixoO4F-8fpdn-Gtq36ikCXbZL-anBSTIg,3195
5
+ fakedata/helpers/animefact.json,sha256=AsGid27uaYAq_VcpmZp8Oa98hJyPhys1pAekVTjy1Ow,36415
6
+ fakedata/helpers/animequote.json,sha256=vpDmqJeh3e0mkth3wFrJbY6yEEu35SXZdx2MAw4-MOU,12598
7
+ fakedata/helpers/cardtype.json,sha256=3Ij5N_QPCO1Xg6g7jTp759yOVF9scXkbBDZvWYRaSAM,201
8
+ fakedata/helpers/catfact.json,sha256=bYWRuDbTtXc7wjlR8285G_81kfwXGZI7pdujzSTdDHU,11544
9
+ fakedata/helpers/dogfact.json,sha256=Ao8zQPQ8G4NM3-iwZLoJF8_JjjDhPXcEa99Jszi33ng,48214
10
+ fakedata/helpers/domain.json,sha256=Kqz2wCDQuS7riNLuHGbmD9HGHOJuZMkPAaqx3hqy79k,21872
11
+ fakedata/helpers/email.json,sha256=kXfbmFneGY9vk44WVw73n901sRYibJdjP3RPW0y4Njw,80112
12
+ fakedata/helpers/fact.json,sha256=usHomD8FpiYRQ_WZXnQwyfAnREa6V6PUTTO7eUv9vRM,194240
13
+ fakedata/helpers/first.json,sha256=058xM59Rf9VAx5XkO75YkLY_4f-jpdiEvMrCpxvU3AQ,69794
14
+ fakedata/helpers/fortune.json,sha256=_CDLFnKyanIhxvF0syA6Xhtkl97mMT6zYadPCrjjUs8,21910
15
+ fakedata/helpers/joke.json,sha256=gZt4ynrHP76AWQta5LE4wihTWv5twSRqzgw8KmbWYxw,60303
16
+ fakedata/helpers/last.json,sha256=XBuwhR9q8HhZIOU5g7krw_v2QWYuc25trz_mynEK4HA,160641
17
+ fakedata/helpers/middle.json,sha256=BaK8pl2u9F4vi1-f1rz97lEbi63jhCBg8wgda1hNdGU,53909
18
+ fakedata/helpers/occupation.json,sha256=u77eARP0LZI2MVDSmamaGEuQ3mHgfyqwarO3gBmKCBw,22839
19
+ fakedata/helpers/pickup.json,sha256=dCwjbHZtWw50hjfYlgrHJ38WWlyYq8ksiVlh61MlvkY,1199310
20
+ fakedata/helpers/pokemon.json,sha256=DIN_k_rk9tcfhUHCLSrFs9Y74YOI84HcdTcNca54u6k,209543
21
+ fakedata/helpers/quote.json,sha256=53Xb2Ejk3mR9HEv3rU4mgi-E7_7gAYLYG325IPm2Hlc,712463
22
+ fakedata/helpers/shortformstate.json,sha256=47bqJ12TlEXuauuzr6WKfuXZg0UQEodPPRpyeEH6oK0,506
23
+ fakedata/helpers/state.json,sha256=VAqX6qbWnuSrQwtGSYCrmBrrYxEbGHP0CKHnRO7wijg,842
24
+ fakedata/helpers/states.json,sha256=1NLVCllDcRN8QXp3GTv9iiqeqA8rOOlx2v3_w729jfU,448609
25
+ fakedata/helpers/street.json,sha256=Z-1cRr7uGMXBqlPoqoedPagfx_hLXqbWDNoylcnS8L0,305724
26
+ fakedata/modules/__init__.py,sha256=Mjf8ME6kYjIsrnBKCH3SViF0CpSIkrr5qTZ6Tfr_PbU,40
27
+ fakedata/modules/animals.py,sha256=_TTFa_wQtLdiQONl3MNk5G1dKykXXfCLnv0CMfFFCw4,461
28
+ fakedata/modules/anime.py,sha256=guxfE3sJUNXurBIPAjn6sB-I0RC3YQOF6i8hvisqbvc,939
29
+ fakedata/modules/data.py,sha256=6XrjaOudvfZRskb1wASMCsTemYNcv4bj7shRmhCckoE,6390
30
+ fakedata/modules/fun.py,sha256=0piWxBDHWFOVwJA6gcKqG0c89oy6N4_yV353-OAnTWY,1656
31
+ fakedata_python-1.0.0.dist-info/METADATA,sha256=IO8rpJWrljZrLcwQdqd2jnI-TNpPi3Lndk-FfdcwJIU,4694
32
+ fakedata_python-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ fakedata_python-1.0.0.dist-info/top_level.txt,sha256=SHFa_6848yAE45QgW-PX_DHp_nakY64Zs_t2NobLcn0,9
34
+ fakedata_python-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ fakedata