Edit on GitHub

ecourts.entities.fir

 1from dataclasses import dataclass
 2from datetime import datetime
 3from typing import Optional
 4
 5
 6@dataclass
 7class FIR:
 8    state: str
 9    """The state where the FIR was filed."""
10
11    district: str
12    """The district where the FIR was filed."""
13
14    police_station: str
15    """The police station where the FIR was filed."""
16
17    number: str
18    """The FIR number."""
19
20    year: int
21    """The year the FIR was filed."""
22
23    def __post_init__(self):
24        if isinstance(self.year, str) and len(self.year) == 4:
25            self.year = int(self.year)
26        if not isinstance(self.year, int):
27            self.year = None
@dataclass
class FIR:
 7@dataclass
 8class FIR:
 9    state: str
10    """The state where the FIR was filed."""
11
12    district: str
13    """The district where the FIR was filed."""
14
15    police_station: str
16    """The police station where the FIR was filed."""
17
18    number: str
19    """The FIR number."""
20
21    year: int
22    """The year the FIR was filed."""
23
24    def __post_init__(self):
25        if isinstance(self.year, str) and len(self.year) == 4:
26            self.year = int(self.year)
27        if not isinstance(self.year, int):
28            self.year = None
FIR( state: str, district: str, police_station: str, number: str, year: int)
state: str

The state where the FIR was filed.

district: str

The district where the FIR was filed.

police_station: str

The police station where the FIR was filed.

number: str

The FIR number.

year: int

The year the FIR was filed.