Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
43a434c
Add files via upload
Jackie-Soo Oct 29, 2024
cd2f7fb
Update exercise1.jv
Jackie-Soo Oct 29, 2024
7539720
second update exercise1.jv
Jackie-Soo Oct 29, 2024
f44275e
exe2,0
Jackie-Soo Nov 5, 2024
5389b83
Create project-plan.md
Jackie-Soo Nov 5, 2024
3a720fc
project-plan.md
Jackie-Soo Nov 5, 2024
17e53d4
Initial project-plan.md
Jackie-Soo Nov 7, 2024
7019fde
Initial project-plan.md 2,0
Jackie-Soo Nov 7, 2024
82d563f
Initial project-plan.md 3,0
Jackie-Soo Nov 7, 2024
14b6ca7
Update project-plan.md
Jackie-Soo Nov 10, 2024
4ef18ce
Update project-plan.md
Jackie-Soo Nov 10, 2024
e83f947
Project3
Jackie-Soo Nov 12, 2024
540158e
Create pipeline.py
Jackie-Soo Nov 12, 2024
a47e817
Rename pipeline.py to pipeline.sh
Jackie-Soo Nov 12, 2024
6570a81
Update project-plan.md
Jackie-Soo Nov 12, 2024
d79ae4f
ex3 1,0
Jackie-Soo Nov 17, 2024
c73e136
ex3 2,0
Jackie-Soo Nov 17, 2024
3510d50
ex3 3,0
Jackie-Soo Nov 17, 2024
28243d8
Update project3.py
Jackie-Soo Nov 24, 2024
3000966
Update pipeline.sh
Jackie-Soo Nov 24, 2024
9b8718e
Update project3.py
Jackie-Soo Nov 27, 2024
cc84741
Add files via upload
Jackie-Soo Nov 27, 2024
2f656f9
Update project3.py
Jackie-Soo Nov 27, 2024
2c4d579
exe4,1
Jackie-Soo Dec 1, 2024
be14c4c
exercise4,2
Jackie-Soo Dec 1, 2024
6776832
exe4,3
Jackie-Soo Dec 1, 2024
4abe7ab
Add files via upload
Jackie-Soo Dec 1, 2024
5aa0527
Create tests.sh
Jackie-Soo Dec 1, 2024
70c98c4
Update system-test.py
Jackie-Soo Dec 1, 2024
fbded1b
Update system-test.py
Jackie-Soo Dec 2, 2024
a0290ae
Create run-project3.yml
Jackie-Soo Dec 8, 2024
b7775fc
Update run-project3.yml
Jackie-Soo Dec 9, 2024
a1b5072
Add files via upload
Jackie-Soo Dec 9, 2024
34cae16
Update requirements.txt
Jackie-Soo Dec 9, 2024
bd300a2
Update run-project3.yml
Jackie-Soo Dec 9, 2024
b05957b
Update run-project3.yml
Jackie-Soo Dec 9, 2024
7b07b69
Update requirements.txt
Jackie-Soo Dec 9, 2024
3732346
Update run-project3.yml
Jackie-Soo Dec 9, 2024
44de32c
Update project3.py
Jackie-Soo Dec 9, 2024
7762536
Update run-project3.yml
Jackie-Soo Dec 9, 2024
fc5e2b1
Update project3.py
Jackie-Soo Dec 11, 2024
918ed4b
Update tests.sh
Jackie-Soo Dec 11, 2024
9753261
Update and rename system-test.py to system_test.py
Jackie-Soo Dec 11, 2024
dbec13c
Update project3.py
Jackie-Soo Dec 11, 2024
4237de2
Update project3.py
Jackie-Soo Dec 11, 2024
7c1f488
Create tests.yml
Jackie-Soo Dec 11, 2024
6c85ad5
Update tests.yml
Jackie-Soo Dec 11, 2024
e6c75cb
Update tests.yml
Jackie-Soo Dec 11, 2024
765f87f
Update system_test.py
Jackie-Soo Dec 11, 2024
be2b4ee
Update tests.sh
Jackie-Soo Dec 11, 2024
fc8f71c
Update tests.sh
Jackie-Soo Dec 11, 2024
57fcc42
Update pipeline.sh
Jackie-Soo Dec 11, 2024
9d367eb
Update pipeline.sh
Jackie-Soo Dec 11, 2024
a8c7f4e
Update tests.yml
Jackie-Soo Dec 11, 2024
4b0a012
exe5,0
Jackie-Soo Dec 14, 2024
5b8ea4c
exe5,1
Jackie-Soo Dec 15, 2024
3bf6575
exe5,2
Jackie-Soo Dec 15, 2024
29f1ec7
exe5,3
Jackie-Soo Dec 15, 2024
4c81108
Add files via upload
Jackie-Soo Jan 9, 2025
16b9881
Add files via upload
Jackie-Soo Jan 9, 2025
8cbbe9e
Create LICENSE
Jackie-Soo Jan 17, 2025
8f92c3f
Update README.md
Jackie-Soo Jan 17, 2025
62c8bde
Update README.md
Jackie-Soo Jan 17, 2025
589bc60
Update README.md
Jackie-Soo Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/run-project3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Project3

