first commit
This commit is contained in:
4
project_constants/constants_module.egg-info/PKG-INFO
Normal file
4
project_constants/constants_module.egg-info/PKG-INFO
Normal file
@@ -0,0 +1,4 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: constants_module
|
||||
Version: 0.1.0
|
||||
Summary: Internal PASBDC shared constants library to allow you to get the column names used in Neoserra
|
||||
9
project_constants/constants_module.egg-info/SOURCES.txt
Normal file
9
project_constants/constants_module.egg-info/SOURCES.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
pyproject.toml
|
||||
./constants_module/__init__.py
|
||||
./constants_module/column_names.py
|
||||
constants_module/__init__.py
|
||||
constants_module/column_names.py
|
||||
constants_module.egg-info/PKG-INFO
|
||||
constants_module.egg-info/SOURCES.txt
|
||||
constants_module.egg-info/dependency_links.txt
|
||||
constants_module.egg-info/top_level.txt
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
constants_module
|
||||
10
project_constants/constants_module/__init__.py
Normal file
10
project_constants/constants_module/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from .column_names import NeoserraColumnNames, OutColumnNames, NEOSERRA_COLUMNS, OUT_COLUMNS, TRAINING_COUNT_COLUMNS
|
||||
from .constant_values import Constants
|
||||
__all__ = [
|
||||
'NeoserraColumnNames',
|
||||
'OutColumnNames',
|
||||
'NEOSERRA_COLUMNS',
|
||||
'OUT_COLUMNS',
|
||||
'TRAINING_COUNT_COLUMNS',
|
||||
'Constants'
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
110
project_constants/constants_module/column_names.py
Normal file
110
project_constants/constants_module/column_names.py
Normal file
@@ -0,0 +1,110 @@
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
|
||||
class ColumnMapping:
|
||||
def apply_json_mapping(self, json_path:str):
|
||||
try:
|
||||
with open(json_path) as json_file:
|
||||
user_config = json.load(json_file)
|
||||
for key, value in user_config.items():
|
||||
if hasattr(self, key):
|
||||
setattr(self, key, value)
|
||||
except FileNotFoundError:
|
||||
print(f"Column mapping file {json_path} could not be found, using the default mappings")
|
||||
|
||||
@dataclass
|
||||
class NeoserraColumnNames(ColumnMapping):
|
||||
milestone_attribution_source:str = "Attribution Source"
|
||||
milestone_attribution_statement:str = "Attribution Statement"
|
||||
milestone_affirmation:str = "Affirmation"
|
||||
milestone_date: str = "Milestone Date"
|
||||
attribution_date: str = "Attribution Date"
|
||||
client_id: str = "Client ID"
|
||||
milestone_type: str = "Type"
|
||||
# The value that when seen will cause a milestone to be considered a request and not to be counted
|
||||
requested_ecenter_val: str = "Requested on eCenter"
|
||||
center: str = "Center"
|
||||
milestone_type_name: str = "Milestone Type"
|
||||
business_established_val: str = "Business Established"
|
||||
business_start_impact_val: str = "Business Start Impact"
|
||||
primary_naics: str = "Primary NAICS"
|
||||
naics: str = "NAICs"
|
||||
physical_address_county: str = "Physical Address County"
|
||||
satisfaction_score: str = "Question 1"
|
||||
answers: str = "Answers"
|
||||
event_title: str = "Event Title"
|
||||
primary_training_topic: str = "Primary Training Topic"
|
||||
training_id: str = "Training ID"
|
||||
training_topics: str = "Training Topics"
|
||||
funding_source: str = "Funding Source"
|
||||
attendees_total: str = "Attendees, Total"
|
||||
program_format: str = "Program Format"
|
||||
interval_data_value: str = "Value"
|
||||
reportable:str = "Reportable?"
|
||||
start_date:str = "Start Date"
|
||||
|
||||
@dataclass
|
||||
class OutColumnNames(ColumnMapping):
|
||||
milestone_documentation_level:str = "Documentation Level"
|
||||
unified_naics: str = "NAICS_CODE"
|
||||
census_pct: str = "Percentage"
|
||||
naics_2: str = "NAICS_2"
|
||||
naics_label: str = "NAICS2022_LABEL"
|
||||
pa_naics_pct: str = "PA NAICs Code Percentage"
|
||||
pasbdc_pct: str = "PASBDC NAICs Code Percentage"
|
||||
census_estab: str = "ESTAB"
|
||||
census_naics: str = "NAICS2022"
|
||||
bls_industry: str = "industry_code"
|
||||
bls_estab: str = "annual_avg_estabs"
|
||||
usda_value: str = "Value"
|
||||
county: str = "County"
|
||||
fips: str = "fips"
|
||||
unique_valid_naics: str = "Unique Valid NAICS Codes"
|
||||
missing_naics: str = "Missing NAICS"
|
||||
total_clients: str = "Total Clients"
|
||||
pct_missing_naics: str = "Percent NAICS Missing"
|
||||
county_out_of_state: str = "County Out of State"
|
||||
is_preplanning: str = "Is Preplanning"
|
||||
attendees_range: str = "Attendees Range"
|
||||
val_documented: str = "Documented"
|
||||
val_affirmation_missing: str = "Affirmation Missing"
|
||||
val_preplanning: str = "Business Start-up/Preplanning"
|
||||
|
||||
class TrainingCountColumns(ColumnMapping):
|
||||
CENTER = 'Center'
|
||||
TOTAL_EVENTS = 'Total Events'
|
||||
SELECTED_EVENTS = 'Selected Events'
|
||||
PERCENT_SELECTED_EVENTS = 'Percent Selected Events'
|
||||
|
||||
TOTAL_ATTENDEES = 'Total Attendees'
|
||||
SELECTED_ATTENDEES = 'Selected Attendees'
|
||||
PERCENT_SELECTED_ATTENDEES = 'Percent Selected Attendees'
|
||||
|
||||
SELECTED_ATTENDEES_NO_FIRST_STEPS = 'Selected Attendees No First Steps'
|
||||
PERCENT_SELECTED_ATTENDEES_NO_FIRST_STEPS = 'Percent Selected Attendees No First Steps'
|
||||
SELECTED_ATTENDEES_NO_FIRST_STEPS_NO_PREPLANNING = 'Selected Attendees No First Steps No Preplanning'
|
||||
PERCENT_SELECTED_ATTENDEES_NO_FIRST_STEPS_NO_PREPLANNING = 'Percent Selected Attendees No First Steps No Preplanning'
|
||||
|
||||
SELECTED_ATTENDEES_FIRST_STEPS_AND_PREPLANNING = 'Selected Attendees First Steps and Preplanning'
|
||||
PERCENT_SELECTED_ATTENDEES_FIRST_STEPS_AND_PREPLANNING = 'Percent Selected Attendees First Steps and Preplanning'
|
||||
SELECTED_EVENTS_FIRST_STEPS_AND_PREPLANNING = 'Selected Events First Steps and Preplanning'
|
||||
PERCENT_SELECTED_EVENTS_FIRST_STEPS_AND_PREPLANNING = 'Percent Selected Events First Steps and Preplanning'
|
||||
|
||||
SELECTED_EVENTS_NO_FIRST_STEPS = 'Selected Events No First Steps'
|
||||
PERCENT_SELECTED_EVENTS_NO_FIRST_STEPS = 'Percent Selected Events No First Steps'
|
||||
SELECTED_EVENTS_NO_PREPLANNING_NO_FIRST_STEPS = 'Selected Events No Preplanning No First Steps'
|
||||
PERCENT_SELECTED_EVENTS_NO_PREPLANNING_NO_FIRST_STEPS = 'Percent Selected Events No Preplanning No First Steps'
|
||||
|
||||
TOTAL_ONDEMAND = 'Total Ondemand'
|
||||
SELECTED_TOTAL_ONDEMAND = 'Selected Total Ondemand'
|
||||
PERCENT_SELECTED_ONDEMAND = 'Percent Selected Ondemand'
|
||||
|
||||
SELECTED_TOTAL_ONDEMAND_NO_FIRST_STEPS = 'Selected Total Ondemand No First Steps'
|
||||
SELECTED_PERCENT_ONDEMAND_NO_FIRST_STEPS = 'Selected Percent Ondemand No First Steps'
|
||||
|
||||
SELECTED_TOTAL_ONDEMAND_NO_PREPLANNING_NO_FIRST_STEPS = 'Selected Total Ondemand No Preplanning No First Steps'
|
||||
SELECTED_PERCENT_ONDEMAND_NO_PREPLANNING_NO_FIRST_STEPS = 'Selected Percent Ondemand No Preplanning No First Steps'
|
||||
|
||||
NEOSERRA_COLUMNS = NeoserraColumnNames()
|
||||
OUT_COLUMNS = OutColumnNames()
|
||||
TRAINING_COUNT_COLUMNS = TrainingCountColumns()
|
||||
4
project_constants/constants_module/constant_values.py
Normal file
4
project_constants/constants_module/constant_values.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from enum import Enum
|
||||
|
||||
class Constants(Enum):
|
||||
ON_DEMAND_VALUE = "Online Course (Prerecorded)"
|
||||
13
project_constants/pyproject.toml
Normal file
13
project_constants/pyproject.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
# dataset/pyproject.toml
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "constants_module"
|
||||
version = "0.1.0"
|
||||
description = "Internal PASBDC shared constants library to allow you to get the column names used in Neoserra"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["constants_module"]
|
||||
package-dir = {"" = "."}
|
||||
Reference in New Issue
Block a user