0
# Specialized Data Providers
1
2
Additional providers for specific domains including development data, scientific data, file information, and transportation data for specialized testing scenarios.
3
4
## Capabilities
5
6
### Development and Software
7
8
```python { .api }
9
class Development(BaseProvider):
10
def programming_language(self) -> str:
11
"""Generate programming language name."""
12
13
def software_license(self) -> str:
14
"""Generate software license name."""
15
16
def version(self) -> str:
17
"""Generate version string like '1.2.3'."""
18
19
def boolean(self) -> bool:
20
"""Generate boolean value."""
21
22
class Code(BaseProvider):
23
def locale_code(self) -> str:
24
"""Generate locale code like 'en-US'."""
25
26
def issn(self) -> str:
27
"""Generate ISSN number."""
28
29
def ean(self, fmt: EANFormat = EANFormat.EAN13) -> str:
30
"""Generate EAN barcode."""
31
32
def imei(self) -> str:
33
"""Generate IMEI number."""
34
35
def pin(self, mask: str = "####") -> str:
36
"""Generate PIN code."""
37
```
38
39
### Scientific Data
40
41
```python { .api }
42
class Science(BaseProvider):
43
def dna_sequence(self, length: int = 10) -> str:
44
"""Generate DNA sequence."""
45
46
def rna_sequence(self, length: int = 10) -> str:
47
"""Generate RNA sequence."""
48
49
class Numeric(BaseProvider):
50
def integer_number(self, start: int = -1000, end: int = 1000) -> int:
51
"""Generate integer in range."""
52
53
def integers(self, start: int = 0, end: int = 10, n: int = 10) -> list[int]:
54
"""Generate list of integers."""
55
56
def decimal_number(self, start: float = -1000.0, end: float = 1000.0) -> Decimal:
57
"""Generate decimal number."""
58
59
def increment(self, accumulator: int = None) -> int:
60
"""Generate incrementing numbers."""
61
```
62
63
### File and System Data
64
65
```python { .api }
66
class File(BaseProvider):
67
def extension(self) -> str:
68
"""Generate file extension like '.txt'."""
69
70
def mime_type(self) -> str:
71
"""Generate MIME type."""
72
73
def file_name(self) -> str:
74
"""Generate filename with extension."""
75
76
def size(self, minimum: int = 1, maximum: int = 100) -> int:
77
"""Generate file size in MB."""
78
79
class BinaryFile(BaseProvider):
80
def image(self) -> bytes:
81
"""Generate binary image data."""
82
83
def video(self) -> bytes:
84
"""Generate binary video data."""
85
86
def audio(self) -> bytes:
87
"""Generate binary audio data."""
88
89
def document(self) -> bytes:
90
"""Generate binary document data."""
91
92
def compressed(self) -> bytes:
93
"""Generate binary compressed file data."""
94
95
class Path(BaseProvider):
96
def root(self) -> str:
97
"""Generate root path."""
98
99
def home(self) -> str:
100
"""Generate home directory path."""
101
102
def user(self) -> str:
103
"""Generate user directory path."""
104
105
def project_dir(self) -> str:
106
"""Generate project directory path."""
107
```
108
109
### Food and Hardware
110
111
```python { .api }
112
class Food(BaseDataProvider):
113
def vegetable(self) -> str:
114
"""Generate vegetable name."""
115
116
def fruit(self) -> str:
117
"""Generate fruit name."""
118
119
def dish(self) -> str:
120
"""Generate dish name."""
121
122
def spices(self) -> str:
123
"""Generate spice name."""
124
125
def drink(self) -> str:
126
"""Generate drink name."""
127
128
class Hardware(BaseProvider):
129
def resolution(self) -> str:
130
"""Generate screen resolution."""
131
132
def cpu(self) -> str:
133
"""Generate CPU name."""
134
135
def ram_type(self) -> str:
136
"""Generate RAM type."""
137
138
def graphics(self) -> str:
139
"""Generate graphics card name."""
140
141
def manufacturer(self) -> str:
142
"""Generate hardware manufacturer."""
143
```
144
145
### Transportation and Cryptographic
146
147
```python { .api }
148
class Transport(BaseDataProvider):
149
def manufacturer(self) -> str:
150
"""Generate vehicle manufacturer."""
151
152
def car(self) -> str:
153
"""Generate car model."""
154
155
def airplane(self) -> str:
156
"""Generate airplane model."""
157
158
def vehicle_registration_code(self) -> str:
159
"""Generate vehicle registration."""
160
161
class Cryptographic(BaseProvider):
162
def uuid(self) -> str:
163
"""Generate UUID string."""
164
165
def hash(self, algorithm: Algorithm = Algorithm.MD5) -> str:
166
"""Generate hash string."""
167
168
def mnemonic_phrase(self, length: int = 12) -> str:
169
"""Generate mnemonic phrase."""
170
171
class Payment(BaseDataProvider):
172
def credit_card_number(self, card_type: CardType = None) -> str:
173
"""Generate credit card number."""
174
175
def credit_card_network(self) -> str:
176
"""Generate credit card network name."""
177
178
def credit_card_owner(self) -> dict:
179
"""Generate credit card owner info."""
180
181
def paypal(self) -> str:
182
"""Generate PayPal email."""
183
184
class Choice(BaseProvider):
185
def choice(self, *args, **kwargs) -> Any:
186
"""Make random choice from arguments."""
187
```
188
189
## Usage Examples
190
191
```python
192
from mimesis import Development, Science, Hardware, Cryptographic
193
from mimesis.enums import Algorithm, CardType
194
195
# Development data
196
dev = Development()
197
project_data = {
198
'language': dev.programming_language(),
199
'license': dev.software_license(),
200
'version': dev.version(),
201
'feature_flag': dev.boolean()
202
}
203
204
# Scientific data
205
science = Science()
206
bio_data = {
207
'dna': science.dna_sequence(length=20),
208
'rna': science.rna_sequence(length=15)
209
}
210
211
# Hardware specs
212
hardware = Hardware()
213
system_specs = {
214
'cpu': hardware.cpu(),
215
'resolution': hardware.resolution(),
216
'manufacturer': hardware.manufacturer()
217
}
218
219
# Cryptographic data
220
crypto = Cryptographic()
221
security_data = {
222
'uuid': crypto.uuid(),
223
'md5_hash': crypto.hash(Algorithm.MD5),
224
'mnemonic': crypto.mnemonic_phrase(length=24)
225
}
226
```