diff --git a/edgar_tool/cli.py b/edgar_tool/cli.py index 7648a41..09df891 100644 --- a/edgar_tool/cli.py +++ b/edgar_tool/cli.py @@ -4,10 +4,9 @@ import click import typer -from dateutil.relativedelta import relativedelta from typing_extensions import Annotated -from .constants import DateRange, FilingCategory +from .constants import DateRange, FilingCategory, Location from .text_search import EdgarTextSearcher app = typer.Typer(name="edgar-tool", no_args_is_help=True) @@ -92,7 +91,7 @@ def text_search( ), ] = None, peo_in: Annotated[ - Optional[str], + Location, typer.Option( "--principal-executive-offices-in", "-peoi", @@ -106,7 +105,7 @@ def text_search( ), ] = None, inc_in: Annotated[ - Optional[str], + Location, typer.Option( "--incorporated-in", "-ii", diff --git a/edgar_tool/constants.py b/edgar_tool/constants.py index 6f7a3b1..95afc13 100644 --- a/edgar_tool/constants.py +++ b/edgar_tool/constants.py @@ -45,317 +45,634 @@ The keys are the values that the CLI uses, and the values are those that the search form uses. All values are shown in the order they appear in the SEC EDGAR search drop down.""" + + +class Location(str, enum.Enum): + # US States + ALABAMA = "AL" + ALASKA = "AK" + ARIZONA = "AZ" + ARKANSAS = "AR" + CALIFORNIA = "CA" + COLORADO = "CO" + CONNECTICUT = "CT" + DELAWARE = "DE" + DISTRICT_OF_COLUMBIA = "DC" + FLORIDA = "FL" + GEORGIA = "GA" + HAWAII = "HI" + IDAHO = "ID" + ILLINOIS = "IL" + INDIANA = "IN" + IOWA = "IA" + KANSAS = "KS" + KENTUCKY = "KY" + LOUISIANA = "LA" + MAINE = "ME" + MARYLAND = "MD" + MASSACHUSETTS = "MA" + MICHIGAN = "MI" + MINNESOTA = "MN" + MISSISSIPPI = "MS" + MISSOURI = "MO" + MONTANA = "MT" + NEBRASKA = "NE" + NEVADA = "NV" + NEW_HAMPSHIRE = "NH" + NEW_JERSEY = "NJ" + NEW_MEXICO = "NM" + NEW_YORK = "NY" + NORTH_CAROLINA = "NC" + NORTH_DAKOTA = "ND" + OHIO = "OH" + OKLAHOMA = "OK" + OREGON = "OR" + PENNSYLVANIA = "PA" + RHODE_ISLAND = "RI" + SOUTH_CAROLINA = "SC" + SOUTH_DAKOTA = "SD" + TENNESSEE = "TN" + TEXAS = "TX" + UTAH = "UT" + VERMONT = "VT" + VIRGINIA = "VA" + WASHINGTON = "WA" + WEST_VIRGINIA = "WV" + WISCONSIN = "WI" + WYOMING = "WY" + + # Canadian Provinces + ALBERTA = "AB" + BRITISH_COLUMBIA = "BC" + CANADA = "CAN" + MANITOBA = "MB" + NEW_BRUNSWICK = "NB" + NEWFOUNDLAND_AND_LABRADOR = "NL" + NOVA_SCOTIA = "NS" + ONTARIO = "ON" + PRINCE_EDWARD_ISLAND = "PE" + QUEBEC = "QC" + SASKATCHEWAN = "SK" + YUKON = "YT" + + # Countries + AFGHANISTAN = "AFG" + ALAND_ISLANDS = "ALA" + ALBANIA = "ALB" + ALGERIA = "DZA" + AMERICAN_SAMOA = "ASM" + ANDORRA = "AND" + ANGOLA = "AGO" + ANGUILLA = "AIA" + ANTARCTICA = "ATA" + ANTIGUA_AND_BARBUDA = "ATG" + ARGENTINA = "ARG" + ARMENIA = "ARM" + ARUBA = "ABW" + AUSTRALIA = "AUS" + AUSTRIA = "AUT" + AZERBAIJAN = "AZE" + BAHAMAS = "BHS" + BAHRAIN = "BHR" + BANGLADESH = "BGD" + BARBADOS = "BRB" + BELARUS = "BLR" + BELGIUM = "BEL" + BELIZE = "BLZ" + BENIN = "BEN" + BERMUDA = "BMU" + BHUTAN = "BTN" + BOLIVIA = "BOL" + BOSNIA_AND_HERZEGOVINA = "BIH" + BOTSWANA = "BWA" + BOUVET_ISLAND = "BVT" + BRAZIL = "BRA" + BRITISH_INDIAN_OCEAN_TERRITORY = "IOT" + BRUNEI_DARUSSALAM = "BRN" + BULGARIA = "BGR" + BURKINA_FASO = "BFA" + BURUNDI = "BDI" + CAMBODIA = "KHM" + CAMEROON = "CMR" + CAPE_VERDE = "CPV" + CAYMAN_ISLANDS = "CYM" + CENTRAL_AFRICAN_REPUBLIC = "CAF" + CHAD = "TCD" + CHILE = "CHL" + CHINA = "CHN" + CHRISTMAS_ISLAND = "CXR" + COCOS_KEELING_ISLANDS = "CCK" + COLOMBIA = "COL" + COMOROS = "COM" + CONGO = "COG" + CONGO_DEMOCRATIC_REPUBLIC = "COD" + COOK_ISLANDS = "COK" + COSTA_RICA = "CRI" + COTE_DIVOIRE = "CIV" + CROATIA = "HRV" + CUBA = "CUB" + CYPRUS = "CYP" + CZECH_REPUBLIC = "CZE" + DENMARK = "DNK" + DJIBOUTI = "DJI" + DOMINICA = "DMA" + DOMINICAN_REPUBLIC = "DOM" + ECUADOR = "ECU" + EGYPT = "EGY" + EL_SALVADOR = "SLV" + EQUATORIAL_GUINEA = "GNQ" + ERITREA = "ERI" + ESTONIA = "EST" + ETHIOPIA = "ETH" + FALKLAND_ISLANDS = "FLK" + FAROE_ISLANDS = "FRO" + FIJI = "FJI" + FINLAND = "FIN" + FRANCE = "FRA" + FRENCH_GUIANA = "GUF" + FRENCH_POLYNESIA = "PYF" + FRENCH_SOUTHERN_TERRITORIES = "ATF" + GABON = "GAB" + GAMBIA = "GMB" + GEORGIA_REPUBLIC = "GEO" + GERMANY = "DEU" + GHANA = "GHA" + GIBRALTAR = "GIB" + GREECE = "GRC" + GREENLAND = "GRL" + GRENADA = "GRD" + GUADELOUPE = "GLP" + GUAM = "GUM" + GUATEMALA = "GTM" + GUERNSEY = "GGY" + GUINEA = "GIN" + GUINEA_BISSAU = "GNB" + GUYANA = "GUY" + HAITI = "HTI" + HEARD_AND_MCDONALD_ISLANDS = "HMD" + HOLY_SEE_VATICAN_CITY = "VAT" + HONDURAS = "HND" + HONG_KONG = "HKG" + HUNGARY = "HUN" + ICELAND = "ISL" + INDIA = "IND" + INDONESIA = "IDN" + IRAN = "IRN" + IRAQ = "IRQ" + IRELAND = "IRL" + ISLE_OF_MAN = "IMN" + ISRAEL = "ISR" + ITALY = "ITA" + JAMAICA = "JAM" + JAPAN = "JPN" + JERSEY = "JEY" + JORDAN = "JOR" + KAZAKHSTAN = "KAZ" + KENYA = "KEN" + KIRIBATI = "KIR" + NORTH_KOREA = "PRK" + SOUTH_KOREA = "KOR" + KUWAIT = "KWT" + KYRGYZSTAN = "KGZ" + LAOS = "LAO" + LATVIA = "LVA" + LEBANON = "LBN" + LESOTHO = "LSO" + LIBERIA = "LBR" + LIBYA = "LBY" + LIECHTENSTEIN = "LIE" + LITHUANIA = "LTU" + LUXEMBOURG = "LUX" + MACAU = "MAC" + MACEDONIA = "MKD" + MADAGASCAR = "MDG" + MALAWI = "MWI" + MALAYSIA = "MYS" + MALDIVES = "MDV" + MALI = "MLI" + MALTA = "MLT" + MARSHALL_ISLANDS = "MHL" + MARTINIQUE = "MTQ" + MAURITANIA = "MRT" + MAURITIUS = "MUS" + MAYOTTE = "MYT" + MEXICO = "MEX" + MICRONESIA = "FSM" + MOLDOVA = "MDA" + MONACO = "MCO" + MONGOLIA = "MNG" + MONTENEGRO = "MNE" + MONTSERRAT = "MSR" + MOROCCO = "MAR" + MOZAMBIQUE = "MOZ" + MYANMAR = "MMR" + NAMIBIA = "NAM" + NAURU = "NRU" + NEPAL = "NPL" + NETHERLANDS = "NLD" + NETHERLANDS_ANTILLES = "ANT" + NEW_CALEDONIA = "NCL" + NEW_ZEALAND = "NZL" + NICARAGUA = "NIC" + NIGER = "NER" + NIGERIA = "NGA" + NIUE = "NIU" + NORFOLK_ISLAND = "NFK" + NORTHERN_MARIANA_ISLANDS = "MNP" + NORWAY = "NOR" + OMAN = "OMN" + PAKISTAN = "PAK" + PALAU = "PLW" + PALESTINIAN_TERRITORY = "PSE" + PANAMA = "PAN" + PAPUA_NEW_GUINEA = "PNG" + PARAGUAY = "PRY" + PERU = "PER" + PHILIPPINES = "PHL" + PITCAIRN = "PCN" + POLAND = "POL" + PORTUGAL = "PRT" + PUERTO_RICO = "PRI" + QATAR = "QAT" + REUNION = "REU" + ROMANIA = "ROU" + RUSSIAN_FEDERATION = "RUS" + RWANDA = "RWA" + SAINT_BARTHELEMY = "BLM" + SAINT_HELENA = "SHN" + SAINT_KITTS_AND_NEVIS = "KNA" + SAINT_LUCIA = "LCA" + SAINT_MARTIN = "MAF" + SAINT_PIERRE_AND_MIQUELON = "SPM" + SAINT_VINCENT_AND_GRENADINES = "VCT" + SAMOA = "WSM" + SAN_MARINO = "SMR" + SAO_TOME_AND_PRINCIPE = "STP" + SAUDI_ARABIA = "SAU" + SENEGAL = "SEN" + SERBIA = "SRB" + SEYCHELLES = "SYC" + SIERRA_LEONE = "SLE" + SINGAPORE = "SGP" + SLOVAKIA = "SVK" + SLOVENIA = "SVN" + SOLOMON_ISLANDS = "SLB" + SOMALIA = "SOM" + SOUTH_AFRICA = "ZAF" + SOUTH_GEORGIA_AND_SOUTH_SANDWICH_ISLANDS = "SGS" + SPAIN = "ESP" + SRI_LANKA = "LKA" + SUDAN = "SDN" + SURINAME = "SUR" + SVALBARD_AND_JAN_MAYEN = "SJM" + ESWATINI = "SWZ" # Formerly Swaziland + SWEDEN = "SWE" + SWITZERLAND = "CHE" + SYRIA = "SYR" + TAIWAN = "TWN" + TAJIKISTAN = "TJK" + THAILAND = "THA" + TIMOR_LESTE = "TLS" + TOGO = "TGO" + TOKELAU = "TKL" + TONGA = "TON" + TRINIDAD_AND_TOBAGO = "TTO" + TUNISIA = "TUN" + TURKEY = "TUR" + TURKMENISTAN = "TKM" + TURKS_AND_CAICOS_ISLANDS = "TCA" + TUVALU = "TUV" + UGANDA = "UGA" + UKRAINE = "UKR" + UNITED_ARAB_EMIRATES = "ARE" + UNITED_KINGDOM = "GBR" + UNITED_STATES_MINOR_OUTLYING_ISLANDS = "UMI" + URUGUAY = "URY" + UZBEKISTAN = "UZB" + VANUATU = "VUT" + VENEZUELA = "VEN" + VIETNAM = "VNM" + BRITISH_VIRGIN_ISLANDS = "VGB" + US_VIRGIN_ISLANDS = "VIR" + WALLIS_AND_FUTUNA = "WLF" + WESTERN_SAHARA = "ESH" + YEMEN = "YEM" + ZAMBIA = "ZMB" + ZIMBABWE = "ZWE" + UNKNOWN = "XX" + + PEO_IN_AND_INC_IN_TO_SEC_FORM_ID = { # US States - "AL": "AL", - "AK": "AK", - "AZ": "AZ", - "AR": "AR", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DE": "DE", - "DC": "DC", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "IA": "IA", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "ME": "ME", - "MD": "MD", - "MA": "MA", - "MI": "MI", - "MN": "MN", - "MS": "MS", - "MO": "MO", - "MT": "MT", - "NE": "NE", - "NV": "NV", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NY": "NY", - "NC": "NC", - "ND": "ND", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VT": "VT", - "VA": "VA", - "WA": "WA", - "WV": "WV", - "WI": "WI", - "WY": "WY", + Location.ALABAMA: "AL", + Location.ALASKA: "AK", + Location.ARIZONA: "AZ", + Location.ARKANSAS: "AR", + Location.CALIFORNIA: "CA", + Location.COLORADO: "CO", + Location.CONNECTICUT: "CT", + Location.DELAWARE: "DE", + Location.DISTRICT_OF_COLUMBIA: "DC", + Location.FLORIDA: "FL", + Location.GEORGIA: "GA", + Location.HAWAII: "HI", + Location.IDAHO: "ID", + Location.ILLINOIS: "IL", + Location.INDIANA: "IN", + Location.IOWA: "IA", + Location.KANSAS: "KS", + Location.KENTUCKY: "KY", + Location.LOUISIANA: "LA", + Location.MAINE: "ME", + Location.MARYLAND: "MD", + Location.MASSACHUSETTS: "MA", + Location.MICHIGAN: "MI", + Location.MINNESOTA: "MN", + Location.MISSISSIPPI: "MS", + Location.MISSOURI: "MO", + Location.MONTANA: "MT", + Location.NEBRASKA: "NE", + Location.NEVADA: "NV", + Location.NEW_HAMPSHIRE: "NH", + Location.NEW_JERSEY: "NJ", + Location.NEW_MEXICO: "NM", + Location.NEW_YORK: "NY", + Location.NORTH_CAROLINA: "NC", + Location.NORTH_DAKOTA: "ND", + Location.OHIO: "OH", + Location.OKLAHOMA: "OK", + Location.OREGON: "OR", + Location.PENNSYLVANIA: "PA", + Location.RHODE_ISLAND: "RI", + Location.SOUTH_CAROLINA: "SC", + Location.SOUTH_DAKOTA: "SD", + Location.TENNESSEE: "TN", + Location.TEXAS: "TX", + Location.UTAH: "UT", + Location.VERMONT: "VT", + Location.VIRGINIA: "VA", + Location.WASHINGTON: "WA", + Location.WEST_VIRGINIA: "WV", + Location.WISCONSIN: "WI", + Location.WYOMING: "WY", # Canadian Provinces - "AB": "A0", - "BC": "A1", - "CAN": "Z4", # Canada (Federal Level) - "MB": "A2", - "NB": "A3", - "NL": "A4", - "NS": "A5", - "ON": "A6", - "PE": "A7", - "QC": "A8", - "SK": "A9", - "YT": "B0", + Location.ALBERTA: "A0", + Location.BRITISH_COLUMBIA: "A1", + Location.CANADA: "Z4", # Canada (Federal Level) + Location.MANITOBA: "A2", + Location.NEW_BRUNSWICK: "A3", + Location.NEWFOUNDLAND_AND_LABRADOR: "A4", + Location.NOVA_SCOTIA: "A5", + Location.ONTARIO: "A6", + Location.PRINCE_EDWARD_ISLAND: "A7", + Location.QUEBEC: "A8", + Location.SASKATCHEWAN: "A9", + Location.YUKON: "B0", # Countries - "AFG": "B2", - "ALA": "Y6", - "ALB": "B3", - "DZA": "B4", - "ASM": "B5", - "AND": "B6", - "AGO": "B7", - "AIA": "1A", - "ATA": "B8", - "ATG": "B9", - "ARG": "C1", - "ARM": "1B", - "ABW": "1C", - "AUS": "C3", - "AUT": "C4", - "AZE": "1D", - "BHS": "C5", - "BHR": "C6", - "BGD": "C7", - "BRB": "C8", - "BLR": "1F", - "BEL": "C9", - "BLZ": "D1", - "BEN": "G6", - "BMU": "D0", - "BTN": "D2", - "BOL": "D3", - "BIH": "1E", - "BWA": "B1", - "BVT": "D4", - "BRA": "D5", - "IOT": "D6", - "BRN": "D9", - "BGR": "E0", - "BFA": "X2", - "BDI": "E2", - "KHM": "E3", - "CMR": "E4", - "CPV": "E8", - "CYM": "E9", - "CAF": "F0", - "TCD": "F2", - "CHL": "F3", - "CHN": "F4", - "CXR": "F6", - "CCK": "F7", - "COL": "F8", - "COM": "F9", - "COG": "G0", - "COD": "Y3", - "COK": "G1", - "CRI": "G2", - "CIV": "L7", - "HRV": "1M", - "CUB": "G3", - "CYP": "G4", - "CZE": "2N", - "DNK": "G7", - "DJI": "1G", - "DMA": "G9", - "DOM": "D8", - "ECU": "H1", - "EGY": "H2", - "SLV": "H3", - "GNQ": "H4", - "ERI": "1J", - "EST": "1H", - "ETH": "H5", - "FLK": "H7", - "FRO": "H6", - "FJI": "H8", - "FIN": "H9", - "FRA": "I0", - "GUF": "I3", - "PYF": "I4", - "ATF": "2C", - "GAB": "I5", - "GMB": "I6", - "GEO": "2Q", - "DEU": "2M", - "GHA": "J0", - "GIB": "J1", - "GRC": "J3", - "GRL": "J4", - "GRD": "J5", - "GLP": "J6", - "GUM": "GU", - "GTM": "J8", - "GGY": "Y7", - "GIN": "J9", - "GNB": "S0", - "GUY": "K0", - "HTI": "K1", - "HMD": "K4", - "VAT": "X4", - "HND": "K2", - "HKG": "K3", - "HUN": "K5", - "ISL": "K6", - "IND": "K7", - "IDN": "K8", - "IRN": "K9", - "IRQ": "L0", - "IRL": "L2", - "IMN": "Y8", - "ISR": "L3", - "ITA": "L6", - "JAM": "L8", - "JPN": "M0", - "JEY": "Y9", - "JOR": "M2", - "KAZ": "1P", - "KEN": "M3", - "KIR": "J2", - "PRK": "M4", - "KOR": "M5", - "KWT": "M6", - "KGZ": "1N", - "LAO": "M7", - "LVA": "1R", - "LBN": "M8", - "LSO": "M9", - "LBR": "N0", - "LBY": "N1", - "LIE": "N2", - "LTU": "1Q", - "LUX": "N4", - "MAC": "N5", - "MKD": "1U", - "MDG": "N6", - "MWI": "N7", - "MYS": "N8", - "MDV": "N9", - "MLI": "O0", - "MLT": "O1", - "MHL": "1T", - "MTQ": "O2", - "MRT": "O3", - "MUS": "O4", - "MYT": "2P", - "MEX": "O5", - "FSM": "1K", - "MDA": "1S", - "MCO": "O9", - "MNG": "P0", - "MNE": "Z5", - "MSR": "P1", - "MAR": "P2", - "MOZ": "P3", - "MMR": "E1", - "NAM": "T6", - "NRU": "P5", - "NPL": "P6", - "NLD": "P7", - "ANT": "P8", - "NCL": "1W", - "NZL": "Q2", - "NIC": "Q3", - "NER": "Q4", - "NGA": "Q5", - "NIU": "Q6", - "NFK": "Q7", - "MNP": "1V", - "NOR": "Q8", - "OMN": "P4", - "PAK": "R0", - "PLW": "1Y", - "PSE": "1X", - "PAN": "R1", - "PNG": "R2", - "PRY": "R4", - "PER": "R5", - "PHL": "R6", - "PCN": "R8", - "POL": "R9", - "PRT": "S1", - "PRI": "PR", - "QAT": "S3", - "REU": "S4", - "ROU": "S5", - "RUS": "1Z", - "RWA": "S6", - "BLM": "Z0", - "SHN": "U8", - "KNA": "U7", - "LCA": "U9", - "MAF": "Z1", - "SPM": "V0", - "VCT": "V1", - "WSM": "Y0", - "SMR": "S8", - "STP": "S9", - "SAU": "T0", - "SEN": "T1", - "SRB": "Z2", - "SYC": "T2", - "SLE": "T8", - "SGP": "U0", - "SVK": "2B", - "SVN": "2A", - "SLB": "D7", - "SOM": "U1", - "ZAF": "T3", - "SGS": "1L", - "ESP": "U3", - "LKA": "F1", - "SDN": "V2", - "SUR": "V3", - "SJM": "L9", - "SWZ": "V6", - "SWE": "V7", - "CHE": "V8", - "SYR": "V9", - "TWN": "F5", - "TJK": "2D", - "THA": "W1", - "TLS": "Z3", - "TGO": "W2", - "TKL": "W3", - "TON": "W4", - "TTO": "W5", - "TUN": "W6", - "TUR": "W8", - "TKM": "2E", - "TCA": "W7", - "TUV": "2G", - "UGA": "W9", - "UKR": "2H", - "ARE": "C0", - "GBR": "X0", - "UMI": "2J", - "URY": "X3", - "UZB": "2K", - "VUT": "2L", - "VEN": "X5", - "VNM": "Q1", - "VGB": "D8", - "VIR": "VI", - "WLF": "X8", - "ESH": "Y1", - "YEM": "T7", - "ZMB": "Y4", - "ZWE": "Y5", - "XX": "XX", + Location.AFGHANISTAN: "B2", + Location.ALAND_ISLANDS: "Y6", + Location.ALBANIA: "B3", + Location.ALGERIA: "B4", + Location.AMERICAN_SAMOA: "B5", + Location.ANDORRA: "B6", + Location.ANGOLA: "B7", + Location.ANGUILLA: "1A", + Location.ANTARCTICA: "B8", + Location.ANTIGUA_AND_BARBUDA: "B9", + Location.ARGENTINA: "C1", + Location.ARMENIA: "1B", + Location.ARUBA: "1C", + Location.AUSTRALIA: "C3", + Location.AUSTRIA: "C4", + Location.AZERBAIJAN: "1D", + Location.BAHAMAS: "C5", + Location.BAHRAIN: "C6", + Location.BANGLADESH: "C7", + Location.BARBADOS: "C8", + Location.BELARUS: "1F", + Location.BELGIUM: "C9", + Location.BELIZE: "D1", + Location.BENIN: "G6", + Location.BERMUDA: "D0", + Location.BHUTAN: "D2", + Location.BOLIVIA: "D3", + Location.BOSNIA_AND_HERZEGOVINA: "1E", + Location.BOTSWANA: "B1", + Location.BOUVET_ISLAND: "D4", + Location.BRAZIL: "D5", + Location.BRITISH_INDIAN_OCEAN_TERRITORY: "D6", + Location.BRUNEI_DARUSSALAM: "D9", + Location.BULGARIA: "E0", + Location.BURKINA_FASO: "X2", + Location.BURUNDI: "E2", + Location.CAMBODIA: "E3", + Location.CAMEROON: "E4", + Location.CAPE_VERDE: "E8", + Location.CAYMAN_ISLANDS: "E9", + Location.CENTRAL_AFRICAN_REPUBLIC: "F0", + Location.CHAD: "F2", + Location.CHILE: "F3", + Location.CHINA: "F4", + Location.CHRISTMAS_ISLAND: "F6", + Location.COCOS_KEELING_ISLANDS: "F7", + Location.COLOMBIA: "F8", + Location.COMOROS: "F9", + Location.CONGO: "G0", + Location.CONGO_DEMOCRATIC_REPUBLIC: "Y3", + Location.COOK_ISLANDS: "G1", + Location.COSTA_RICA: "G2", + Location.COTE_DIVOIRE: "L7", + Location.CROATIA: "1M", + Location.CUBA: "G3", + Location.CYPRUS: "G4", + Location.CZECH_REPUBLIC: "2N", + Location.DENMARK: "G7", + Location.DJIBOUTI: "1G", + Location.DOMINICA: "G9", + Location.DOMINICAN_REPUBLIC: "D8", + Location.ECUADOR: "H1", + Location.EGYPT: "H2", + Location.EL_SALVADOR: "H3", + Location.EQUATORIAL_GUINEA: "H4", + Location.ERITREA: "1J", + Location.ESTONIA: "1H", + Location.ETHIOPIA: "H5", + Location.FALKLAND_ISLANDS: "H7", + Location.FAROE_ISLANDS: "H6", + Location.FIJI: "H8", + Location.FINLAND: "H9", + Location.FRANCE: "I0", + Location.FRENCH_GUIANA: "I3", + Location.FRENCH_POLYNESIA: "I4", + Location.FRENCH_SOUTHERN_TERRITORIES: "2C", + Location.GABON: "I5", + Location.GAMBIA: "I6", + Location.GEORGIA_REPUBLIC: "2Q", + Location.GERMANY: "2M", + Location.GHANA: "J0", + Location.GIBRALTAR: "J1", + Location.GREECE: "J3", + Location.GREENLAND: "J4", + Location.GRENADA: "J5", + Location.GUADELOUPE: "J6", + Location.GUAM: "GU", + Location.GUATEMALA: "J8", + Location.GUERNSEY: "Y7", + Location.GUINEA: "J9", + Location.GUINEA_BISSAU: "S0", + Location.GUYANA: "K0", + Location.HAITI: "K1", + Location.HEARD_AND_MCDONALD_ISLANDS: "K4", + Location.HOLY_SEE_VATICAN_CITY: "X4", + Location.HONDURAS: "K2", + Location.HONG_KONG: "K3", + Location.HUNGARY: "K5", + Location.ICELAND: "K6", + Location.INDIA: "K7", + Location.INDONESIA: "K8", + Location.IRAN: "K9", + Location.IRAQ: "L0", + Location.IRELAND: "L2", + Location.ISLE_OF_MAN: "Y8", + Location.ISRAEL: "L3", + Location.ITALY: "L6", + Location.JAMAICA: "L8", + Location.JAPAN: "M0", + Location.JERSEY: "Y9", + Location.JORDAN: "M2", + Location.KAZAKHSTAN: "1P", + Location.KENYA: "M3", + Location.KIRIBATI: "J2", + Location.NORTH_KOREA: "M4", + Location.SOUTH_KOREA: "M5", + Location.KUWAIT: "M6", + Location.KYRGYZSTAN: "1N", + Location.LAOS: "M7", + Location.LATVIA: "1R", + Location.LEBANON: "M8", + Location.LESOTHO: "M9", + Location.LIBERIA: "N0", + Location.LIBYA: "N1", + Location.LIECHTENSTEIN: "N2", + Location.LITHUANIA: "1Q", + Location.LUXEMBOURG: "N4", + Location.MACAU: "N5", + Location.MACEDONIA: "1U", + Location.MADAGASCAR: "N6", + Location.MALAWI: "N7", + Location.MALAYSIA: "N8", + Location.MALDIVES: "N9", + Location.MALI: "O0", + Location.MALTA: "O1", + Location.MARSHALL_ISLANDS: "1T", + Location.MARTINIQUE: "O2", + Location.MAURITANIA: "O3", + Location.MAURITIUS: "O4", + Location.MAYOTTE: "2P", + Location.MEXICO: "O5", + Location.MICRONESIA: "1K", + Location.MOLDOVA: "1S", + Location.MONACO: "O9", + Location.MONGOLIA: "P0", + Location.MONTENEGRO: "Z5", + Location.MONTSERRAT: "P1", + Location.MOROCCO: "P2", + Location.MOZAMBIQUE: "P3", + Location.MYANMAR: "E1", + Location.NAMIBIA: "T6", + Location.NAURU: "P5", + Location.NEPAL: "P6", + Location.NETHERLANDS: "P7", + Location.NETHERLANDS_ANTILLES: "P8", + Location.NEW_CALEDONIA: "1W", + Location.NEW_ZEALAND: "Q2", + Location.NICARAGUA: "Q3", + Location.NIGER: "Q4", + Location.NIGERIA: "Q5", + Location.NIUE: "Q6", + Location.NORFOLK_ISLAND: "Q7", + Location.NORTHERN_MARIANA_ISLANDS: "1V", + Location.NORWAY: "Q8", + Location.OMAN: "P4", + Location.PAKISTAN: "R0", + Location.PALAU: "1Y", + Location.PALESTINIAN_TERRITORY: "1X", + Location.PANAMA: "R1", + Location.PAPUA_NEW_GUINEA: "R2", + Location.PARAGUAY: "R4", + Location.PERU: "R5", + Location.PHILIPPINES: "R6", + Location.PITCAIRN: "R8", + Location.POLAND: "R9", + Location.PORTUGAL: "S1", + Location.PUERTO_RICO: "PR", + Location.QATAR: "S3", + Location.REUNION: "S4", + Location.ROMANIA: "S5", + Location.RUSSIAN_FEDERATION: "1Z", + Location.RWANDA: "S6", + Location.SAINT_BARTHELEMY: "Z0", + Location.SAINT_HELENA: "U8", + Location.SAINT_KITTS_AND_NEVIS: "U7", + Location.SAINT_LUCIA: "U9", + Location.SAINT_MARTIN: "Z1", + Location.SAINT_PIERRE_AND_MIQUELON: "V0", + Location.SAINT_VINCENT_AND_GRENADINES: "V1", + Location.SAMOA: "Y0", + Location.SAN_MARINO: "S8", + Location.SAO_TOME_AND_PRINCIPE: "S9", + Location.SAUDI_ARABIA: "T0", + Location.SENEGAL: "T1", + Location.SERBIA: "Z2", + Location.SEYCHELLES: "T2", + Location.SIERRA_LEONE: "T8", + Location.SINGAPORE: "U0", + Location.SLOVAKIA: "2B", + Location.SLOVENIA: "2A", + Location.SOLOMON_ISLANDS: "D7", + Location.SOMALIA: "U1", + Location.SOUTH_AFRICA: "T3", + Location.SOUTH_GEORGIA_AND_SOUTH_SANDWICH_ISLANDS: "1L", + Location.SPAIN: "U3", + Location.SRI_LANKA: "F1", + Location.SUDAN: "V2", + Location.SURINAME: "V3", + Location.SVALBARD_AND_JAN_MAYEN: "L9", + Location.ESWATINI: "V6", + Location.SWEDEN: "V7", + Location.SWITZERLAND: "V8", + Location.SYRIA: "V9", + Location.TAIWAN: "F5", + Location.TAJIKISTAN: "2D", + Location.THAILAND: "W1", + Location.TIMOR_LESTE: "Z3", + Location.TOGO: "W2", + Location.TOKELAU: "W3", + Location.TONGA: "W4", + Location.TRINIDAD_AND_TOBAGO: "W5", + Location.TUNISIA: "W6", + Location.TURKEY: "W8", + Location.TURKMENISTAN: "2E", + Location.TURKS_AND_CAICOS_ISLANDS: "W7", + Location.TUVALU: "2G", + Location.UGANDA: "W9", + Location.UKRAINE: "2H", + Location.UNITED_ARAB_EMIRATES: "C0", + Location.UNITED_KINGDOM: "X0", + Location.UNITED_STATES_MINOR_OUTLYING_ISLANDS: "2J", + Location.URUGUAY: "X3", + Location.UZBEKISTAN: "2K", + Location.VANUATU: "2L", + Location.VENEZUELA: "X5", + Location.VIETNAM: "Q1", + Location.BRITISH_VIRGIN_ISLANDS: "D8", + Location.US_VIRGIN_ISLANDS: "VI", + Location.WALLIS_AND_FUTUNA: "X8", + Location.WESTERN_SAHARA: "Y1", + Location.YEMEN: "T7", + Location.ZAMBIA: "Y4", + Location.ZIMBABWE: "Y5", + Location.UNKNOWN: "XX", } TEXT_SEARCH_LOCATIONS_MAPPING = { diff --git a/edgar_tool/url_generator.py b/edgar_tool/url_generator.py index 1b47f46..38985b9 100644 --- a/edgar_tool/url_generator.py +++ b/edgar_tool/url_generator.py @@ -2,7 +2,11 @@ from typing import Literal, TypedDict from urllib import parse -from edgar_tool.constants import PEO_IN_AND_INC_IN_TO_SEC_FORM_ID, TEXT_SEARCH_BASE_URL +from edgar_tool.constants import ( + PEO_IN_AND_INC_IN_TO_SEC_FORM_ID, + TEXT_SEARCH_BASE_URL, + Location, +) class SearchQueryKwargs(TypedDict, total=False): @@ -13,8 +17,8 @@ class SearchQueryKwargs(TypedDict, total=False): date_range_select: Literal["all", "10y", "1y", "30d", "custom"] start_date: datetime.date end_date: datetime.date - inc_in: str - peo_in: str + inc_in: Location + peo_in: Location class _ValidSearchParams: diff --git a/tests/test_cli.py b/tests/test_cli.py index 6e70d92..657a75a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,4 +1,3 @@ -import subprocess from unittest.mock import patch import pytest @@ -16,8 +15,11 @@ def mock_edgar_text_searcher(): def test_cli_should_return_help_string_when_passed_no_args(): - """Tests that running edgar-tool without any arguments returns the CLI's help string and 0 exit code.""" - # GIVEN + """ + Tests that running edgar-tool without any arguments + returns the CLI's help string and 0 exit code. + """ + # GIVEN/WHEN result = runner.invoke(edgar_tool.cli.app, []) # THEN diff --git a/tests/test_url_generator.py b/tests/test_url_generator.py index 963a3db..a4f7e88 100644 --- a/tests/test_url_generator.py +++ b/tests/test_url_generator.py @@ -20,6 +20,7 @@ import pytest from edgar_tool import url_generator +from edgar_tool.constants import Location def test_should_correctly_generate_search_url_for_single_word(): @@ -115,6 +116,7 @@ def test_should_raise_if_date_range_select_invalid(): ), ({"date_range_select": "all"}, "&dateRange=all"), ({"date_range_select": "10y"}, "&dateRange=10y"), + # TODO: Test 5y doesn't add anything to the URL ({"date_range_select": "1y"}, "&dateRange=1y"), ({"date_range_select": "30d"}, "&dateRange=30d"), ], @@ -215,315 +217,315 @@ def test_raises_an_exception_if_user_passes_both_filing_category_and_single_form "abbreviation, expected_location_code", [ # US States - All use 2-letter state & territory abbreviations (ISO 3166-2) - ("AL", "AL"), # Alabama - ("AK", "AK"), # Alaska - ("AZ", "AZ"), # Arizona - ("AR", "AR"), # Arkansas - ("CA", "CA"), # California - ("CO", "CO"), # Colorado - ("CT", "CT"), # Connecticut - ("DE", "DE"), # Delaware - ("DC", "DC"), # District of Columbia - ("FL", "FL"), # Florida - ("GA", "GA"), # Georgia - ("HI", "HI"), # Hawaii - ("ID", "ID"), # Idaho - ("IL", "IL"), # Illinois - ("IN", "IN"), # Indiana - ("IA", "IA"), # Iowa - ("KS", "KS"), # Kansas - ("KY", "KY"), # Kentucky - ("LA", "LA"), # Louisiana - ("ME", "ME"), # Maine - ("MD", "MD"), # Maryland - ("MA", "MA"), # Massachusetts - ("MI", "MI"), # Michigan - ("MN", "MN"), # Minnesota - ("MS", "MS"), # Mississippi - ("MO", "MO"), # Missouri - ("MT", "MT"), # Montana - ("NE", "NE"), # Nebraska - ("NV", "NV"), # Nevada - ("NH", "NH"), # New Hampshire - ("NJ", "NJ"), # New Jersey - ("NM", "NM"), # New Mexico - ("NY", "NY"), # New York - ("NC", "NC"), # North Carolina - ("ND", "ND"), # North Dakota - ("OH", "OH"), # Ohio - ("OK", "OK"), # Oklahoma - ("OR", "OR"), # Oregon - ("PA", "PA"), # Pennsylvania - ("RI", "RI"), # Rhode Island - ("SC", "SC"), # South Carolina - ("SD", "SD"), # South Dakota - ("TN", "TN"), # Tennessee - ("TX", "TX"), # Texas - ("UT", "UT"), # Utah - ("VT", "VT"), # Vermont - ("VA", "VA"), # Virginia - ("WA", "WA"), # Washington - ("WV", "WV"), # West Virginia - ("WI", "WI"), # Wisconsin - ("WY", "WY"), # Wyoming + (Location.ALABAMA, "AL"), + (Location.ALASKA, "AK"), + (Location.ARIZONA, "AZ"), + (Location.ARKANSAS, "AR"), + (Location.CALIFORNIA, "CA"), + (Location.COLORADO, "CO"), + (Location.CONNECTICUT, "CT"), + (Location.DELAWARE, "DE"), + (Location.DISTRICT_OF_COLUMBIA, "DC"), + (Location.FLORIDA, "FL"), + (Location.GEORGIA, "GA"), + (Location.HAWAII, "HI"), + (Location.IDAHO, "ID"), + (Location.ILLINOIS, "IL"), + (Location.INDIANA, "IN"), + (Location.IOWA, "IA"), + (Location.KANSAS, "KS"), + (Location.KENTUCKY, "KY"), + (Location.LOUISIANA, "LA"), + (Location.MAINE, "ME"), + (Location.MARYLAND, "MD"), + (Location.MASSACHUSETTS, "MA"), + (Location.MICHIGAN, "MI"), + (Location.MINNESOTA, "MN"), + (Location.MISSISSIPPI, "MS"), + (Location.MISSOURI, "MO"), + (Location.MONTANA, "MT"), + (Location.NEBRASKA, "NE"), + (Location.NEVADA, "NV"), + (Location.NEW_HAMPSHIRE, "NH"), + (Location.NEW_JERSEY, "NJ"), + (Location.NEW_MEXICO, "NM"), + (Location.NEW_YORK, "NY"), + (Location.NORTH_CAROLINA, "NC"), + (Location.NORTH_DAKOTA, "ND"), + (Location.OHIO, "OH"), + (Location.OKLAHOMA, "OK"), + (Location.OREGON, "OR"), + (Location.PENNSYLVANIA, "PA"), + (Location.RHODE_ISLAND, "RI"), + (Location.SOUTH_CAROLINA, "SC"), + (Location.SOUTH_DAKOTA, "SD"), + (Location.TENNESSEE, "TN"), + (Location.TEXAS, "TX"), + (Location.UTAH, "UT"), + (Location.VERMONT, "VT"), + (Location.VIRGINIA, "VA"), + (Location.WASHINGTON, "WA"), + (Location.WEST_VIRGINIA, "WV"), + (Location.WISCONSIN, "WI"), + (Location.WYOMING, "WY"), # Canadian Provinces - P.E.O. in to use internationally approved alpha codes (ISO 3166-2) - ("AB", "A0"), # Alberta - ("BC", "A1"), # British Columbia - ("CAN", "Z4"), # Canada (Federal Level) - ("MB", "A2"), # Manitoba - ("NB", "A3"), # New Brunswick - ("NL", "A4"), # Newfoundland and Labrador - ("NS", "A5"), # Nova Scotia - ("ON", "A6"), # Ontario - ("PE", "A7"), # Prince Edward Island - ("QC", "A8"), # Quebec - ("SK", "A9"), # Saskatchewan - ("YT", "B0"), # Yukon + (Location.ALBERTA, "A0"), + (Location.BRITISH_COLUMBIA, "A1"), + (Location.CANADA, "Z4"), + (Location.MANITOBA, "A2"), + (Location.NEW_BRUNSWICK, "A3"), + (Location.NEWFOUNDLAND_AND_LABRADOR, "A4"), + (Location.NOVA_SCOTIA, "A5"), + (Location.ONTARIO, "A6"), + (Location.PRINCE_EDWARD_ISLAND, "A7"), + (Location.QUEBEC, "A8"), + (Location.SASKATCHEWAN, "A9"), + (Location.YUKON, "B0"), # Other Countries - All use internationally approved 3-letter alpha codes (ISO 3166-1) - ("AFG", "B2"), # Afghanistan - ("ALA", "Y6"), # Aland Islands - ("ALB", "B3"), # Albania - ("DZA", "B4"), # Algeria - ("ASM", "B5"), # American Samoa - ("AND", "B6"), # Andorra - ("AGO", "B7"), # Angola - ("AIA", "1A"), # Anguilla - ("ATA", "B8"), # Antarctica - ("ATG", "B9"), # Antigua and Barbuda - ("ARG", "C1"), # Argentina - ("ARM", "1B"), # Armenia - ("ABW", "1C"), # Aruba - ("AUS", "C3"), # Australia - ("AUT", "C4"), # Austria - ("AZE", "1D"), # Azerbaijan - ("BHS", "C5"), # Bahamas - ("BHR", "C6"), # Bahrain - ("BGD", "C7"), # Bangladesh - ("BRB", "C8"), # Barbados - ("BLR", "1F"), # Belarus - ("BEL", "C9"), # Belgium - ("BLZ", "D1"), # Belize - ("BEN", "G6"), # Benin - ("BMU", "D0"), # Bermuda - ("BTN", "D2"), # Bhutan - ("BOL", "D3"), # Bolivia - ("BIH", "1E"), # Bosnia and Herzegovina - ("BWA", "B1"), # Botswana - ("BVT", "D4"), # Bouvet Island - ("BRA", "D5"), # Brazil - ("IOT", "D6"), # British Indian Ocean Territory - ("BRN", "D9"), # Brunei Darussalam - ("BGR", "E0"), # Bulgaria - ("BFA", "X2"), # Burkina Faso - ("BDI", "E2"), # Burundi - ("KHM", "E3"), # Cambodia - ("CMR", "E4"), # Cameroon - ("CPV", "E8"), # Cape Verde - ("CYM", "E9"), # Cayman Islands - ("CAF", "F0"), # Central African Republic - ("TCD", "F2"), # Chad - ("CHL", "F3"), # Chile - ("CHN", "F4"), # China - ("CXR", "F6"), # Christmas Island - ("CCK", "F7"), # Cocos (Keeling) Islands - ("COL", "F8"), # Colombia - ("COM", "F9"), # Comoros - ("COG", "G0"), # Congo - ("COD", "Y3"), # Congo, Democratic Republic of the - ("COK", "G1"), # Cook Islands - ("CRI", "G2"), # Costa Rica - ("CIV", "L7"), # Cote d'Ivoire - ("HRV", "1M"), # Croatia - ("CUB", "G3"), # Cuba - ("CYP", "G4"), # Cyprus - ("CZE", "2N"), # Czech Republic - ("DNK", "G7"), # Denmark - ("DJI", "1G"), # Djibouti - ("DMA", "G9"), # Dominica - ("DOM", "D8"), # Dominican Republic - ("ECU", "H1"), # Ecuador - ("EGY", "H2"), # Egypt - ("SLV", "H3"), # El Salvador - ("GNQ", "H4"), # Equatorial Guinea - ("ERI", "1J"), # Eritrea - ("EST", "1H"), # Estonia - ("ETH", "H5"), # Ethiopia - ("FLK", "H7"), # Falkland Islands (Malvinas) - ("FRO", "H6"), # Faroe Islands - ("FJI", "H8"), # Fiji - ("FIN", "H9"), # Finland - ("FRA", "I0"), # France - ("GUF", "I3"), # French Guiana - ("PYF", "I4"), # French Polynesia - ("ATF", "2C"), # French Southern Territories - ("GAB", "I5"), # Gabon - ("GMB", "I6"), # Gambia - ("GEO", "2Q"), # Georgia - ("DEU", "2M"), # Germany - ("GHA", "J0"), # Ghana - ("GIB", "J1"), # Gibraltar - ("GRC", "J3"), # Greece - ("GRL", "J4"), # Greenland - ("GRD", "J5"), # Grenada - ("GLP", "J6"), # Guadeloupe - ("GUM", "GU"), # Guam - ("GTM", "J8"), # Guatemala - ("GGY", "Y7"), # Guernsey - ("GIN", "J9"), # Guinea - ("GNB", "S0"), # Guinea-Bissau - ("GUY", "K0"), # Guyana - ("HTI", "K1"), # Haiti - ("HMD", "K4"), # Heard Island and McDonald Islands - ("VAT", "X4"), # Holy See (Vatican City State) - ("HND", "K2"), # Honduras - ("HKG", "K3"), # Hong Kong - ("HUN", "K5"), # Hungary - ("ISL", "K6"), # Iceland - ("IND", "K7"), # India - ("IDN", "K8"), # Indonesia - ("IRN", "K9"), # Iran - ("IRQ", "L0"), # Iraq - ("IRL", "L2"), # Ireland - ("IMN", "Y8"), # Isle of Man - ("ISR", "L3"), # Israel - ("ITA", "L6"), # Italy - ("JAM", "L8"), # Jamaica - ("JPN", "M0"), # Japan - ("JEY", "Y9"), # Jersey - ("JOR", "M2"), # Jordan - ("KAZ", "1P"), # Kazakhstan - ("KEN", "M3"), # Kenya - ("KIR", "J2"), # Kiribati - ("PRK", "M4"), # Korea, Democratic People's Republic of - ("KOR", "M5"), # Korea, Republic of - ("KWT", "M6"), # Kuwait - ("KGZ", "1N"), # Kyrgyzstan - ("LAO", "M7"), # Lao People's Democratic Republic - ("LVA", "1R"), # Latvia - ("LBN", "M8"), # Lebanon - ("LSO", "M9"), # Lesotho - ("LBR", "N0"), # Liberia - ("LBY", "N1"), # Libya - ("LIE", "N2"), # Liechtenstein - ("LTU", "1Q"), # Lithuania - ("LUX", "N4"), # Luxembourg - ("MAC", "N5"), # Macao - ("MKD", "1U"), # Macedonia - ("MDG", "N6"), # Madagascar - ("MWI", "N7"), # Malawi - ("MYS", "N8"), # Malaysia - ("MDV", "N9"), # Maldives - ("MLI", "O0"), # Mali - ("MLT", "O1"), # Malta - ("MHL", "1T"), # Marshall Islands - ("MTQ", "O2"), # Martinique - ("MRT", "O3"), # Mauritania - ("MUS", "O4"), # Mauritius - ("MYT", "2P"), # Mayotte - ("MEX", "O5"), # Mexico - ("FSM", "1K"), # Micronesia, Federated States of - ("MDA", "1S"), # Moldova - ("MCO", "O9"), # Monaco - ("MNG", "P0"), # Mongolia - ("MNE", "Z5"), # Montenegro - ("MSR", "P1"), # Montserrat - ("MAR", "P2"), # Morocco - ("MOZ", "P3"), # Mozambique - ("MMR", "E1"), # Myanmar - ("NAM", "T6"), # Namibia - ("NRU", "P5"), # Nauru - ("NPL", "P6"), # Nepal - ("NLD", "P7"), # Netherlands - ("ANT", "P8"), # Netherlands Antilles - ("NCL", "1W"), # New Caledonia - ("NZL", "Q2"), # New Zealand - ("NIC", "Q3"), # Nicaragua - ("NER", "Q4"), # Niger - ("NGA", "Q5"), # Nigeria - ("NIU", "Q6"), # Niue - ("NFK", "Q7"), # Norfolk Island - ("MNP", "1V"), # Northern Mariana Islands - ("NOR", "Q8"), # Norway - ("OMN", "P4"), # Oman - ("PAK", "R0"), # Pakistan - ("PLW", "1Y"), # Palau - ("PSE", "1X"), # Palestinian Territory - ("PAN", "R1"), # Panama - ("PNG", "R2"), # Papua New Guinea - ("PRY", "R4"), # Paraguay - ("PER", "R5"), # Peru - ("PHL", "R6"), # Philippines - ("PCN", "R8"), # Pitcairn - ("POL", "R9"), # Poland - ("PRT", "S1"), # Portugal - ("PRI", "PR"), # Puerto Rico - ("QAT", "S3"), # Qatar - ("REU", "S4"), # Reunion - ("ROU", "S5"), # Romania - ("RUS", "1Z"), # Russian Federation - ("RWA", "S6"), # Rwanda - ("BLM", "Z0"), # Saint Barthelemy - ("SHN", "U8"), # Saint Helena - ("KNA", "U7"), # Saint Kitts and Nevis - ("LCA", "U9"), # Saint Lucia - ("MAF", "Z1"), # Saint Martin - ("SPM", "V0"), # Saint Pierre and Miquelon - ("VCT", "V1"), # Saint Vincent and the Grenadines - ("WSM", "Y0"), # Samoa - ("SMR", "S8"), # San Marino - ("STP", "S9"), # Sao Tome and Principe - ("SAU", "T0"), # Saudi Arabia - ("SEN", "T1"), # Senegal - ("SRB", "Z2"), # Serbia - ("SYC", "T2"), # Seychelles - ("SLE", "T8"), # Sierra Leone - ("SGP", "U0"), # Singapore - ("SVK", "2B"), # Slovakia - ("SVN", "2A"), # Slovenia - ("SLB", "D7"), # Solomon Islands - ("SOM", "U1"), # Somalia - ("ZAF", "T3"), # South Africa - ("SGS", "1L"), # South Georgia and the South Sandwich Islands - ("ESP", "U3"), # Spain - ("LKA", "F1"), # Sri Lanka - ("SDN", "V2"), # Sudan - ("SUR", "V3"), # Suriname - ("SJM", "L9"), # Svalbard and Jan Mayen - ("SWZ", "V6"), # Kingdom of Eswatini (Formerly Swaziland) - ("SWE", "V7"), # Sweden - ("CHE", "V8"), # Switzerland - ("SYR", "V9"), # Syrian Arab Republic (Syria) - ("TWN", "F5"), # Taiwan - ("TJK", "2D"), # Tajikistan - ("THA", "W1"), # Thailand - ("TLS", "Z3"), # Timor-Leste - ("TGO", "W2"), # Togo - ("TKL", "W3"), # Tokelau - ("TON", "W4"), # Tonga - ("TTO", "W5"), # Trinidad and Tobago - ("TUN", "W6"), # Tunisia - ("TUR", "W8"), # Turkey - ("TKM", "2E"), # Turkmenistan - ("TCA", "W7"), # Turks and Caicos Islands - ("TUV", "2G"), # Tuvalu - ("UGA", "W9"), # Uganda - ("UKR", "2H"), # Ukraine - ("ARE", "C0"), # United Arab Emirates - ("GBR", "X0"), # United Kingdom - ("UMI", "2J"), # United States Minor Outlying Islands - ("URY", "X3"), # Uruguay - ("UZB", "2K"), # Uzbekistan - ("VUT", "2L"), # Vanuatu - ("VEN", "X5"), # Venezuela - ("VNM", "Q1"), # Vietnam - ("VGB", "D8"), # British Virgin Islands - ("VIR", "VI"), # U.S. Virgin Islands - ("WLF", "X8"), # Wallis and Futuna - ("ESH", "Y1"), # Western Sahara - ("YEM", "T7"), # Yemen - ("ZMB", "Y4"), # Zambia - ("ZWE", "Y5"), # Zimbabwe - ("XX", "XX"), # Unknown + (Location.AFGHANISTAN, "B2"), + (Location.ALAND_ISLANDS, "Y6"), + (Location.ALBANIA, "B3"), + (Location.ALGERIA, "B4"), + (Location.AMERICAN_SAMOA, "B5"), + (Location.ANDORRA, "B6"), + (Location.ANGOLA, "B7"), + (Location.ANGUILLA, "1A"), + (Location.ANTARCTICA, "B8"), + (Location.ANTIGUA_AND_BARBUDA, "B9"), + (Location.ARGENTINA, "C1"), + (Location.ARMENIA, "1B"), + (Location.ARUBA, "1C"), + (Location.AUSTRALIA, "C3"), + (Location.AUSTRIA, "C4"), + (Location.AZERBAIJAN, "1D"), + (Location.BAHAMAS, "C5"), + (Location.BAHRAIN, "C6"), + (Location.BANGLADESH, "C7"), + (Location.BARBADOS, "C8"), + (Location.BELARUS, "1F"), + (Location.BELGIUM, "C9"), + (Location.BELIZE, "D1"), + (Location.BENIN, "G6"), + (Location.BERMUDA, "D0"), + (Location.BHUTAN, "D2"), + (Location.BOLIVIA, "D3"), + (Location.BOSNIA_AND_HERZEGOVINA, "1E"), + (Location.BOTSWANA, "B1"), + (Location.BOUVET_ISLAND, "D4"), + (Location.BRAZIL, "D5"), + (Location.BRITISH_INDIAN_OCEAN_TERRITORY, "D6"), + (Location.BRUNEI_DARUSSALAM, "D9"), + (Location.BULGARIA, "E0"), + (Location.BURKINA_FASO, "X2"), + (Location.BURUNDI, "E2"), + (Location.CAMBODIA, "E3"), + (Location.CAMEROON, "E4"), + (Location.CAPE_VERDE, "E8"), + (Location.CAYMAN_ISLANDS, "E9"), + (Location.CENTRAL_AFRICAN_REPUBLIC, "F0"), + (Location.CHAD, "F2"), + (Location.CHILE, "F3"), + (Location.CHINA, "F4"), + (Location.CHRISTMAS_ISLAND, "F6"), + (Location.COCOS_KEELING_ISLANDS, "F7"), + (Location.COLOMBIA, "F8"), + (Location.COMOROS, "F9"), + (Location.CONGO, "G0"), + (Location.CONGO_DEMOCRATIC_REPUBLIC, "Y3"), + (Location.COOK_ISLANDS, "G1"), + (Location.COSTA_RICA, "G2"), + (Location.COTE_DIVOIRE, "L7"), + (Location.CROATIA, "1M"), + (Location.CUBA, "G3"), + (Location.CYPRUS, "G4"), + (Location.CZECH_REPUBLIC, "2N"), + (Location.DENMARK, "G7"), + (Location.DJIBOUTI, "1G"), + (Location.DOMINICA, "G9"), + (Location.DOMINICAN_REPUBLIC, "D8"), + (Location.ECUADOR, "H1"), + (Location.EGYPT, "H2"), + (Location.EL_SALVADOR, "H3"), + (Location.EQUATORIAL_GUINEA, "H4"), + (Location.ERITREA, "1J"), + (Location.ESTONIA, "1H"), + (Location.ETHIOPIA, "H5"), + (Location.FALKLAND_ISLANDS, "H7"), + (Location.FAROE_ISLANDS, "H6"), + (Location.FIJI, "H8"), + (Location.FINLAND, "H9"), + (Location.FRANCE, "I0"), + (Location.FRENCH_GUIANA, "I3"), + (Location.FRENCH_POLYNESIA, "I4"), + (Location.FRENCH_SOUTHERN_TERRITORIES, "2C"), + (Location.GABON, "I5"), + (Location.GAMBIA, "I6"), + (Location.GEORGIA_REPUBLIC, "2Q"), + (Location.GERMANY, "2M"), + (Location.GHANA, "J0"), + (Location.GIBRALTAR, "J1"), + (Location.GREECE, "J3"), + (Location.GREENLAND, "J4"), + (Location.GRENADA, "J5"), + (Location.GUADELOUPE, "J6"), + (Location.GUAM, "GU"), + (Location.GUATEMALA, "J8"), + (Location.GUERNSEY, "Y7"), + (Location.GUINEA, "J9"), + (Location.GUINEA_BISSAU, "S0"), + (Location.GUYANA, "K0"), + (Location.HAITI, "K1"), + (Location.HEARD_AND_MCDONALD_ISLANDS, "K4"), + (Location.HOLY_SEE_VATICAN_CITY, "X4"), + (Location.HONDURAS, "K2"), + (Location.HONG_KONG, "K3"), + (Location.HUNGARY, "K5"), + (Location.ICELAND, "K6"), + (Location.INDIA, "K7"), + (Location.INDONESIA, "K8"), + (Location.IRAN, "K9"), + (Location.IRAQ, "L0"), + (Location.IRELAND, "L2"), + (Location.ISLE_OF_MAN, "Y8"), + (Location.ISRAEL, "L3"), + (Location.ITALY, "L6"), + (Location.JAMAICA, "L8"), + (Location.JAPAN, "M0"), + (Location.JERSEY, "Y9"), + (Location.JORDAN, "M2"), + (Location.KAZAKHSTAN, "1P"), + (Location.KENYA, "M3"), + (Location.KIRIBATI, "J2"), + (Location.NORTH_KOREA, "M4"), + (Location.SOUTH_KOREA, "M5"), + (Location.KUWAIT, "M6"), + (Location.KYRGYZSTAN, "1N"), + (Location.LAOS, "M7"), + (Location.LATVIA, "1R"), + (Location.LEBANON, "M8"), + (Location.LESOTHO, "M9"), + (Location.LIBERIA, "N0"), + (Location.LIBYA, "N1"), + (Location.LIECHTENSTEIN, "N2"), + (Location.LITHUANIA, "1Q"), + (Location.LUXEMBOURG, "N4"), + (Location.MACAU, "N5"), + (Location.MACEDONIA, "1U"), + (Location.MADAGASCAR, "N6"), + (Location.MALAWI, "N7"), + (Location.MALAYSIA, "N8"), + (Location.MALDIVES, "N9"), + (Location.MALI, "O0"), + (Location.MALTA, "O1"), + (Location.MARSHALL_ISLANDS, "1T"), + (Location.MARTINIQUE, "O2"), + (Location.MAURITANIA, "O3"), + (Location.MAURITIUS, "O4"), + (Location.MAYOTTE, "2P"), + (Location.MEXICO, "O5"), + (Location.MICRONESIA, "1K"), + (Location.MOLDOVA, "1S"), + (Location.MONACO, "O9"), + (Location.MONGOLIA, "P0"), + (Location.MONTENEGRO, "Z5"), + (Location.MONTSERRAT, "P1"), + (Location.MOROCCO, "P2"), + (Location.MOZAMBIQUE, "P3"), + (Location.MYANMAR, "E1"), + (Location.NAMIBIA, "T6"), + (Location.NAURU, "P5"), + (Location.NEPAL, "P6"), + (Location.NETHERLANDS, "P7"), + (Location.NETHERLANDS_ANTILLES, "P8"), + (Location.NEW_CALEDONIA, "1W"), + (Location.NEW_ZEALAND, "Q2"), + (Location.NICARAGUA, "Q3"), + (Location.NIGER, "Q4"), + (Location.NIGERIA, "Q5"), + (Location.NIUE, "Q6"), + (Location.NORFOLK_ISLAND, "Q7"), + (Location.NORTHERN_MARIANA_ISLANDS, "1V"), + (Location.NORWAY, "Q8"), + (Location.OMAN, "P4"), + (Location.PAKISTAN, "R0"), + (Location.PALAU, "1Y"), + (Location.PALESTINIAN_TERRITORY, "1X"), + (Location.PANAMA, "R1"), + (Location.PAPUA_NEW_GUINEA, "R2"), + (Location.PARAGUAY, "R4"), + (Location.PERU, "R5"), + (Location.PHILIPPINES, "R6"), + (Location.PITCAIRN, "R8"), + (Location.POLAND, "R9"), + (Location.PORTUGAL, "S1"), + (Location.PUERTO_RICO, "PR"), + (Location.QATAR, "S3"), + (Location.REUNION, "S4"), + (Location.ROMANIA, "S5"), + (Location.RUSSIAN_FEDERATION, "1Z"), + (Location.RWANDA, "S6"), + (Location.SAINT_BARTHELEMY, "Z0"), + (Location.SAINT_HELENA, "U8"), + (Location.SAINT_KITTS_AND_NEVIS, "U7"), + (Location.SAINT_LUCIA, "U9"), + (Location.SAINT_MARTIN, "Z1"), + (Location.SAINT_PIERRE_AND_MIQUELON, "V0"), + (Location.SAINT_VINCENT_AND_GRENADINES, "V1"), + (Location.SAMOA, "Y0"), + (Location.SAN_MARINO, "S8"), + (Location.SAO_TOME_AND_PRINCIPE, "S9"), + (Location.SAUDI_ARABIA, "T0"), + (Location.SENEGAL, "T1"), + (Location.SERBIA, "Z2"), + (Location.SEYCHELLES, "T2"), + (Location.SIERRA_LEONE, "T8"), + (Location.SINGAPORE, "U0"), + (Location.SLOVAKIA, "2B"), + (Location.SLOVENIA, "2A"), + (Location.SOLOMON_ISLANDS, "D7"), + (Location.SOMALIA, "U1"), + (Location.SOUTH_AFRICA, "T3"), + (Location.SOUTH_GEORGIA_AND_SOUTH_SANDWICH_ISLANDS, "1L"), + (Location.SPAIN, "U3"), + (Location.SRI_LANKA, "F1"), + (Location.SUDAN, "V2"), + (Location.SURINAME, "V3"), + (Location.SVALBARD_AND_JAN_MAYEN, "L9"), + (Location.ESWATINI, "V6"), + (Location.SWEDEN, "V7"), + (Location.SWITZERLAND, "V8"), + (Location.SYRIA, "V9"), + (Location.TAIWAN, "F5"), + (Location.TAJIKISTAN, "2D"), + (Location.THAILAND, "W1"), + (Location.TIMOR_LESTE, "Z3"), + (Location.TOGO, "W2"), + (Location.TOKELAU, "W3"), + (Location.TONGA, "W4"), + (Location.TRINIDAD_AND_TOBAGO, "W5"), + (Location.TUNISIA, "W6"), + (Location.TURKEY, "W8"), + (Location.TURKMENISTAN, "2E"), + (Location.TURKS_AND_CAICOS_ISLANDS, "W7"), + (Location.TUVALU, "2G"), + (Location.UGANDA, "W9"), + (Location.UKRAINE, "2H"), + (Location.UNITED_ARAB_EMIRATES, "C0"), + (Location.UNITED_KINGDOM, "X0"), + (Location.UNITED_STATES_MINOR_OUTLYING_ISLANDS, "2J"), + (Location.URUGUAY, "X3"), + (Location.UZBEKISTAN, "2K"), + (Location.VANUATU, "2L"), + (Location.VENEZUELA, "X5"), + (Location.VIETNAM, "Q1"), + (Location.BRITISH_VIRGIN_ISLANDS, "D8"), + (Location.US_VIRGIN_ISLANDS, "VI"), + (Location.WALLIS_AND_FUTUNA, "X8"), + (Location.WESTERN_SAHARA, "Y1"), + (Location.YEMEN, "T7"), + (Location.ZAMBIA, "Y4"), + (Location.ZIMBABWE, "Y5"), + (Location.UNKNOWN, "XX"), ], ) class TestPeoInAndIncIn: