Skip to content

Repositório de pipelines desenvolvidas para a SMDCG (Secretaria Municipal de Defesa Civil e Geotecnia de Niterói)

Notifications You must be signed in to change notification settings

niteroi-prefeitura/pipelines_smdcg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

En | Pt-br


Logo

Pipelines repository - SMDCG | Repositório de pipelines - SMDCG

This repository aims to organize and share the pipelines developed for SMDCG - Secretaria Municipal De Defesa Civil E Geotecnia De Niterói

Esse repositório tem como objetivo organizar e compartilhar as pipelines desenvolvidas para a SMDCG - Secretaria Municipal De Defesa Civil E Geotecnia De Niterói

Report Bug

Table of contents | Súmario
  1. About The Repository | Sobre O Repositório
  2. Files | Arquivos
  3. Getting Started | Inicializando
  4. What is Prefect and how it works | O que é o Prefect e como ele funciona
  5. Contributing | Contribuindo
  6. Contact | Contato
  7. Contributors | Contribuidores

About The Repository | Sobre O Repositório

Welcome! This repository, created by the Data Office of the City of Niterói, organizes and shares the pipelines developed for Municipal Secretariat of Civil Defense and Geotechnics of Niterói.

Bem vindo(a)! Este repositório, criado pelo Escritório de Dados da Prefeitura de Niterói, organiza e compartilha as pipelines desenvolvidas para a Secretaria Municipal De Defesa Civil E Geotecnia De Niterói.

(back to top)

Built With | Desenvolvido Com

Python Prefectenv Arcgis

(back to top)

Files | Arquivos

📁 pipelines
📁 niteroi_contra_queimadas

In this folder, you’ll find two pipelines developed to update fire-related data on the Niterói Contra Queimadas HUB 🔗 niteroicontraqueimadas.niteroi.rj.gov.br

  • fire-occurrences: Automatically updates a fire incident layer on ArcGIS Online (AGOL) using data from Niterói's Civil Defense API, ensuring data synchronization and supporting operational decision-making.
  • fire_risk: Consolidates fire risk and meteorological data from Niterói's Civil Defense APIs into a record on ArcGIS Online to power a real-time alert system.

Nesta pasta estão duas pipelines desenvolvidas para atualizar dados sobre incêndios no HUB Niterói Contra Queimadas 🔗 niteroicontraqueimadas.niteroi.rj.gov.br

  • fire-occurrences: Atualiza automaticamente uma camada de ocorrências de incêndio no ArcGIS Online (AGOL) com dados da API da Defesa Civil de Niterói, garantindo sincronização e apoiando a tomada de decisões operacionais.
  • fire_risk: Consolida dados de risco de incêndio e meteorologia, recebidos das APIs da Defesa Civil de Niterói, em um registro no ArcGIS Online para alimentar um sistema de alertas em tempo real.
📁 svida

In this folder, you’ll find a pipeline that integrates Niterói's Civil Defense climate monitoring APIs with ArcGIS layers.

  • 📄 svida_integration: Integrates and updates geospatial and meteorological data — such as rain gauge locations, alert stages, emergency sirens, weather forecasts, localized climate data, public support points, and air quality alerts — from Niterói's Civil Defense APIs into ArcGIS platforms (Enterprise and AGOL), keeping layers and tables up to date in real time.

Nesta pasta está uma pipeline que integra as APIs de monitoramento climático da Defesa Civil de Niterói com camadas do ArcGIS.

  • 📄 svida_integration: Integra e atualiza dados geoespaciais e meteorológicos — como localização de pluviômetros, estágios de atenção, sirenes de emergência, previsões do tempo, dados climáticos regionais, pontos de apoio à população e alertas de qualidade do ar — a partir das APIs da Defesa Civil de Niterói nas plataformas ArcGIS (Enterprise e AGOL), mantendo camadas e tabelas atualizadas em tempo real.

(back to top)

