import os, sys
import utils
import subprocess
from shutil import copyfile

if __name__ == "__main__":
    # Argumentos que o programa deve receber:
    # -1º: Caminho da pasta de destino

    if len(sys.argv) != 2:
        utils.print_usage()
        exit(1)

    output_path = str(sys.argv[1])
    url = 'http://dados.tce.rs.gov.br/dados/auxiliar/orgaos_auditados_rs.csv'
    path = output_path + '/orgaos/'
    if not os.path.isdir(path):
        os.mkdir(path)
    file_name = 'orgaos.csv'
    utils.download_zip(url, file_name)
    copyfile(file_name, path + file_name)
    subprocess.call(['chmod', '-R', '0777', output_path + '/orgaos/'])
    os.remove(file_name)
    
    #Threshold mode for influence models argument
    parser.add_argument('-t', action='store', dest='threshold')

    #Store file option
    parser.add_argument('-s', action='store_true', dest='s')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.usage_timelinetracing_analysis)

    #K values controls
    if not results.k:
        raise parser.error('Must to specify the k value: -k K.')

    try:
        k = int(results.k)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The k value must be an integer.")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)
import os, sys
import utils
import subprocess

if __name__ == "__main__":
    # Argumentos que o programa deve receber:
    # -1º: Ano que desejar baixar dos contratos
    print(sys.argv)
    if len(sys.argv) != 2:
        utils.print_usage("fetch_contratos.py")
        exit(1)

    year = str(sys.argv[1])
    output_path = './data/tce_rs'

    url = 'http://dados.tce.rs.gov.br/dados/licitacon/contrato/ano/' + year + '.csv.zip'
    path = output_path + '/contratos/' + year
    file_name = year + '.csv.zip'
    utils.download_zip(url, file_name)
    utils.unzip_file(file_name, path)
    subprocess.call(['chmod', '-R', '0777', output_path + '/contratos/'])
    os.remove(file_name)
Exemple #4
0
    #Plot flag for drawing or saving the histogram
    parser.add_argument('--plot', action='store_true', dest='plot')

    #Weights mode option
    parser.add_argument('-w', action='store', dest='weights')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.man_weights_analysis)

    #Year value controls
    if not results.y:
        raise parser.error('Must to specify the year value: -y Y')

    try:
        y = int(results.y)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The year value must be an integer")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)
Exemple #5
0
    #Threshold mode for influence models argument
    parser.add_argument('-t', action='store', dest='threshold')

    #Store file option
    parser.add_argument('-s', action='store_true', dest='s')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.usage_overlapmerge_analysis)

    #Year value controls
    if not results.y:
        raise parser.error('Must to specify the year value: -y Y')

    try:
        y = int(results.y)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The year value must be an integer.")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)
    #weights calculation mode useful for some rank metrics
    parser.add_argument('-w', action='store', dest='weights')

    #metrics mode useful to retrieve top k nodes
    parser.add_argument('-m', action='store', dest='m')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.usage_pagerank_analysis)

    #Year value controls
    if not results.y:
        raise parser.error('Must to specify the year value: -y Y')

    try:
        y = int(results.y)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The year value must be an integer.")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)
Exemple #7
0
import os, sys
import utils
import subprocess

if __name__ == "__main__":
    # Argumentos que o programa deve receber:
    # -1º: Ano que desejar baixar dos empenhos
    if len(sys.argv) != 2:
        utils.print_usage("fetch_empenhos.py")
        exit(1)

    year = str(sys.argv[1])
    output_path = './data/tce_rs'

    url = 'http://dados.tce.rs.gov.br/dados/municipal/empenhos/' + year + '.csv.zip'
    path = output_path + '/empenhos/' + year
    file_name = year + '.csv.zip'
    utils.download_zip(url, file_name)
    utils.unzip_file(file_name, path)
    subprocess.call(['chmod', '-R', '0777', output_path + '/empenhos/'])
    os.remove(file_name)
    
Exemple #8
0
    parser.add_argument('-ds1_p', action='store', dest='ds1_path')
    parser.add_argument('-ds2_p', action='store', dest='ds2_path')

    #Plot flag for plotting or drawing the graph drawings
    parser.add_argument('--show_ds1', action='store_true', dest='show_ds1')
    parser.add_argument('--show_ds2', action='store_true', dest='show_ds2')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.man_graphs_exploration)

    #Year value controls
    if not results.y:
        parser.error("Must be specify the the option: -y Y")

    try:
        y = int(results.y)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The year value must be an integer.")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)
Exemple #9
0
import os, sys
import utils
import subprocess

if __name__ == "__main__":
    # Argumentos que o programa deve receber:
    # -1º: Ano que desejar baixar as licitações
    # -2º: Caminho da pasta de destino
    if len(sys.argv) != 2:
        utils.print_usage("fetch_licitacoes.py")
        exit(1)

    year = str(sys.argv[1])
    output_path = './data/tce_rs'

    url = 'http://dados.tce.rs.gov.br/dados/licitacon/licitacao/ano/' + year + '.csv.zip'
    path = output_path + '/licitacoes/' + year
    file_name = year + '.csv.zip'
    utils.download_zip(url, file_name)
    utils.unzip_file(file_name, path)
    subprocess.call(['chmod', '-R', '0777', output_path + '/licitacoes/'])
    os.remove(file_name)
    
Exemple #10
0
    #Threshold mode for influence models argument
    parser.add_argument('-t', action='store', dest='threshold')

    #Store file option
    parser.add_argument('-s', action='store_true', dest='s')

    results = parser.parse_args()

    #Usage controls and settings
    if results.h and len(sys.argv) > 2:
        parser.error(
            "With the -h option it is not possible to specify other options.")

    if results.h:
        ut.print_usage(man.usage_spread_influence_analysis)

    #Year value controls
    if not results.y:
        raise parser.error('Must to specify the year value: -y Y')

    try:
        y = int(results.y)
    except ValueError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        exc_value = ValueError("The year value must be an integer.")
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stderr)