on:
push:
branches:
- main
paths:
- project/project3.py # only files under project directory will activate this action
workflow_dispatch: # Manual activation possible

jobs:
run-project3:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r project/requirements.txt

- name: Start to run project3
env:
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}
run: |
python project/project3.py

- name: output
uses: actions/upload-artifact@v3
with:
name: database_and_logging
path: ./data

42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Project3 Tests

on:
push:
branches:
- main # for every push to main
workflow_dispatch:

jobs:
test-system:
runs-on: ubuntu-latest

steps:
# check code
- name: Checkout repository
uses: actions/checkout@v3

# set up environment
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

# install all dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r project/requirements.txt

- name: Make tests.sh executable
run: chmod +x project/tests.sh

# run tests.sh
- name: Run tests
run: ./project/tests.sh

- name: Upload project3.log
if: always() # save the logging anyways
uses: actions/upload-artifact@v3
with:
name: project3-log
path: ./data
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International

made-template © 2025 by Zhijian Su is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/

You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:
Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes .
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .

No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ Grading Exercise 1
Shape: 4 of 4
Types: 13 of 13
```
## A visual analysis of the security situation and potential crime influencing factors in California‘s cities
California is not only the most economically developed state in the U.S., but also the most populous state in the U.S. Its stunning scenery, booming economy, advanced technology and excellent educational resources combine to attract visitors from all over the world. While the security situation in California is an important consideration for people before traveling, California's security situation presents complexity. In this regard, this project puts forward the following questions to study the security situation in California cities and tries to answer them through data engineering methods:
1. What types of crimes are most common in all California cities? Is there a type of crime that is
predominant in most cities?
2. Which cities in California have the highest crime rate (per 100000 residents)?
3. Do all California cities have similar ratios of the number of law enforcement officers to the number
of crimes? Or are the ratios of the number of law enforcement to the population similar?
4. Do California cities with higher median household incomes or high school graduation rates have
lower crime rates?
5. Do cities with high poverty rates have higher crime rates?

The answers to these questions can provide a safety index for people who want to travel or settle in California, and can also help policymakers and government officials develop personalized crime prevention measures in specific cities. See [analysis-report.pdf](https://github.com/Jackie-Soo/made-template/blob/Jackie-Soo-patch-1/project/analysis-report.pdf) for details.

## License
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
See the [LICENSE](https://github.com/Jackie-Soo/made-template/blob/Jackie-Soo-patch-1/LICENSE) file for details.
47 changes: 47 additions & 0 deletions exercises/exercise1.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

pipeline AirportsPipeline {

AirportsExtractor
-> AirportsTextFileInterpreter
-> AirportsCSVInterpreter

-> AirportsTableInterpreter
-> AirportsLoader;

block AirportsExtractor oftype HttpExtractor {

url: "https://opendata.rhein-kreis-neuss.de/api/explore/v2.1/catalog/datasets/rhein-kreis-neuss-flughafen-weltweit/exports/csv?lang=en&timezone=Europe%2FBerlin&use_labels=true&delimiter=%3B";
}

//interpretes a binary file into a text file
block AirportsTextFileInterpreter oftype TextFileInterpreter { }

//enclosing defines what character surrounds a value, while delimiter defines what separate each value
block AirportsCSVInterpreter oftype CSVInterpreter {
delimiter: ';';
}


block AirportsTableInterpreter oftype TableInterpreter {
header: true;
columns: [

"Lfd. Nummer" oftype integer,
"Name des Flughafens" oftype text,
"Ort" oftype text,
"Land" oftype text,
"IATA" oftype text,
"ICAO" oftype text,
"Latitude" oftype decimal,
"Longitude" oftype decimal,
"Altitude" oftype integer

];
}

block AirportsLoader oftype SQLiteLoader {
table: "airports";
file: "./airports.sqlite";
}

}
58 changes: 58 additions & 0 deletions exercises/exercise2.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

valuetype coordinate oftype text {
constraints: [HundredScale];
}

constraint HundredScale oftype RegexConstraint {
regex: /^(?:\d{1,3})\.(?:\d+),\s*(?:\d{1,3})\.(?:\d+)$/;
}

valuetype vor_init oftype text {
constraints: [Vogelsang];
}

constraint Vogelsang oftype RegexConstraint {
regex: /^(Vogelsang).*$/;
}

pipeline TreesPipeline {

TreesExtractor
-> TreesTextFileInterpreter
-> TreesCSVInterpreter
-> TreesTableInterpreter
-> TreesLoader;

block TreesExtractor oftype HttpExtractor {

url: "https://opendata.rhein-kreis-neuss.de/api/v2/catalog/datasets/stadt-neuss-herbstpflanzung-2023/exports/csv";
}

//interpretes a binary file into a text file
block TreesTextFileInterpreter oftype TextFileInterpreter { }

//enclosing defines what character surrounds a value, while delimiter defines what separate each value
block TreesCSVInterpreter oftype CSVInterpreter {
delimiter: ';';
}


block TreesTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"lfd_nr" oftype integer,
"stadtteil" oftype vor_init, //Start with Vogelsang
"standort" oftype text,
"baumart_botanisch" oftype text,
"id" oftype coordinate, //{geo-coordinate 1}, {geo-coordinate 2}, geo-coordiate format{1-3 numbers}.{numbers}
"baumfamilie" oftype text

];
}

block TreesLoader oftype SQLiteLoader {
table: "trees";
file: "./trees.sqlite";
}

}
124 changes: 124 additions & 0 deletions exercises/exercise3.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
valuetype GDP oftype decimal {
constraints: [ GDPRange ];
}

constraint GDPRange on decimal:
value > 0;

valuetype Share oftype decimal {
constraints: [ ShareRange ];
}

constraint ShareRange oftype RangeConstraint {
lowerBound: 0;
lowerBoundInclusive: true;
upperBound: 1;
upperBoundInclusive: true;
}

pipeline CsPipeline1 {

CsExtractor
-> CsXLSXInterpreter
-> CsSheetPicker
-> CsHeaderWriter1
-> CsHeaderWriter2
-> CsDataSelector // should be after headerwriter
-> CsTableInterpreter
-> CsLoader;

block CsExtractor oftype HttpExtractor {
url: "https://thedocs.worldbank.org/en/doc/7d852628d96b9411d43e5d36d5dff941-0050062022/original/Graphs-Chapter-5-02082022.xlsx";
}

//interpretes a file into a XLSX file
block CsXLSXInterpreter oftype XLSXInterpreter { }

//Selects the Sheet from the XLSX Workbook
block CsSheetPicker oftype SheetPicker {
sheetName: "Figure S5.1.2";
}

//Selects a subset of a Sheet
block CsDataSelector oftype CellRangeSelector {
select: range P2:S45;
}

//Rename the cells
block CsHeaderWriter1 oftype CellWriter {
at: cell P2;
write: ["Country Code"];
}
block CsHeaderWriter2 oftype CellWriter {
at: cell S2;
write: ["Bond Issuance Share"];
}

block CsTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"Country Code" oftype CountryCodeAlpha3, // Jayvee 0.6.4 has a CountryCodeAlpha3 value type
"Bond Issuance Share" oftype Share
];
}

block CsLoader oftype SQLiteLoader {
table: "bondIssuance";
file: "./country-stats.sqlite";
}

}
// build two pipelines

pipeline CsPipeline2 {

CsExtractor
-> CsXLSXInterpreter
-> CsSheetPicker
-> CsHeaderWriter1
-> CsHeaderWriter2
-> CsDataSelector // should be after headerwriter
-> CsTableInterpreter
-> CsLoader;

block CsExtractor oftype HttpExtractor {
url: "https://thedocs.worldbank.org/en/doc/7d852628d96b9411d43e5d36d5dff941-0050062022/original/Graphs-Chapter-5-02082022.xlsx";
}

//interpretes a file into a XLSX file
block CsXLSXInterpreter oftype XLSXInterpreter { }

//Selects the Sheet from the XLSX Workbook
block CsSheetPicker oftype SheetPicker {
sheetName: "Figure S5.1.2";
}

//Selects a subset of a Sheet
block CsDataSelector oftype CellRangeSelector {
select: range P2:S45;
}

//Rename the cells
block CsHeaderWriter1 oftype CellWriter {
at: cell P2;
write: ["Country Code"];
}
block CsHeaderWriter2 oftype CellWriter {
at: cell R2;
write: ["GDP per Capita"];
}

block CsTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"Country Code" oftype CountryCodeAlpha3,
"GDP per Capita" oftype GDP
];
}

block CsLoader oftype SQLiteLoader {
table: "gdpPerCapita";
file: "./country-stats.sqlite";
}

}
Loading