Getting Started

Prerequisites | Pré-requisitos

Installation | Instalação

  1. Clone the repo | Clone o repositório

    git clone https://github.com/...
    
  2. Create a virtual environment with the required Python version | Crie um ambiente virtual com a versão do Python necessária

    py -3.11 -m venv nome_do_ambiente
    
    • The command above creates a virtual environment using Python version 3.11 (you must already have this version installed on your machine).

    • O comando acima cria um ambiente virtual usando a versão 3.11 do Python (é necessário já ter essa versão instalada na máquina).

  3. Active the virtual environment | Ative o ambiente virtual

    • In PowerShell | No PowerShell:
    ./nome_do_ambiente/Scripts/activate
    
    • In command prompt | No prompt de comando (CMD):
    nome_do_ambiente/Scripts/activate
    
  4. Install the dependencies to run this project | Instale as dependências do projeto:
    Run the following command | Execute o seguinte comando:

    pip install -r requirements.txt
    
  5. Create a .env local file based on the .env.example file | Crie um arquivo local .env baseado no arquivo .env.example When necessary | quando necessário

  6. Start the desired script | Rode o script desejado

    python caminho_do_arquivo/nome_do_arquivo.py
    
    python file_path/file_name.py
    

❗ NOTE: These pipelines are being executed by the Prefect Workflows manager, which saves the environment variables used. To use them locally, you will need to replace the variable values ​​as needed.

❗ OBS.: Essas pipelines estão sendo executadas pelo gerenciador de Workflows Prefect, que guarda as variáveis de âmbiente usadas. Para usar localmente será necessário que você substitua os valores das variáveis de acordo com a necessidade.

(back to top)

What is Prefect and how it works | O que é o Prefect e como ele funciona

O Prefect é uma ferramenta de orquestração de workflows que facilita a execução, o gerenciamento e o monitoramento de pipelines de dados e automações. Ele permite definir fluxos de trabalho como código Python e oferece recursos como agendamento, controle de dependências, logging e monitoramento.

Como ele executa pipelines do Github?

  1. Código salvo no Github:
    • O código do fluxo (flow) está no repositório do GitHub.
  2. Definição de um Deployment do Prefect
    • Define quando e como o fluxo será executado, indicamos no proprio código através do "@flow".
    Ex.:
    @flow(name="fluxo-svida-smdcg")
    def svida_integration_flow():

    • Ele pode ser configurado para rodar periodicamente (agendado) ou ser acionado manualmente.
  3. Conexão do Prefect com o Repositório
    • O Prefect pode buscar o código no GitHub automaticamente. Para isso, configura-se um Storage Block (GitHub block) no Prefect Cloud ou Prefect Server.
  4. Execução do Pipeline
    • Quando o fluxo é acionado (manualmente ou via agendamento), o Prefect baixa o código do GitHub e o executa na infraestrutura configurada.

(back to top)

🤝 Contributing | Contribuindo

Contributions are **greatly appreciated**! | Contribuições são **sempre bem vindas**!

If you have a suggestion that would make this project better, please fork the repo and create a pull request. You can also open an issue with the tag "enhancement".

Se você possuir alguma sugestão que possa tornar esse projeto melhor, por favor fork esse repositório e crie um pull request. Você pode também abrir um issue com a tag "enhancement".

  1. Fork the Project | Fork o Projeto
  2. Create your Feature Branch | Crie sua Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes | Commit suas mudanças (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch | Push para sua Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request | Abra um Pull Request

Thanks! Obrigado! 😄

(back to top)

Contact | Contato

Sistema de Gestão de Geoinformação - Portal SIGeo - atendimento@sigeo.niteroi.rj.gov.br

(back to top)

Contributors | Contribuidores

Made with contrib.rocks.

(back to top)

About

Repositório de pipelines desenvolvidas para a SMDCG (Secretaria Municipal de Defesa Civil e Geotecnia de Niterói)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages