forked from lk-geimfari/mimesis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05fc191
commit 2273bb5
Showing
17 changed files
with
6,445 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,8 @@ | |
'Text', | ||
'Transport', | ||
'UnitSystem', | ||
'Cryptographic', | ||
|
||
# Has all: | ||
'Generic', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from random import Random | ||
|
||
from mimesis.providers import Code | ||
|
||
|
||
class BaseSpecProvider(object): | ||
def __init__(self): | ||
self.random = Random() | ||
self.code = Code().custom_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from mimesis.utils import pull | ||
from mimesis.builtins.base import BaseSpecProvider | ||
|
||
|
||
class GermanySpecProvider(BaseSpecProvider): | ||
def __init__(self): | ||
super().__init__() | ||
self._data = pull('builtin.json', 'de') | ||
|
||
class Meta: | ||
name = 'germany_provider' | ||
|
||
def noun(self, plural=False): | ||
"""Return a random noun in German. | ||
:param plural: Return noun in plural. | ||
:return: Noun. | ||
""" | ||
|
||
key = 'plural' if \ | ||
plural else 'noun' | ||
|
||
return self.random.choice(self._data[key]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.