An open API service indexing awesome lists of open source software.

https://github.com/soumilshah1995/source-to-target-mapping-python

source to target mapping python
https://github.com/soumilshah1995/source-to-target-mapping-python

Last synced: 4 months ago
JSON representation

source to target mapping python

Awesome Lists containing this project

README

        

# source-to-target-mapping-python
-----------------------------------------------------------------------------

# Classes
![image](https://user-images.githubusercontent.com/39345855/226756761-90f80cc3-147d-47cd-9200-06a16cd75bf1.png)

#DB Design
![etl (1)](https://user-images.githubusercontent.com/39345855/226756812-782794fa-5d5f-4e11-bc1c-f343fec54cdc.png)

# Sample Input
```
json_incoming_data = {
"jobTitle": "SOFTWARE ENGINEER ",
"Salary": "70000",
"Company": "ABC "
}
```

# Source Target and Transform and Mappings
```
{
"source": [
{
"id": 1,
"source_field_name": "jobTitle",
"source_field_mapping": "$.jobTitle",
"source_field_type": "str",
"is_required": True,

},
{
"id": 2,
"source_field_name": "Salary",
"source_field_mapping": "$.Salary",
"source_field_type": "str",
"is_required": True,

}
],
"destination": [
{
"id": 1,
"destination_field_name": "job_title",
"destination_field_mapping": "job_title",
"destination_field_type": "str",
"default_value": "n/a",
},
{
"id": 2,
"destination_field_name": "salary",
"destination_field_mapping": "salary",
"destination_field_type": "float",
"default_value": "0"
}

],
"transform": [
{
"id": 1,
"transform_mask": 'CLEAN_STRING'
}

],
"mapping": [
{
"id": 1,
"mapping_source": 1,
"mapping_destination": 1,
"mapping_transform": 1
},
{
"id": 2,
"mapping_source": 2,
"mapping_destination": 2,
}
]
}

```

# sample code

```

def main():
"""incoming JSON Reader"""
json_incoming_data = {
"jobTitle": "SOFTWARE ENGINEER ",
"Salary": "70000",
"Company": "Soumil LLC "
}

helper = Client(input_json=json_incoming_data)
response = helper.get_transformed_data()

print(response)

main()

```

* Note i am mocking data from database. databse tables design are given above

# Watch Videos
* https://www.youtube.com/watch?v=dD0ldxzwZh4&t=2s
* https://www.youtube.com/watch?v=SwXWpR4iK70&feature=youtu.be

-----------------------------------------------------------------------------

* This is quite clever because it performs all data type checks and whenever the source data types change from the source table's definitions, the process or job will raise an exception. Additionally, it converts data types. For example, if you declared a string in the source and wanted to convert it to a float in the target, Python templates will do it for you automatically. it also has features where if the value is none it can replace with defult values that you specify

-----------------------------------------------------------------------------

Smart way to Capture Jobs and Process Meta Data Using DynamoDB | Project Demo | Python Templates | Alerts
https://github.com/soumilshah1995/Smart-way-to-Capture-Jobs-and-Process-Meta-Data-Using-DynamoDB-Project-Demo-Python-Templates