Commit 9dbefbb0 authored by Jomaro Rodrigues's avatar Jomaro Rodrigues

versão inicial da interface

parent 34a4afe2
......@@ -18,3 +18,4 @@ pandas = "==0.18.1"
"psycopg2" = "*"
xlrd = "*"
django-extensions = "*"
ujson = "*"
{
"_meta": {
"hash": {
"sha256": "d5214020d9299022c9d9ddb86870692f94a493490acdbf67f5bbe199a995f204"
"sha256": "d85b3d7f8d95cac4fb4d42fdc78bf7c823a2b8ec4155b20b700d7a793ae31ee6"
},
"host-environment-markers": {
"implementation_name": "cpython",
......@@ -166,6 +166,12 @@
],
"version": "==3.6.4"
},
"ujson": {
"hashes": [
"sha256:f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86"
],
"version": "==1.35"
},
"xlrd": {
"hashes": [
"sha256:83a1d2f1091078fb3f65876753b5302c5cfb6a41de64b9587b74cefa75157148",
......
#! /bin/bash
FILE=$(tail -n +2 "$1") #sem cabeçalho
head -1 $1 #cabeçalho
while read line
do
ementa=$(echo "$line" | cut -d',' -f15)
re='^[0-9]+$'
if [[ $ementa =~ $re ]] ; then
echo "$line" | cut -d',' -f1-14 --output-delimiter="," | xargs echo -n
echo -n ",,"
echo "$line" | cut -d',' -f15- --output-delimiter=","
else
echo "$line"
fi
done <<< "$FILE"
#!/usr/bin/env python
# *-* coding:utf-8
from __future__ import print_function
import pandas as pd
import sys
def shift_evasao(row):
if row['ANO_EVASAO'] in ("1o. Semestre", "2o. Semestre"):
row['PERIODO_EVASAO'] = row['ANO_EVASAO']
row['ANO_EVASAO'] = row['DT_SAIDA']
row['DT_SAIDA'] = None
return row
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
PATH = sys.argv[1]
if not PATH:
eprint('Erro: Passe o caminho do relatório de matricula dos alunos como parametro')
df = pd.read_csv(PATH)
df = df.apply(shift_evasao, axis=1)
df.to_csv(sys.stdout, sep=',', encoding='utf-8')
#!/usr/bin/env python
# *-* coding:utf-8
from __future__ import print_function
import pandas as pd
import sys
def preenhce_situacao_limpa_media_credito(row):
if row['MEDIA_CREDITO'] != 'A':
row['SITUACAO_CURRICULO'] = row['MEDIA_CREDITO']
row['MEDIA_CREDITO'] = ''
return row
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
PATH = sys.argv[1]
if not PATH:
eprint('Erro: Passe o caminho do relatório do historico dos alunos como parametro')
df = pd.read_csv(PATH)
# shifta DESCR_ESTRUTURA e ID_ESTRUTURA_CUR uma coluna para direita
df = df.rename(columns={'DESCR_ESTRUTURA': 'OLD_DESCR_ESTRUTURA'})
df = df.rename(columns={'ID_ESTRUTURA_CUR': 'DESCR_ESTRUTURA'})
df = df.rename(columns={'ID_NOTA': 'ID_ESTRUTURA_CUR'})
df['ID_NOTA'] = pd.Series()
df = df.apply(preenhce_situacao_limpa_media_credito, axis=1)
df.to_csv(sys.stdout, sep=',', encoding='utf-8')
This diff is collapsed.
#!/usr/bin/python3
'''
rodar do diretório adega, não do load_excel
'''
import re
import os
import sys
import pandas as pd
from glob import glob
from json import load as json_load
import django
sys.path.append(os.getcwd())
print(os.getcwd())
os.environ["DJANGO_SETTINGS_MODULE"] = "adega.settings"
django.setup()
from curso.models import *
from student.models import *
from disciplina.models import *
from turmaIngresso.models import *
from turma.models import *
hist = pd.read_excel('load_excel/relatorios/historico.xls', 'Planilha1')
matr = pd.read_excel('load_excel/relatorios/matricula.xls', 'Planilha1')
validos = set(hist.MATR_ALUNO.values)
bcc = Curso.objects.create(codigo='21A', ano_relatorio=2016,
semestre_relatorio=2, nome="Ciência da Computação")
g2007 = Grade.objects.create(curso=bcc, ano_inicio=2007)
g2011 = Grade.objects.create(curso=bcc, ano_inicio=2011)
with open('load_excel/data/bcc/grade2007.json') as f:
g2007_data = json_load(f)
with open('load_excel/data/bcc/grade2011.json') as f:
g2011_data = json_load(f)
for obr in g2007_data:
d = Disciplina()
d.codigo = obr['codigo']
d.nome = obr['nome']
d.carga_horaria = obr['carga_horaria']
d.creditos = obr['creditos']
d.save()
dg = DisciplinaGrade()
dg.grade = g2007
dg.disciplina = d
if 'periodo' in obr:
dg.periodo = obr['periodo']
dg.tipo_disciplina = obr['tipo']
dg.save()
for obr in g2011_data:
try:
d = Disciplina.objects.get(codigo=obr['codigo'])
except Disciplina.DoesNotExist:
d = Disciplina()
d.codigo = obr['codigo']
d.nome = obr['nome']
d.carga_horaria = obr['carga_horaria']
d.creditos = obr['creditos']
d.save()
dg = DisciplinaGrade()
dg.grade = g2011
dg.disciplina = d
if 'periodo' in obr:
dg.periodo = obr['periodo']
dg.tipo_disciplina = obr['tipo']
dg.save()
for _, student in matr.iterrows():
if student['MATR_ALUNO'] not in validos:
continue
s = Student()
s.grr = student['MATR_ALUNO']
s.name = student['NOME_PESSOA']
s.forma_evasao = student['FORMA_EVASAO']
grade = g2011
if type(student['PERIODO_EVASAO']) == str:
r = re.search('(?P<ano>\d*)/(?P<semestre>\d)', student['PERIODO_EVASAO'])
if r is None:
continue
ano, semestre = int(r.group('ano')), int(r.group('semestre'))
s.ano_evasao = ano
s.semestre_evasao = semestre
if ano < 2011:
grade = g2007
r = re.search('(?P<ano>\d*)/(?P<semestre>\d)', student['PERIODO_INGRESSO'])
ano, semestre = int(r.group('ano')), int(r.group('semestre'))
t, _ = TurmaIngresso.objects.get_or_create(ano=ano, semestre=semestre, curso=bcc)
s.turma_ingresso = t
s.grade_atual = grade
s.save()
sys.exit(0)
for _, data in hist.iterrows():
student = Student.objects.get(grr=data['MATR_ALUNO'])
disciplina = Disciplina.objects.get(codigo=data['COD_ATIV_CURRIC'])
ano = data['ANO']
try:
semestre = int(data['PERIODO'][0])
except:
semestre = 1
turma = Turma.objects.get_or_create(disciplina=disciplina, ano=ano, semestre=semestre)
t = AlunoTurma()
t.turma = turma
t.student = student
t.nota = data['MEDIA_FINAL']
t.situacao = data['SITUACAO']
t.save()
#!/usr/bin/python3
import re
import os
import sys
import pandas as pd
from glob import glob
from json import load as json_load
import django
sys.path.append(os.getcwd())
os.environ["DJANGO_SETTINGS_MODULE"] = "adega.settings"
django.setup()
from curso.models import *
from student.models import *
from disciplina.models import *
from turmaIngresso.models import *
from turma.models import *
hist = pd.read_excel('load_excel/relatorios/historico.xls', 'Planilha1')
total = hist.shape[1]
def proccess(d):
data = d[1]
try:
student = Student.objects.get(grr=data['MATR_ALUNO'])
disciplina = Disciplina.objects.get(codigo=data['COD_ATIV_CURRIC'])
except:
return
ano = data['ANO']
try:
semestre = int(data['PERIODO'][0])
except:
semestre = 1
turma, _ = Turma.objects.get_or_create(disciplina=disciplina, ano=ano, semestre=semestre)
t = AlunoTurma()
t.turma = turma
t.student = student
t.nota = data['MEDIA_FINAL']
t.situacao = data['DESCR_SITUACAO']
t.save()
count = 0
total = hist.shape[0]
for i in hist.iterrows():
proccess(i)
if count % 100 == 0:
print('{:>6} / {}'.format(count, total))
count += 1
#!/usr/bin/python3
import re
import os
import sys
import pandas as pd
from glob import glob
from json import load as json_load
import django
sys.path.append(os.getcwd())
os.environ["DJANGO_SETTINGS_MODULE"] = "adega.settings"
django.setup()
from curso.models import *
from student.models import *
from disciplina.models import *
from turmaIngresso.models import *
from turma.models import *
from student.analysis import SITUACOES_CONTRIBUEM_IRA
hist = pd.read_excel('load_excel/relatorios/historico.xls', 'Planilha1')
group = hist.groupby('MATR_ALUNO')
total = len(group)
for i, data in enumerate(group):
index, data = data[0], data[1]
try:
aluno = Student.objects.get(grr=index)
except:
continue
print("{:>5}/{}\t\t{}".format(i, total, index))
ira = data[data.DESCR_SITUACAO.isin(SITUACOES_CONTRIBUEM_IRA)].MEDIA_FINAL.mean()
aluno.ira = ira if pd.notnull(ira) else None
aluno.save()
import re
import os
import sys
import pandas as pd
import pathlib
from pathlib import Path
from glob import glob
from json import load as json_load
#import django
......
# -*- coding: utf-8 -*-
from datetime import datetime
import pprint
import pandas as pd
import json
import ujson as json
import numpy as np
from utils.situations import Situation as sit
def grafico(df,lista_disciplinas):
for disciplina in lista_disciplinas.keys() :
qtd_aluno = lista_disciplinas[disciplina]["qtd_alunos"]
......@@ -40,7 +40,8 @@ def informacoes_gerais(df,lista_disciplinas):
disciplina_dict["disciplina_codigo"] = disciplina
disciplina_dict["disciplina_nome"] = \
disciplina_df.NOME_ATIV_CURRIC.values[0]
lista_disciplinas[disciplina] = disciplina_dict
lista_disciplinas[disciplina] = disciplina_dict
def conhecimento(qtd,disciplina_dict):
conheci_df = qtd.loc[(qtd.SITUACAO == sit.SIT_CONHECIMENTO_APROVADO) |
(qtd.SITUACAO == sit.SIT_CONHECIMENTO_REPROVADO)]
......
import pandas as pd
import math
import json
import ujson as json
from utils.situations import Situation, EvasionForm
......
import re
import os
import sys
import pandas as pd
import numpy as np
from glob import glob
from json import load as json_load
from utils.situations import *
......
import os
import json
import ujson as json
try:
from django.conf import settings
......
......@@ -3,21 +3,143 @@ html {
height: 100%;
}
body {
min-height: 100%;
display: flex;
flex-direction: column;
}
#header {
}
#wrap-page {
flex-grow: 1;
}
#content {
min-height: 100px;
padding: 2em 2em 48px;
}
header {
h1#title {
color: #33d333;
font-size: 44px;
}
main {
flex-grown: 1;
.navbar-text {
color: #afb0c5 !important;
}
footer {
background-color: #263646;
border-top: 4px solid #31c2e4;
padding-top: 20px;
padding-bottom: 20px;
color: #FFF;
}
footer a {
color: #FFF;
font-size: 1.1em;
}
footer a:hover {
color: #18BC9C;
}
footer h3 {
padding-bottom: 4px;
border-bottom: 2px solid #FFF;
}
/* =================== SIDEBAR ======================== */
.sidebar {
transition: all 0.5s ease-in-out;
padding: 0;
background-color: #2f4861;
min-height: 100%;
}
.sidebar ul {
list-style:none;
margin:0;
padding:0;
}
.sidebar li,
.sidebar li div {
display: flex;
}
.sidebar li a {
flex-grow: 1;
}
.sidebar .drop {
display: inline-block;
padding: 14px 18px 12px 20px;
flex-grow: 0;
}
.rotate {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
transition: all .25s ease-in;
}
.collapsed .rotate {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
transition: all .25s ease-out;
}
.sidebar li a {
padding: 14px 0px 12px 20px;
color: #d3d5d8;
border-left: 0px solid #159e83;
text-decoration: none
}
.sidebar li li a {
padding: 8px auto;
}
.sidebar li a:hover {
color: #FFF !important;
background-color: #132940;
}
.sidebar li .sub-menu li a {
position:relative;
}
.sidebar li .sub-menu li a:hover:after {
content: "";
position: absolute;
left: -5px;
top: 0;
width: 5px;
background-color: #111;
height: 100%;
}
.sidebar .sub-menu li a:hover{
background-color:#222;
padding-left:20px;
transition: all 0.5s ease-in-out
}
.sub-menu {
border-left:5px solid #4a7d73;
}
$(document).ready(function(){
var $drops = $('.drop');
$('.sidebar').on('click', 'a.drop', function(e){
$this = $(e.target);
if($this.hasClass('rotate'))
$open = $this;
else
$open = $this.find('.rotate');
$open.toggleClass('open');
console.log("clicked");
console.log($(this));
});
$(document).on('click', function(){
$drops.removeClass('open');
});
});
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face {
font-family: 'Font Awesome 5 Brands';
font-style: normal;
font-weight: normal;
src: url("../webfonts/fa-brands-400.eot");
src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); }
.fab {
font-family: 'Font Awesome 5 Brands'; }
/*!
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face{font-family:Font Awesome\ 5 Brands;font-style:normal;font-weight:400;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:Font Awesome\ 5 Brands}
\ No newline at end of file
/*!
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 400;
src: url("../webfonts/fa-regular-400.eot");
src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); }
.far {
font-family: 'Font Awesome 5 Free';
font-weight: 400; }
/*!
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face{font-family:Font Awesome\ 5 Free;font-style:normal;font-weight:400;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-family:Font Awesome\ 5 Free;font-weight:400}
\ No newline at end of file
/*!
* Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 900;