semvec/pypi-packages huggingface dataset:
django-tckn-field 0.0.3
A Django app built to integrate Republic of Turkey Identification Number to your project.
License: MIT
Requires Python: >=3.4

# Django TCKN Field

A Django app built to integrate Republic of Turkey Identification Number to your project.

## Installation

```bash
pip install django-tckn-field
```

## Quick Start

```python
from tckn.fields import TCKNField

class MyModel(models.Model):
    tckn_field = TCKNField()
```

## How Numbers Are Validated

TCKNField inherits CharField, so it must be a string. Identification numbers are created by following these rules:

- The number must be 11 characters long
- The number mustn't start with 0
- The tenth character is created with this formula:

<a href="https://www.codecogs.com/eqnedit.php?latex=(((N_1&space;&plus;&space;N_3&space;&plus;&space;N_5&space;&plus;&space;N_7&space;&plus;&space;N_9)&space;*&space;7)&space;-&space;(N_2&space;&plus;&space;N_4&space;&plus;&space;N_6&space;&plus;&space;N_8))&space;(mod&space;10)" target="_blank"><img src="https://latex.codecogs.com/gif.latex?(((N_1&space;&plus;&space;N_3&space;&plus;&space;N_5&space;&plus;&space;N_7&space;&plus;&space;N_9)&space;*&space;7)&space;-&space;(N_2&space;&plus;&space;N_4&space;&plus;&space;N_6&space;&plus;&space;N_8))&space;(mod&space;10)" title="(((N_1 + N_3 + N_5 + N_7 + N_9) * 7) - (N_2 + N_4 + N_6 + N_8)) (mod 10)" /></a>

- The eleventh character is created with this formula:

<a href="https://www.codecogs.com/eqnedit.php?latex=(N_1&space;&plus;&space;N_2&space;&plus;&space;N_3&space;&plus;&space;N_4&space;&plus;&space;N_5&space;&plus;&space;N_6&space;&plus;&space;N_7&space;&plus;&space;N_8&space;&plus;&space;N_9)&space;(mod&space;10)" target="_blank"><img src="https://latex.codecogs.com/gif.latex?(N_1&space;&plus;&space;N_2&space;&plus;&space;N_3&space;&plus;&space;N_4&space;&plus;&space;N_5&space;&plus;&space;N_6&space;&plus;&space;N_7&space;&plus;&space;N_8&space;&plus;&space;N_9)&space;(mod&space;10)" title="(N_1 + N_2 + N_3 + N_4 + N_5 + N_6 + N_7 + N_8 + N_9) (mod 10)" /></a>

## License

You can use this program under the terms of MIT License. See LICENSE for details.
Execution-Time 1.1.0
package which provides you with a decorator to measure execution time of functions
License: MIT

# Execution-Time

[![Build Status](https://travis-ci.org/siddhant-curious/Execution-Time.svg?branch=master)](https://travis-ci.org/siddhant-curious/Execution-Time)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/siddhant-curious/Execution-Time/blob/master/LICENSE)

This is a tiny python package which provides you with a decorator to measure execution time (in ms) of functions. 

## Installation

You should be able to install using `pip` in the usual ways:

```sh
$ pip install Execution-Time
```

Or just clone this repository and run:

```sh
$ python3 setup.py install
```

Or place the `execution_time` folder that you downloaded somewhere where it can be accessed by your scripts.

## Basic Usage

Import the class `ExecutionTime`, instantiate it and `@obj.timeit` decorater becomes available. 

```python
from execution_time import ExecutionTime
e = ExecutionTime()

@e.timeit
def foo(arg1):
  do_something(arg1) 
  return 

@e.timeit
def bar():
  hello_world()
  return

foo("dragons")
bar()
bar()
bar()
print(e.logtime_data)

## {'foo': {'times_called': 1, 'total_time': 0.0745, 'average_time': 0.0745}, 'bar': {'times_called': 3, 'total_time': 0.2054, 'average_time': 0.0685}}

```
`logtime_data` is a dictionary which contains the data in `methodname:time took in ms` format. 

## Additonal Features

1. Auto-Decorate all functions in a script. 

This is a shortcut if you want to auto-deocreate all function. To do so, pass the `__name__` attribute to the class instantiation as: 

```python
from execution_time import ExecutionTime

def foo():
  do_something()
  return 

def bar():
  hi()

e = ExecutionTime(module_name=__name__)

foo()
bar()

print(e.logdata_time)
```
Note: The class instantiation must be done after functions have been defined and before they are called. This does limit where this feature can be used and the decorator approach is recommeneded in those scenarios. 

2. Provide console logs. 

```python
e = ExecutionTime(console=True)
```

Output the log time in console as: `2019-07-06 22:07:55,157 [INFO ]  Time take by method : foo is 0.12000000000012001 ms`

## Issues

You can report the bugs at the [issue tracker](https://github.com/siddhant-curious/Execution-Time/issues)

## License

Built with ♥ by Siddhant Chhabra([@siddhant-curious](https://github.com/siddhant-curious)) under [MIT License](https://github.com/siddhant-curious/Execution-Time/blob/master/LICENSE)

You can find a copy of the License at <https://github.com/siddhant-curious/Execution-Time/blob/master/LICENSE>