brazilian_ids.functions.labor_dispute package¶
Submodules¶
brazilian_ids.functions.labor_dispute.nupj module¶
Functions to handle Numeração Única de Processo Judicial identifier.
This number is a standard created by the “Conselho Nacional de Justiça” (CNJ).
The name of this module is an acronym for the “Numeração Única de Processo Judicial”, and the name of parameters in the functions of this module as well.
References:
- class brazilian_ids.functions.labor_dispute.nupj.Court(id, acronym, description)¶
Bases:
object- Parameters:
id (str)
acronym (str)
description (str)
- property acronym¶
- property description¶
- property id¶
- class brazilian_ids.functions.labor_dispute.nupj.Courts¶
Bases:
objectClass factory to build court instances based on rules.
Although all digits from a NUPJ are strings, for segment an integer is expected instead, since this data type is shorter in bytes and well suited for the context.
- classmethod court(segment_id, court_id)¶
- Parameters:
segment_id (int)
court_id (str)
- Return type:
- classmethod court_acronym(segment_id, court_id)¶
Return a court acronym, based on segment and court ID.
- Parameters:
segment_id (int)
court_id (str)
- Return type:
str
- classmethod segment(id)¶
- Parameters:
id (int)
- Return type:
str
- classmethod total_courts()¶
- Return type:
int
- exception brazilian_ids.functions.labor_dispute.nupj.InvalidCourtIdError(court_id)¶
Bases:
ValueError- Parameters:
court_id (int)
- Return type:
None
- exception brazilian_ids.functions.labor_dispute.nupj.InvalidNupjError(nupj)¶
Bases:
InvalidNupjTypeMixin,InvalidIdErrorException for invalid NUPJ errors
- Parameters:
nupj (str)
- Return type:
None
- class brazilian_ids.functions.labor_dispute.nupj.InvalidNupjTypeMixin¶
Bases:
objectMixin class for NUPJ errors.
- id_type()¶
- exception brazilian_ids.functions.labor_dispute.nupj.InvalidSegmentIdError(segment_id)¶
Bases:
ValueError- Parameters:
segment_id (int)
- Return type:
None
- class brazilian_ids.functions.labor_dispute.nupj.NUPJ(lawsuit_id, first_digit, second_digit, year, segment, court_id, lawsuit_city)¶
Bases:
objectClass representing the fields of a NUPJ as instance attributes.
Usually you will use the function
parsefrom this package to get a instance.- Parameters:
lawsuit_id (str)
first_digit (int)
second_digit (int)
year (int)
segment (int)
court_id (str)
lawsuit_city (str)
- court_id: str¶
- digits()¶
- Return type:
str
- first_digit: int¶
- lawsuit_city: str¶
- lawsuit_id: str¶
- second_digit: int¶
- segment: int¶
- year: int¶
- brazilian_ids.functions.labor_dispute.nupj.is_valid(nupj)¶
Determine is a given NUPJ is valid or not.
It is a known issue that the justice segments “Tribunal Superior do Trabalho”, “Tribunal Superior Eleitoral” and “Superior Tribunal Militar” don’t have a documented ID!
That means there is no way to associate the proper court ID with the justice segment in the NUPJ, and in those cases where every check fails but the court ID is “90”, this function will continue checking other aspects instead of returning
False.- Parameters:
nupj (str)
- Return type:
bool
- brazilian_ids.functions.labor_dispute.nupj.pad(nupj)¶
Pad a NUPJ with zeros, if it’s length is less than
EXPECTED_DIGITS.- Parameters:
nupj (str)
- Return type:
str