Skip to content

Commit

Permalink
- Formatting with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Nov 7, 2023
1 parent 5f7e087 commit f4bed07
Show file tree
Hide file tree
Showing 14 changed files with 5,130 additions and 1,536 deletions.
188 changes: 153 additions & 35 deletions tdrs-backend/tdpservice/parsers/schema_defs/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,162 @@
preparsing_validators=[
validators.hasLength(
23,
lambda value, length: f'Header length is {len(value)} but must be {length} characters.'
lambda value, length: f"Header length is {len(value)} but must be {length} characters.",
),
validators.startsWith('HEADER'),
validators.startsWith("HEADER"),
],
postparsing_validators=[],
fields=[
Field(item="2", name='title', type='string', startIndex=0, endIndex=6, required=True, validators=[
validators.matches('HEADER'),
]),
Field(item="4", name='year', type='number', startIndex=6, endIndex=10, required=True, validators=[
validators.isInLimits(2000, 2099)
]),
Field(item="5", name='quarter', type='string', startIndex=10, endIndex=11, required=True, validators=[
validators.oneOf(['1', '2', '3', '4'])
]),
Field(item="6", name='type', type='string', startIndex=11, endIndex=12, required=True, validators=[
validators.oneOf(['A', 'C', 'G', 'S'])
]),
Field(item="1", name='state_fips', type='string', startIndex=12, endIndex=14, required=True, validators=[
validators.oneOf(("01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", "16", "17", "18",
"19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33",
"34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49",
"50", "51", "53", "54", "55", "56", "66", "72", "78"))
]),
Field(item="3", name='tribe_code', type='string', startIndex=14, endIndex=17, required=False, validators=[
validators.isInStringRange(0, 999)
]),
Field(item="7", name='program_type', type='string', startIndex=17, endIndex=20, required=True, validators=[
validators.oneOf(['TAN', 'SSP'])
]),
Field(item="8", name='edit', type='string', startIndex=20, endIndex=21, required=True, validators=[
validators.oneOf(['1', '2'])
]),
Field(item="9", name='encryption', type='string', startIndex=21, endIndex=22, required=False, validators=[
validators.oneOf([' ', 'E'])
]),
Field(item="10", name='update', type='string', startIndex=22, endIndex=23, required=True, validators=[
validators.oneOf(['N', 'D', 'U'])
]),
Field(
item="2",
name="title",
type="string",
startIndex=0,
endIndex=6,
required=True,
validators=[
validators.matches("HEADER"),
],
),
Field(
item="4",
name="year",
type="number",
startIndex=6,
endIndex=10,
required=True,
validators=[validators.isInLimits(2000, 2099)],
),
Field(
item="5",
name="quarter",
type="string",
startIndex=10,
endIndex=11,
required=True,
validators=[validators.oneOf(["1", "2", "3", "4"])],
),
Field(
item="6",
name="type",
type="string",
startIndex=11,
endIndex=12,
required=True,
validators=[validators.oneOf(["A", "C", "G", "S"])],
),
Field(
item="1",
name="state_fips",
type="string",
startIndex=12,
endIndex=14,
required=True,
validators=[
validators.oneOf(
(
"01",
"02",
"04",
"05",
"06",
"08",
"09",
"10",
"11",
"12",
"13",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
"32",
"33",
"34",
"35",
"36",
"37",
"38",
"39",
"40",
"41",
"42",
"44",
"45",
"46",
"47",
"48",
"49",
"50",
"51",
"53",
"54",
"55",
"56",
"66",
"72",
"78",
)
)
],
),
Field(
item="3",
name="tribe_code",
type="string",
startIndex=14,
endIndex=17,
required=False,
validators=[validators.isInStringRange(0, 999)],
),
Field(
item="7",
name="program_type",
type="string",
startIndex=17,
endIndex=20,
required=True,
validators=[validators.oneOf(["TAN", "SSP"])],
),
Field(
item="8",
name="edit",
type="string",
startIndex=20,
endIndex=21,
required=True,
validators=[validators.oneOf(["1", "2"])],
),
Field(
item="9",
name="encryption",
type="string",
startIndex=21,
endIndex=22,
required=False,
validators=[validators.oneOf([" ", "E"])],
),
Field(
item="10",
name="update",
type="string",
startIndex=22,
endIndex=23,
required=True,
validators=[validators.oneOf(["N", "D", "U"])],
),
],
)
Loading

0 comments on commit f4bed07

Please sign in to comment.