How to use the mimesis.Datetime function in mimesis

To help you get started, we’ve selected a few mimesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lk-geimfari / mimesis / tests / test_providers / test_future_datetime.py View on Github external
def test_is_subclass(self, future_dt):
        datetime_methods = [method for method in dir(Datetime)
                            if callable(getattr(Datetime, method))]
        assert len(datetime_methods) > 0
        for method in datetime_methods:
            assert method in dir(future_dt)
github lk-geimfari / mimesis / tests / test_providers / test_future_datetime.py View on Github external
def test_is_subclass(self, future_dt):
        datetime_methods = [method for method in dir(Datetime)
                            if callable(getattr(Datetime, method))]
        assert len(datetime_methods) > 0
        for method in datetime_methods:
            assert method in dir(future_dt)
github pytest-dev / pytest-mimesis / pytest_mimesis / fixtures.py View on Github external
def datetime_el(locale):
    """

    :param locale:
    :return:
    """
    return Datetime(locale)
github MGrin / transactions-graph-generator / models / Transaction.py View on Github external
from mimesis import Datetime, Numbers, Text, Business
from random import random
from numpy import random as npr
from math import ceil
from uuid import uuid4
from .Node import Node

class Transaction(Node):
	_datetime = Datetime()
	_numbers = Numbers()
	_text = Text()
	_business = Business()

	def __init__(self, sourceId, targetId):
		self.__type = 'Transaction'
		self.id = uuid4()
		self.source = sourceId
		self.target = targetId
		self.date = self._datetime.date(start=2015, end=2019)
		self.time = self._datetime.time()

		if random() < 0.05:
			self.amount = self._numbers.between(100000, 1000000)
		else:
			self.amount = npr.exponential(10)