-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: joyakis <[email protected]>
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: process-json-file | ||
|
||
on: | ||
# Run the workflow every day at 6:00am UTC | ||
schedule: | ||
- cron: "0 6 * * *" | ||
|
||
jobs: | ||
process-json: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the code from the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Install Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
# Install dependencies | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
# Run the Python script to process the JSON file | ||
- name: Process JSON file | ||
run: python data.py | ||
|
||
# Commit changes to the repository | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name "Your Name" | ||
git config --global user.email "[email protected]" | ||
git add processed_data.json | ||
git commit -m "Process data" | ||
# Push changes to the remote repository | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
geopandas | ||
matplotlib | ||
pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
|
||
# Read in the JSON data | ||
with open('KEN_AL2_Kenya_GEZ.json', 'r') as f: | ||
data = json.load(f) | ||
|
||
# Process the data | ||
processed_data = [] | ||
for item in data: | ||
# Perform some transformation on the data | ||
processed_item = { | ||
'name': item['name'], | ||
'age': item['gez_code'] * 2 | ||
} | ||
processed_data.append(processed_item) | ||
|
||
# Write the processed data to a new JSON file | ||
with open('processed_data.json', 'w') as f: | ||
json.dump(processed_data, f) |