├── 03-01-criar-lake-database-ler-parquet.sql
├── 01-01-ler-arquivo-csv.sql
├── 01-02-ler-arquivo-csv-UTF8.sql
├── 02-02-analisar-cotacao-dolar-criar-tabela-externa.sql
├── 02-03-analisar-cotacao-dolar-criar-view.sql
├── azure-synapse-analytics-controle-versao.md
├── synapse-analytics-ler-arquivo-csv.md
├── 03-02-criar-lake-database-criar-tabela-externa-parquet.sql
├── azure-synapse-obter-municipios-formato-parquet.md
├── azure-synapse-analytics-criar-sql-database.md
├── synapse-analytics-como-criar-quanto-custa.md
├── azure-synapse-analytics-criar-lake-database.md
├── azure-synapse-analytics-integrar-power-bi.md
├── azure-synapse-analisar-cotacao-dolar.md
├── 02-01-analisar-cotacao-dolar.sql
├── azure-synapse-analytics-criar-apache-spark.md
├── azure-synapse-analytics-web-scraping.md
├── 02-analisar-cotacao-dolar-pipeline.json
├── README.md
├── 04-web-scraping.ipynb
├── 05-obter-municipios-formato-parquet.pipeline.json
└── LICENSE
/03-01-criar-lake-database-ler-parquet.sql:
--------------------------------------------------------------------------------
1 | -- This is auto-generated code
2 | SELECT
3 | TOP 100 *
4 | FROM
5 | OPENROWSET(
6 | BULK 'https://fabiomsdatalake.dfs.core.windows.net/fabiomsfilesys/ibge-municipios.parquet',
7 | FORMAT = 'PARQUET'
8 | ) AS [result]
9 |
--------------------------------------------------------------------------------
/01-01-ler-arquivo-csv.sql:
--------------------------------------------------------------------------------
1 | -- This is auto-generated code
2 | SELECT
3 | DISTINCT NO_CURSO
4 | FROM
5 | OPENROWSET(
6 | BULK 'https://fabiomsdatalake.dfs.core.windows.net/fabiomsfilesys/SUP_CURSO_2019.CSV',
7 | FORMAT = 'CSV',
8 | PARSER_VERSION = '2.0',
9 | FIELDTERMINATOR = '|',
10 | HEADER_ROW = TRUE
11 | ) WITH (
12 |
13 | [NO_CURSO] VARCHAR(4000) COLLATE Latin1_General_CI_AS
14 |
15 | ) AS [result]
16 |
--------------------------------------------------------------------------------
/01-02-ler-arquivo-csv-UTF8.sql:
--------------------------------------------------------------------------------
1 | -- This is auto-generated code
2 | SELECT
3 | TOP 100 *
4 | FROM
5 | OPENROWSET(
6 | BULK 'https://fabiomsdatalake.dfs.core.windows.net/fabiomsfilesys/OnlineRetail.csv',
7 | FORMAT = 'CSV',
8 | PARSER_VERSION = '2.0',
9 | HEADER_ROW = TRUE
10 | )
11 | WITH (
12 |
13 | StockCode VARCHAR(255) COLLATE Latin1_General_100_BIN2_UTF8,
14 | [Description] VARCHAR(255) COLLATE Latin1_General_100_BIN2_UTF8,
15 | Country VARCHAR(255) COLLATE Latin1_General_100_BIN2_UTF8,
16 | Quantity FLOAT
17 |
18 | )
19 | AS [result]
20 |
--------------------------------------------------------------------------------
/02-02-analisar-cotacao-dolar-criar-tabela-externa.sql:
--------------------------------------------------------------------------------
1 | IF NOT EXISTS (SELECT * FROM sys.external_file_formats WHERE name = 'CsvTextFormat')
2 | CREATE EXTERNAL FILE FORMAT [CsvTextFormat]
3 | WITH ( FORMAT_TYPE = DELIMITEDTEXT ,
4 | FORMAT_OPTIONS (
5 | FIELD_TERMINATOR = ';',
6 | STRING_DELIMITER = '"',
7 | USE_TYPE_DEFAULT = FALSE
8 | ))
9 | GO
10 |
11 | IF NOT EXISTS (SELECT * FROM sys.external_data_sources WHERE name = 'dsDatalake')
12 | CREATE EXTERNAL DATA SOURCE [dsDatalake]
13 | WITH (
14 | LOCATION = 'abfss://fabiomsfilesys@fabiomsdatalake.dfs.core.windows.net'
15 | )
16 | GO
17 |
18 | CREATE EXTERNAL TABLE BCB_COTACOES (
19 | [DATA] VARCHAR(10) COLLATE Latin1_General_100_BIN2_UTF8,
20 | MOEDA_COD VARCHAR(5) COLLATE Latin1_General_100_BIN2_UTF8,
21 | TIPO VARCHAR(2) COLLATE Latin1_General_100_BIN2_UTF8,
22 | SIGLA VARCHAR(3) COLLATE Latin1_General_100_BIN2_UTF8,
23 | VALOR VARCHAR(255) COLLATE Latin1_General_100_BIN2_UTF8
24 | )
25 | WITH (
26 | LOCATION = 'bcb-dolar-cotacoes.csv',
27 | DATA_SOURCE = [dsDatalake],
28 | FILE_FORMAT = [CsvTextFormat]
29 | )
30 | GO
31 |
32 |
33 | SELECT TOP 100 * FROM dbo.BCB_COTACOES
34 | GO
--------------------------------------------------------------------------------
/02-03-analisar-cotacao-dolar-criar-view.sql:
--------------------------------------------------------------------------------
1 | CREATE VIEW [dbo].[VW_BCB_COTACOES]
2 | AS
3 |
4 |
5 | WITH DATA_VALUES AS (
6 |
7 | SELECT *
8 | FROM
9 | [BCB_COTACOES]
10 |
11 | ),
12 |
13 | /* 03. Converter Tipo de Dados e uso Funções de Janela */
14 | DATA_ANALYSIS AS (
15 |
16 | SELECT
17 | *,
18 | -- Média móvel 50 dias
19 | AVG([Valor]) -- Definir o cálculo
20 | OVER(PARTITION BY Sigla ORDER BY [Data] -- Definir Over
21 | ROWS BETWEEN 49 PRECEDING AND CURRENT ROW)-- Definir Período
22 | AS dia50_media_movel,
23 |
24 | -- Média móvel 200 dias
25 | AVG([Valor]) -- Definir o cálculo
26 | OVER(PARTITION BY Sigla ORDER BY [Data] -- Definir Over
27 | ROWS BETWEEN 199 PRECEDING AND CURRENT ROW)-- Definir Período
28 | AS dia200_media_movel
29 |
30 | FROM (
31 | SELECT
32 |
33 | SIGLA,
34 | -- String para Datetime
35 | CONVERT(DATETIME, CONCAT(SUBSTRING([DATA],1,2),'-',SUBSTRING([DATA],3,2),'-',SUBSTRING([DATA],5,4)), 103) AS [DATA], --DD-MM-YYYY
36 | -- String para Numeric
37 | CONVERT(NUMERIC(18,4),REPLACE([VALOR],',','.')) AS VALOR
38 |
39 | FROM DATA_VALUES
40 | ) AS RS
41 |
42 | )
43 | /* 04. Executar a consulta */
44 | SELECT *
45 | FROM DATA_ANALYSIS
46 |
47 |
48 |
--------------------------------------------------------------------------------
/azure-synapse-analytics-controle-versao.md:
--------------------------------------------------------------------------------
1 | ## Como fazer controle de versão no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como habilitar o controle de versão dos objetos existentes do Azure Synapse Analytics associando ao repositório do Azure DevOps.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Criar pasta em repositório do Azure DevOps (REPOS, NEW FOLDER);
9 | 🔹Criar Commit das alterações (COMMIT, COMMENT, BRANCH);
10 | 🔹Configurar controle de versão no Azure Synapse (GIT CONFIGURATION);
11 | 🔹Definir a importação dos objetos existentes (IMPORT EXISTING RESOURCE);
12 | 🔹Definir ramificação de trabalho atual (WORKING BRANCH);
13 | 🔹Salvar alterações do objeto (COMMIT);
14 | 🔹Visualizar os objetos e suas alterações (REPOS, COMPARE, COMMITS).
15 |
16 | ▶️ Acesse o vídeo no link abaixo:
17 | https://www.fabioms.com.br/?url=azure-synapse-analytics-controle-versao
18 |
19 | 📁 Arquivos disponíveis no GitHub:
20 | https://www.fabioms.com.br/?url=github
21 |
22 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
23 | https://www.fabioms.com.br/?url=youtube-subscribe
24 |
25 | #microsoft #dataplatform #azure #synapseanalytics #computação #produtividade #sql #dicadofabinho
--------------------------------------------------------------------------------
/synapse-analytics-ler-arquivo-csv.md:
--------------------------------------------------------------------------------
1 | ## Como ler dados em arquivo CSV no Azure Synapse Analytics
2 |
3 |
4 |
5 | Diminuímos a curva de aprendizando utilizando o Azure Synapse Analytics para ler dados em arquivo CSV de forma simples e rápida.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Enviar arquivos do seu computador para Azure Datalake (UPLOAD);
9 | 🔹Criar script automaticamente de leitura de arquivo CSV (OPENROWSET);
10 | 🔹Definir caracter de separação de coluna (FIELDTERMINATOR);
11 | 🔹Definir primeira linha como cabeçalho (HEADER_ROW);
12 | 🔹Monitorar a quantidade de dados processados;
13 | 🔹Limitar a quantidade de dados processados por período;
14 | 🔹Enviar arquivos do seu computador pelo software Azure Storage Explorer;
15 | 🔹Definir formato de texto para UTF-8 (COLLATE);
16 | 🔹Exibir e salvar o resultado dos dados em gráfico.
17 |
18 | ✅ Acesse o vídeo no link abaixo:
19 | https://www.fabioms.com.br/?url=synapse-analytics-ler-arquivo-csv
20 |
21 | 📁 Arquivos disponíveis no GitHub:
22 | https://www.fabioms.com.br/?url=github
23 |
24 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
25 | https://www.fabioms.com.br/?url=youtube-subscribe
26 |
27 | 🎁 Banco de Dados para Estudo SQL:
28 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
29 | Contribua e cite o projeto para fortalecê-lo!
30 | https://www.fabioms.com.br/?url=github-estudados
31 |
32 | #microsoft #dataplataform #azure #synapse #analytics #sql #DicaDoFabinho
--------------------------------------------------------------------------------
/03-02-criar-lake-database-criar-tabela-externa-parquet.sql:
--------------------------------------------------------------------------------
1 | IF NOT EXISTS (SELECT * FROM sys.external_file_formats WHERE name = 'ParquetFormat')
2 | CREATE EXTERNAL FILE FORMAT [ParquetFormat]
3 | WITH ( FORMAT_TYPE = PARQUET)
4 | GO
5 |
6 | CREATE EXTERNAL TABLE IBGE_Municipios (
7 | [id] nvarchar(4000),
8 | [nome] nvarchar(4000),
9 | [microrregiao_id] nvarchar(4000),
10 | [microrregiao_nome] nvarchar(4000),
11 | [microrregiao_mesorregiao_id] nvarchar(4000),
12 | [microrregiao_mesorregiao_nome] nvarchar(4000),
13 | [microrregiao_mesorregiao_UF_id] nvarchar(4000),
14 | [microrregiao_mesorregiao_UF_sigla] nvarchar(4000),
15 | [microrregiao_mesorregiao_UF_nome] nvarchar(4000),
16 | [microrregiao_mesorregiao_UF_regiao_id] nvarchar(4000),
17 | [microrregiao_mesorregiao_UF_regiao_sigla] nvarchar(4000),
18 | [microrregiao_mesorregiao_UF_regiao_nome] nvarchar(4000),
19 | [regiao-imediata_id] nvarchar(4000),
20 | [regiao-imediata_nome] nvarchar(4000),
21 | [regiao-imediata_regiao-intermediaria_id] nvarchar(4000),
22 | [regiao-imediata_regiao-intermediaria_nome] nvarchar(4000),
23 | [regiao-imediata_regiao-intermediaria_UF_id] nvarchar(4000),
24 | [regiao-imediata_regiao-intermediaria_UF_sigla] nvarchar(4000),
25 | [regiao-imediata_regiao-intermediaria_UF_nome] nvarchar(4000),
26 | [regiao-imediata_regiao-intermediaria_UF_regiao_id] nvarchar(4000),
27 | [regiao-imediata_regiao-intermediaria_UF_regiao_sigla] nvarchar(4000),
28 | [regiao-imediata_regiao-intermediaria_UF_regiao_nome] nvarchar(4000)
29 | )
30 | WITH (
31 | LOCATION = 'ibge-municipios.parquet',
32 | DATA_SOURCE = [dsDatalake],
33 | FILE_FORMAT = [ParquetFormat]
34 | )
35 | GO
36 |
37 |
38 | SELECT TOP 100 * FROM dbo.IBGE_Municipios
39 | GO
--------------------------------------------------------------------------------
/azure-synapse-obter-municipios-formato-parquet.md:
--------------------------------------------------------------------------------
1 | ## Como ler dados no formato JSON no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como ler dados em formato JSON, obtendo os munícipios do Brasil do site IBGE e armazenando no Azure Datalake em format Parquet utilizando o Azure Synapse Analytics.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Criar pipeline com atividade de copiar dados;
9 | 🔹Configurar os dados de origem (HTTP, JSON);
10 | 🔹Obter URL dos dados no site do IBGE;
11 | Acesse por: https://servicodados.ibge.gov.br/api/docs
12 | 🔹Mapear o esquema dos dados de origem (IMPORT SCHEMA);
13 | 🔹Configurar os dados de destino (DATALAKE, PARQUET);
14 | 🔹Alguns motivos para utilização do formato Parquet;
15 | 🔹Executar e monitorar gatilho (TRIGGER);
16 | 🔹Identificar os custos da execução do pipeline (RUN CONSUMPTION);
17 | 🔹Gerar script de leitura do arquivo formato PARQUET;
18 | 🔹Mapear as colunas de destino (MAPPING).
19 |
20 | ▶️ Acesse o vídeo no link abaixo:
21 | https://www.fabioms.com.br/?url=azure-synapse-obter-municipios-formato-parquet
22 |
23 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
24 | http://www.fabioms.com.br/?url=youtube-subscribe
25 |
26 | 🎁Conheça o Projeto Banco de Dados de Estudo gratuito, disponível para comunidade no Repositório Github.
27 | http://www.fabioms.com.br/?url=github-estudados
28 |
29 | 📁 Arquivos disponíveis no GitHub, não esquece de seguir:
30 | http://www.fabioms.com.br/?url=github
31 |
32 | #microsoft #dataplatform #datamanagement #azure #synapseanalytics #pipeline #json #parquet #ibge #dataanalysis #analytics #DicadoFabinho
--------------------------------------------------------------------------------
/azure-synapse-analytics-criar-sql-database.md:
--------------------------------------------------------------------------------
1 | ## Como criar banco de dados SQL no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como utilizar a estrutura do Azure Synapse Analytics para criar o banco de dados SQL Serverless e disponibilizar os dados no Power BI.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Criar o banco de dados no SQL Pool Serverless;
9 | 🔹Gerar o script de criação de tabela externa;
10 | 🔹Definir o tratamento dos dados nulos ou vazios (USE_TYPE_DEFAULT);
11 | 🔹Código SQL para criar o objeto 'Formato do Arquivo Externo' (CREATE EXTERNAL FILE FORMAT);
12 | 🔹Código SQL para criar o objeto 'Fonte de dados Externa' (CREATE EXTERNAL DATA SOURCE);
13 | 🔹Identificar o caminlho para a fonte de dados (Azure Datalake);
14 | 🔹Código SQL para criar o objeto 'Tabela Externa' (CREATE EXTERNAL TABLE);
15 | 🔹Definir as colunas, os tipos de dados, e o formato UTF8 (COLLATE);
16 | 🔹Definir o nome do arquivo CSV para popular a tabela (LOCATION);
17 | 🔹Criar Exibição adicionando a média móvel da cotação da moeda (CREATE VIEW);
18 | 🔹Conectar o Power BI ao Azure Synapse Analytics SQL;
19 | 🔹Escolher o modo de contectividade para reduzir os custos;
20 | 🔹Exibir os dados analisando em visual de linha.
21 |
22 | ▶️ Acesse o vídeo no link abaixo:
23 | https://www.fabioms.com.br/?url=azure-synapse-analytics-criar-sql-database
24 |
25 | 📁 Arquivos disponíveis no GitHub:
26 | https://www.fabioms.com.br/?url=github
27 |
28 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
29 | https://www.fabioms.com.br/?url=youtube-subscribe
30 |
31 | #microsoft #dataplatform #azure #synapse #analytics #sql #database #DicaDoFabinho
--------------------------------------------------------------------------------
/synapse-analytics-como-criar-quanto-custa.md:
--------------------------------------------------------------------------------
1 | ## Como Criar e Quanto Custa o Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como criar, e quanto custa o recurso Azure Synapse Analytics, disponibilizando um ambiente integrado com ingestão de dados e computação em nuvem para aumentar a produtividade reduzindo a curva de aprendizado.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Localizar o recurso Azure Synapse Analytics no portal do Azure (CREATE A RESOURCE);
9 | 🔹Definir as configurações dos Grupos de Recursos (RESOURCE GROUP);
10 | 🔹Definir a criação automática do Azure Datalake e do sistema de arquivo (AZURE DATA LAKE GEN2);
11 | 🔹Definir as configurações de acesso ao Azure Synapse Analytics (AUTHENTICATION, FIREWALL);
12 | 🔹Conhecer os tipos de computação em nuvem disponíveis (T-SQL, APACHE SPARK, AZURE DATA EXPLORER);
13 | 🔹Conhecer os custos agregados aos recursos. (SERVERLESS, DEDICATED POOL).
14 |
15 | ▶️ Acesse o vídeo no link abaixo:
16 | https://www.fabioms.com.br/?url=synapse-analytics-como-criar-quanto-custa
17 |
18 | 📁 Arquivos disponíveis no GitHub, me segue por lá:
19 | https://www.fabioms.com.br/?url=github
20 |
21 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
22 | https://www.fabioms.com.br/?url=youtube-subscribe
23 |
24 | 🎁 Banco de Dados para Estudo SQL:
25 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
26 | Contribua e cite o projeto para fortalecê-lo!
27 | https://www.fabioms.com.br/?url=github-estudados
28 |
29 |
30 | #microsoft #dataplatform #azure #synapseanalytics #computação #produtividade #sql #DicaDoFabinho
--------------------------------------------------------------------------------
/azure-synapse-analytics-criar-lake-database.md:
--------------------------------------------------------------------------------
1 | ## Como criar Lake Database no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como criar o Lake Database, uma estrutura mais intuitiva que integra o melhor do Datalake com o banco de dados SQL do Azure Synapse Analytics.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹 Converter arquivo CSV para PARQUET (PYTHON, AZURE DATA STUDIO);
9 | 🔹 Upload de arquivos para o Azure Data Lake (AZURE STORAGE EXPLORER);
10 | 🔹 Criar Lake Database na estrutura do Azure Synapse Analytics (LAKE DATABASE);
11 | 🔹 Adicionar Tabela com os dados vinculados a arquivos PARQUET (LINKED SERVICE, DATALAKE, PARQUET);
12 | 🔹 Criar Script SQL de consulta da tabela (SELECT, TOP);
13 | 🔹 Alterar o Tipo de Dados para as colunas (COLUMNS, DATA TYPE);
14 | 🔹 Criar relacionamento entre as tabelas (RELATIONSHIPS, FROM TABLE, FOREIGN KEY);
15 | 🔹 Consumir os dados utilizando o Power BI (GET DATA, SQL SERVERLESS, IMPORT);
16 | 🔹 Visualizar Modelo dos dados e relacionamento entre as tabelas (POWER BI).
17 |
18 | ▶️ Acesse o vídeo no link abaixo:
19 | https://www.fabioms.com.br/?url=azure-synapse-analytics-criar-lake-database
20 |
21 | 📁 Arquivos disponíveis no GitHub:
22 | https://www.fabioms.com.br/?url=github
23 |
24 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
25 | https://www.fabioms.com.br/?url=youtube-subscribe
26 |
27 | 🎁 Banco de Dados para Estudo SQL:
28 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
29 | Contribua e cite o projeto para fortalecê-lo!
30 | https://www.fabioms.com.br/?url=github-estudados
31 |
32 | #microsft #dataplatform #azure #synapseanalytics #lakedatabase #sql #data #datatype #DicaDoFabinho
--------------------------------------------------------------------------------
/azure-synapse-analytics-integrar-power-bi.md:
--------------------------------------------------------------------------------
1 | ## Como integrar o Power BI Serviço no Azure Synapse Analytics
2 |
3 |
4 |
5 | Nesse vídeo apresentamos como integrar o Power BI Serviço no Azure Synapse Analytics utilizando a publicação de relatório existente e criando um novo dentro dessa estrutura.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Criar o Serviço Vinculado do Power BI (LINKED SERVICE);
9 | 🔹Selecionar a área de trabalho Power BI Serviço (WORKSPACE);
10 | 🔹Exibir a estrutura do Power BI Serviço no Azure Synapse Analytics (DEVELOP);
11 | 🔹Publicar relatório Power BI Desktop no Power BI Serviço (PUBLISH);
12 | 🔹Utilizar o conjunto de dados e relatório Power BI Serviço no Azure Synapse (DATASETS, REPORTS);
13 | 🔹Criar tabela externa (CREATE EXTERNAL TABLE);
14 | 🔹Criar novo conjunto de dados Power BI pelo Azure Synapse Analytics;
15 | 🔹Definir modo de conectividade do Power BI Desktop (IMPORT, SQL POOL SERVERLESS);
16 | 🔹Criar novo relatório Power BI pelo Azure Synapse Analytics (REPORT).
17 |
18 | ▶️ Acesse o vídeo no link abaixo:
19 | https://www.fabioms.com.br/?url=azure-synapse-analytics-integrar-power-bi
20 |
21 | 📁 Arquivos disponíveis no GitHub:
22 | https://www.fabioms.com.br/?url=github
23 |
24 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
25 | https://www.fabioms.com.br/?url=youtube-subscribe
26 |
27 | 🎁 Banco de Dados para Estudo SQL:
28 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
29 | Contribua e cite o projeto para fortalecê-lo!
30 | https://www.fabioms.com.br/?url=github-estudados
31 |
32 | #microsoft #dataplatform #azure #synapseanalytics #datacompute #powerbi #businessreports #datasets #sql #DicaDoFabinho
--------------------------------------------------------------------------------
/azure-synapse-analisar-cotacao-dolar.md:
--------------------------------------------------------------------------------
1 | ## Como fazer análise de Cotação do dolar no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como analisar a cotação do dolar utilizando o ambiente centralizado de funcionalidades do Azure Synapse Analytics.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Obter dados da página do Banco Central do Brasil (URL de DOWNLOAD);
9 | 🔹Criar no Synapase novo processo de copiar dados;
10 | 🔹Definir a fonte de dados de origem (HTTP);
11 | 🔹Configurar a formatação do arquivo (Delimitador da colunas);
12 | 🔹Definir a fonte de dados de destino (Azure Data Lake Gen2);
13 | 🔹Executar Pipeline (Gerenciador das atividades de cópia dos dados);
14 | 🔹Obter a URL do arquivo no Azure Datalake;
15 | 🔹Utilizar Script T-SQL para análise dos dados;
16 | 🔹Definir o formato dos dados para UTF-8;
17 | 🔹Calcular a média móvel das cotações do dolar (AVG, OVER);
18 | 🔹Converter o tipo de dados (CONVERT, SUBSTRING, NUMERIC);
19 | 🔹Visualizar o resultado em gráfico para análise Golden Cross/Death Cross.
20 |
21 | 👍Deixe seu Like para valorizar o conteúdo.
22 |
23 | ▶️ Acesse o vídeo no link abaixo:
24 | https://www.fabioms.com.br/?url=azure-synapse-analisar-cotacao-dolar
25 |
26 | 📁 Arquivos disponíveis no GitHub:
27 | https://www.fabioms.com.br/?url=github
28 |
29 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
30 | https://www.fabioms.com.br/?url=youtube-subscribe
31 |
32 | 🎁 Banco de Dados para Estudo SQL:
33 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
34 | Contribua e cite o projeto para fortalecê-lo!
35 | https://www.fabioms.com.br/?url=github-estudados
36 |
37 | #microsoft #dataplatform #azure #synapseanalytics #analytics #cotacaodolar #DicadoFabinho
--------------------------------------------------------------------------------
/02-01-analisar-cotacao-dolar.sql:
--------------------------------------------------------------------------------
1 | /* Uso de Expressão de Tabela Comum (CTE) */
2 |
3 | WITH DATA_VALUES AS (
4 | SELECT *
5 | FROM
6 | OPENROWSET(
7 | /* 01. Definir o caminho do arquivo CSV */
8 | BULK 'https://fabiomsdatalake.dfs.core.windows.net/fabiomsfilesys/bcb-dolar-cotacoes.csv',
9 | FORMAT = 'CSV',
10 | PARSER_VERSION = '2.0',
11 | FIELDTERMINATOR = ';'
12 | )
13 | WITH (
14 |
15 | /* 02. Definir formato dos dados COLLATE */
16 | [DATA] VARCHAR(10) COLLATE Latin1_General_100_BIN2_UTF8,
17 | MOEDA_COD VARCHAR(5) COLLATE Latin1_General_100_BIN2_UTF8,
18 | TIPO VARCHAR(2) COLLATE Latin1_General_100_BIN2_UTF8,
19 | SIGLA VARCHAR(3) COLLATE Latin1_General_100_BIN2_UTF8,
20 | VALOR VARCHAR(255) COLLATE Latin1_General_100_BIN2_UTF8
21 |
22 | )
23 | AS [result]
24 | ),
25 |
26 | /* 03. Converter Tipo de Dados e uso Funções de Janela */
27 | DATA_ANALYSIS AS (
28 |
29 | SELECT
30 | *,
31 | -- Média móvel 50 dias
32 | AVG([Valor]) -- Definir o cálculo
33 | OVER(PARTITION BY Sigla ORDER BY [Data] -- Definir Over
34 | ROWS BETWEEN 49 PRECEDING AND CURRENT ROW)-- Definir Período
35 | AS dia50_media_movel,
36 |
37 | -- Média móvel 200 dias
38 | AVG([Valor]) -- Definir o cálculo
39 | OVER(PARTITION BY Sigla ORDER BY [Data] -- Definir Over
40 | ROWS BETWEEN 199 PRECEDING AND CURRENT ROW)-- Definir Período
41 | AS dia200_media_movel
42 |
43 | FROM (
44 | SELECT
45 |
46 | SIGLA,
47 | -- String para Datetime
48 | CONVERT(DATETIME, CONCAT(SUBSTRING([DATA],1,2),'-',SUBSTRING([DATA],3,2),'-',SUBSTRING([DATA],5,4)), 103) AS [DATA], --DD-MM-YYYY
49 | -- String para Numeric
50 | CONVERT(NUMERIC(18,4),REPLACE([VALOR],',','.')) AS VALOR
51 |
52 | FROM DATA_VALUES
53 | ) AS RS
54 |
55 | )
56 | /* 04. Executar a consulta */
57 | SELECT *
58 | FROM DATA_ANALYSIS
59 |
60 |
--------------------------------------------------------------------------------
/azure-synapse-analytics-criar-apache-spark.md:
--------------------------------------------------------------------------------
1 | ## Como criar Apache Spark no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse vídeo como criar o Apache Spark no Azure Synapse Analytics para aumentar a capacidade de computação em nuvem nas análises dos dados.
6 |
7 | Iremos conhecer as técnicas:
8 | 🔹Definir computação Isolada das análises (ISOLATED COMPUTE);
9 | 🔹Definir o tipo de arquitetura e quantidade de processanto do instância principal (NODE SIZE, MEMORY OPTIMIZED, HARDWARE ACCELERATED);
10 | 🔹Definir dimensionamento automático (AUTOSCALE);
11 | 🔹Definir a quantidade de nós (EXECUTORS);
12 | 🔹Definir pausar automaticamente (AUTOMATIC PAUSING);
13 | 🔹Definir versão da instância Apache Spark (VERSION, PREVIEW);
14 | 🔹Habilitar a instalação de pacotes em nível de sessão (ALLOW SESSION LEVE PACKAGES);
15 | 🔹Definir etiquetas (TAGS);
16 | 🔹Visualizar e alterar configuração da instância criada (SCALE SETTINGS);
17 | 🔹Criar novo notebook anexando a instância Apache Spark (ATTACH TO);
18 | 🔹Definir a linguagem de programação do notebook (LANGUAGE);
19 | 🔹Criar células de codigo e de texto formatado (CODE, MARKDOWN);
20 | 🔹Executar notebook (RUN ALL, SESSION START);
21 | 🔹Monitorar instância Apache Spark (ALLOCATED vCores, Memory, ACTIVE APPLICATIONS)
22 | 🔹Parar a execução da sessão (STOP SESSION).
23 |
24 | ▶️ Acesse o vídeo no link abaixo:
25 | https://www.fabioms.com.br/?url=azure-synapse-analytics-criar-apache-spark
26 |
27 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
28 | https://www.fabioms.com.br/?url=youtube-subscribe
29 |
30 | 📁 Arquivos disponíveis no GitHub, não esqueça de seguir:
31 | https://www.fabioms.com.br/?url=github
32 |
33 | 🎁 Banco de Dados para Estudo SQL:
34 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
35 | Contribua e cite o projeto para fortalecê-lo!
36 | https://www.fabioms.com.br/?url=github-estudados
37 |
38 | #microsft #dataplatform #azure #synapseanalytics #apache #spark #data #DicaDoFabinho
--------------------------------------------------------------------------------
/azure-synapse-analytics-web-scraping.md:
--------------------------------------------------------------------------------
1 | ## Como Fazer Web Scraping no Azure Synapse Analytics
2 |
3 |
4 |
5 | Apresentamos nesse video como utilizar a técnica de Web Scraping para extrair dados de páginas da internet utilizando o Python no Azure Synapse Analytics.
6 |
7 | Web Scraping é um processo simples de coleta de dados existentes em páginas na internet.
8 |
9 | Com o Azure Synapse Analytics, você pode coletar facilmente dados de todas as suas páginas da Web de maneira segura e escalonável.
10 |
11 | Iremos conhecer:
12 | 🔹Utilizar notebook com instância Apache Spark anexado e linguagem de programação Python (ATTACH TO, LANGUAGE, PYSPARK)
13 | 🔹Visualizar os recursos associados a instância Apache Spark (CONFIGURE SESSION)
14 | 🔹Identificar os pacotes instalados da instância Apache Spark (PKG_RESOURCES, WORKING_SET, PRINT)
15 | 🔹Importar pacotes Python (PANDAS, REQUESTS, BEAUTIFULSOUP)
16 | 🔹Obter contéudo de página de internet (REQUESTS, HTML CODE, ELEMENTS, TABLES, ROWS, COLUMNS);
17 | 🔹Converter elementos do código HTML em lista Array (BEAUTIFULSOUP, HTML5LIB);
18 | 🔹Interagir e identificar elementos na lista Array (FIND_ALL, TABLE, FOR, ENUMERATE);
19 | 🔹Criar Dataframe (PANDAS, COLUMNS);
20 | 🔹Adicionar registros ao Dataframe (APPEND);
21 | 🔹Visualizar os dados existentes no Dataframe;
22 | 🔹Salvar os registros do Dataframe em arquivo no formato Parquet (PANDAS, TO_PARQUET, AZURE DATA LAKE STORAGE);
23 | 🔹Consultar os registros em script SQL;
24 |
25 | ▶️ Acesse o vídeo no link abaixo:
26 | https://www.fabioms.com.br/?url=azure-synapse-analytics-web-scraping
27 |
28 | 😉 Gostou do conteúdo? Inscreva-se também no canal:
29 | https://www.fabioms.com.br/?url=youtube-subscribe
30 |
31 | 🎁 Banco de Dados para Estudo SQL:
32 | Se você quer uma base para estudar liguagem #SQL ou #BusinessIntelligence, elaborar seu curso ou treinamento, aqui você encontrará material.
33 | Contribua e cite o projeto para fortalecê-lo!
34 | https://www.fabioms.com.br/?url=github-estudados
35 | #microsft #dataplatform #azure #synapseanalytics #apache #spark #python #DicaDoFabinho
--------------------------------------------------------------------------------
/02-analisar-cotacao-dolar-pipeline.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "p01_BCB_Dolar_Cotacoes",
3 | "properties": {
4 | "description": "Obter os valores de cotações do dolar do Banco Central do Brasil",
5 | "activities": [
6 | {
7 | "name": "Copy_o1e",
8 | "type": "Copy",
9 | "dependsOn": [],
10 | "policy": {
11 | "timeout": "7.00:00:00",
12 | "retry": 0,
13 | "retryIntervalInSeconds": 30,
14 | "secureOutput": false,
15 | "secureInput": false
16 | },
17 | "userProperties": [
18 | {
19 | "name": "Source",
20 | "value": "consultaBoletim.do?method=gerarCSVFechamentoMoedaNoPeriodo&ChkMoeda=61&DATAINI=01/01/2021&DATAFIM=11/04/2022"
21 | },
22 | {
23 | "name": "Destination",
24 | "value": "fabiomsfilesys//bcb-dolar-cotacoes.csv"
25 | }
26 | ],
27 | "typeProperties": {
28 | "source": {
29 | "type": "DelimitedTextSource",
30 | "storeSettings": {
31 | "type": "HttpReadSettings",
32 | "requestMethod": "GET"
33 | },
34 | "formatSettings": {
35 | "type": "DelimitedTextReadSettings",
36 | "skipLineCount": 0
37 | }
38 | },
39 | "sink": {
40 | "type": "DelimitedTextSink",
41 | "storeSettings": {
42 | "type": "AzureBlobFSWriteSettings"
43 | },
44 | "formatSettings": {
45 | "type": "DelimitedTextWriteSettings",
46 | "quoteAllText": true,
47 | "fileExtension": ".txt"
48 | }
49 | },
50 | "enableStaging": false
51 | },
52 | "inputs": [
53 | {
54 | "referenceName": "SourceDataset_o1e",
55 | "type": "DatasetReference"
56 | }
57 | ],
58 | "outputs": [
59 | {
60 | "referenceName": "DestinationDataset_o1e",
61 | "type": "DatasetReference"
62 | }
63 | ]
64 | }
65 | ],
66 | "annotations": [],
67 | "lastPublishTime": "2022-04-12T00:04:48Z"
68 | },
69 | "type": "Microsoft.Synapse/workspaces/pipelines"
70 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Azure Synapse Analytics
2 | ### **Aprender análise de dados no Azure Synapse Analytics**
3 | **Keywords:** Data Platform, Azure Synapse Analytics, Synapse Analytics, Azure Synapse, analytics service, big data, limitless analytics service, Big Data analytics, data warehousing,
4 |
5 | 😉 Gostou do conteúdo? Inscreva-se também no canal: [http://www.fabioms.com.br/?url=youtube-subscribe](http://www.fabioms.com.br/?url=youtube-subscribe)
6 |
7 | > **Youtube playlist**: [https://youtube.com/playlist?list=PL3CylihEP9UT6enQzrtzzgYWSXfAXizu7](https://youtube.com/playlist?list=PL3CylihEP9UT6enQzrtzzgYWSXfAXizu7)
8 |
9 |
10 | ## [1. Como Criar e Quanto Custa o Azure Synapse Analytics](/synapse-analytics-como-criar-quanto-custa.md)
11 | Apresentamos nesse vídeo como criar, e quanto custa o recurso Azure Synapse Analytics, disponibilizando um ambiente integrado com ingestão de dados e computação em nuvem para aumentar a produtividade reduzindo a curva de aprendizado.
12 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=synapse-analytics-como-criar-quanto-custa](http://www.fabioms.com.br/?url=synapse-analytics-como-criar-quanto-custa)
13 |
14 | ## [2. Como ler dados em arquivo CSV no Azure Synapse Analytics](/synapse-analytics-ler-arquivo-csv.md)
15 | Diminuímos a curva de aprendizando utilizando o Azure Synapse Analytics para ler dados em arquivo CSV de forma simples e rápida.
16 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=synapse-analytics-ler-arquivo-csv](http://www.fabioms.com.br/?url=synapse-analytics-ler-arquivo-csv)
17 |
18 | ## [3. Como fazer análise de Cotação do dolar no Azure Synapse Analytics](/azure-synapse-analisar-cotacao-dolar.md)
19 | Apresentamos nesse vídeo como analisar a cotação do dolar utilizando o ambiente centralizado de funcionalidades do Azure Synapse Analytics.
20 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analisar-cotacao-dolar](http://www.fabioms.com.br/?url=azure-synapse-analisar-cotacao-dolar)
21 |
22 | ## [4. Como criar banco de dados SQL no Azure Synapse Analytics](/azure-synapse-analytics-criar-sql-database.md)
23 | Como utilizar a estrutura do Azure Synapse Analytics para criar o banco de dados SQL Serverless e disponibilizar os dados no Power BI
24 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-sql-database](http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-sql-database)
25 |
26 | ## [5. Como ler dados no formato JSON no Azure Synapse Analytics](/azure-synapse-obter-municipios-formato-parquet.md)
27 | Apresentamos nesse vídeo como obter os munícipios do Brasil utilizando o Azure Synapse Analytics com extração dos dados em formato JSON na internet e armazenando no Azure Datalake em format Parquet.
28 |
29 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-obter-municipios-formato-parquet](http://www.fabioms.com.br/?url=azure-synapse-obter-municipios-formato-parquet)
30 |
31 | ## [6. Como integrar o Power BI Serviço no Azure Synapse Analytics](/azure-synapse-analytics-integrar-power-bi.md)
32 | Como integrar o Power BI Serviço no Azure Synapse Analytics utilizando a publicação de relatório dentro dessa estrutura
33 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-integrar-power-bi](http://www.fabioms.com.br/?url=azure-synapse-analytics-integrar-power-bi)
34 |
35 | ## [7. Como criar Lake Database no Azure Synapse Analytics](/azure-synapse-analytics-criar-lake-database.md)
36 | Apresentamos nesse vídeo como criar o Lake Database, uma estrutura mais intuitiva que integra o melhor do Datalake com o banco de dados SQL do Azure Synapse Analytics.
37 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-lake-database](http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-lake-database)
38 |
39 | ## [8. Como criar Apache Spark no Azure Synapse Analytics](/azure-synapse-analytics-criar-apache-spark.md)
40 | Apresentamos nesse vídeo como criar o Apache Spark no Azure Synapse Analytics para aumentar a capacidade de computação em nuvem nas análises dos dados.
41 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-apache-spark](http://www.fabioms.com.br/?url=azure-synapse-analytics-criar-apache-spark)
42 |
43 | ## [9. Como Fazer Web Scraping no Azure Synapse Analytics](/azure-synapse-analytics-web-scraping.md)
44 | Apresentamos nesse video como utilizar a técnica de Web Scraping para extrair dados de páginas da internet utilizando o Python no Azure Synapse Analytics.
45 |
46 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-web-scraping](http://www.fabioms.com.br/?url=azure-synapse-analytics-web-scraping)
47 |
48 | ## [10. Como fazer controle de versão no Azure Synapse Analytics](/azure-synapse-analytics-controle-versao.md)
49 | Como habilitar o controle de versão dos objetos existentes do Azure Synapse Analytics associando ao repositório do Azure DevOps
50 | > Assista ao vídeo: [http://www.fabioms.com.br/?url=azure-synapse-analytics-controle-versao](http://www.fabioms.com.br/?url=azure-synapse-analytics-controle-versao)
51 |
--------------------------------------------------------------------------------
/04-web-scraping.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 2,
4 | "metadata": {
5 | "kernelspec": {
6 | "name": "synapse_pyspark",
7 | "display_name": "Synapse PySpark"
8 | },
9 | "language_info": {
10 | "name": "python"
11 | },
12 | "save_output": true,
13 | "synapse_widget": {
14 | "version": "0.1",
15 | "state": {}
16 | }
17 | },
18 | "cells": [
19 | {
20 | "cell_type": "markdown",
21 | "metadata": {
22 | "nteract": {
23 | "transient": {
24 | "deleting": false
25 | }
26 | }
27 | },
28 | "source": [
29 | "# Identificar os pacotes "
30 | ]
31 | },
32 | {
33 | "cell_type": "code",
34 | "execution_count": 10,
35 | "outputs": [],
36 | "metadata": {},
37 | "source": [
38 | "#identificar os pacotes\r\n",
39 | "import pkg_resources\r\n",
40 | "for nome in pkg_resources.working_set:\r\n",
41 | " print(nome)"
42 | ]
43 | },
44 | {
45 | "cell_type": "markdown",
46 | "metadata": {
47 | "nteract": {
48 | "transient": {
49 | "deleting": false
50 | }
51 | }
52 | },
53 | "source": [
54 | "# Importar pacotes"
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": 11,
60 | "outputs": [],
61 | "metadata": {
62 | "jupyter": {
63 | "source_hidden": false,
64 | "outputs_hidden": false
65 | },
66 | "nteract": {
67 | "transient": {
68 | "deleting": false
69 | }
70 | }
71 | },
72 | "source": [
73 | "import pandas as pd # importar para criar o dataframe\r\n",
74 | "import requests # importar para consulta web\r\n",
75 | "from bs4 import BeautifulSoup as bs # importar para ler html"
76 | ]
77 | },
78 | {
79 | "cell_type": "markdown",
80 | "metadata": {
81 | "nteract": {
82 | "transient": {
83 | "deleting": false
84 | }
85 | }
86 | },
87 | "source": [
88 | "# Ler página html"
89 | ]
90 | },
91 | {
92 | "cell_type": "code",
93 | "execution_count": 12,
94 | "outputs": [],
95 | "metadata": {
96 | "jupyter": {
97 | "source_hidden": false,
98 | "outputs_hidden": false
99 | },
100 | "nteract": {
101 | "transient": {
102 | "deleting": false
103 | }
104 | }
105 | },
106 | "source": [
107 | "url = \"https://www.macrotrends.net/stocks/charts/MSFT/microsoft/stock-price-history\"\r\n",
108 | "html_data = requests.get(url).text # consulta para a página de internet\r\n",
109 | "beautiful_soup = bs(html_data, \"html5lib\") # ler e converter html em objetos"
110 | ]
111 | },
112 | {
113 | "cell_type": "markdown",
114 | "metadata": {
115 | "nteract": {
116 | "transient": {
117 | "deleting": false
118 | }
119 | }
120 | },
121 | "source": [
122 | "# Identificar tabela de dados"
123 | ]
124 | },
125 | {
126 | "cell_type": "code",
127 | "execution_count": 13,
128 | "outputs": [],
129 | "metadata": {
130 | "jupyter": {
131 | "source_hidden": false,
132 | "outputs_hidden": false
133 | },
134 | "nteract": {
135 | "transient": {
136 | "deleting": false
137 | }
138 | }
139 | },
140 | "source": [
141 | "tabelas = beautiful_soup.find_all(\"table\")\r\n",
142 | "\r\n",
143 | "for id, tabela in enumerate(tabelas):\r\n",
144 | " if (\"Historical Annual Stock Price Data\" in str(tabela)):\r\n",
145 | " tabela_id = id # obter o índice da tabela"
146 | ]
147 | },
148 | {
149 | "cell_type": "markdown",
150 | "metadata": {
151 | "nteract": {
152 | "transient": {
153 | "deleting": false
154 | }
155 | }
156 | },
157 | "source": [
158 | "# Criar Dataframe"
159 | ]
160 | },
161 | {
162 | "cell_type": "code",
163 | "execution_count": 14,
164 | "outputs": [],
165 | "metadata": {
166 | "jupyter": {
167 | "source_hidden": false,
168 | "outputs_hidden": false
169 | },
170 | "nteract": {
171 | "transient": {
172 | "deleting": false
173 | }
174 | }
175 | },
176 | "source": [
177 | "table_data = pd.DataFrame(columns=[\"Ticker\",\"Year\", \"Average\", \"Open\", \"High\", \"Low\", \"Close\" ]) #Inserir colunas no dataframe"
178 | ]
179 | },
180 | {
181 | "cell_type": "markdown",
182 | "metadata": {
183 | "nteract": {
184 | "transient": {
185 | "deleting": false
186 | }
187 | }
188 | },
189 | "source": [
190 | "# Inserir registros no Dataframe"
191 | ]
192 | },
193 | {
194 | "cell_type": "code",
195 | "execution_count": 15,
196 | "outputs": [],
197 | "metadata": {
198 | "jupyter": {
199 | "source_hidden": false,
200 | "outputs_hidden": false
201 | },
202 | "nteract": {
203 | "transient": {
204 | "deleting": false
205 | }
206 | }
207 | },
208 | "source": [
209 | "for linha in tabelas[tabela_id].tbody.find_all(\"tr\"):\r\n",
210 | " coluna = linha.find_all(\"td\")\r\n",
211 | " if (coluna !=[]):\r\n",
212 | " year = coluna[0].text\r\n",
213 | " average = coluna[1].text\r\n",
214 | " open = coluna[2].text\r\n",
215 | " high = coluna[3].text\r\n",
216 | " low = coluna[4].text\r\n",
217 | " close = coluna[5].text\r\n",
218 | "\r\n",
219 | " table_data = table_data.append(\\\r\n",
220 | " {\"Ticker\": \"MSFT\" ,\\\r\n",
221 | " \"Year\" : year, \\\r\n",
222 | " \"Average\" : average, \\\r\n",
223 | " \"Open\" : open, \\\r\n",
224 | " \"High\" : high, \\\r\n",
225 | " \"Low\" : low, \\\r\n",
226 | " \"Close\" : close}, ignore_index=True)"
227 | ]
228 | },
229 | {
230 | "cell_type": "markdown",
231 | "metadata": {
232 | "nteract": {
233 | "transient": {
234 | "deleting": false
235 | }
236 | }
237 | },
238 | "source": [
239 | "# Visualizar os Dados"
240 | ]
241 | },
242 | {
243 | "cell_type": "code",
244 | "execution_count": 16,
245 | "outputs": [],
246 | "metadata": {
247 | "jupyter": {
248 | "source_hidden": false,
249 | "outputs_hidden": false
250 | },
251 | "nteract": {
252 | "transient": {
253 | "deleting": false
254 | }
255 | }
256 | },
257 | "source": [
258 | "table_data"
259 | ]
260 | },
261 | {
262 | "cell_type": "markdown",
263 | "metadata": {
264 | "nteract": {
265 | "transient": {
266 | "deleting": false
267 | }
268 | }
269 | },
270 | "source": [
271 | "# Salvar em Arquivo Parquet"
272 | ]
273 | },
274 | {
275 | "cell_type": "code",
276 | "execution_count": 17,
277 | "outputs": [],
278 | "metadata": {
279 | "jupyter": {
280 | "source_hidden": false,
281 | "outputs_hidden": false
282 | },
283 | "nteract": {
284 | "transient": {
285 | "deleting": false
286 | }
287 | }
288 | },
289 | "source": [
290 | "table_data.to_parquet('abfss://fabiomsfilesys@fabiomsdatalake.dfs.core.windows.net/webscraping/cotacoes.parquet')"
291 | ]
292 | }
293 | ]
294 | }
--------------------------------------------------------------------------------
/05-obter-municipios-formato-parquet.pipeline.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "p02_IBGE_Municipios",
3 | "properties": {
4 | "activities": [
5 | {
6 | "name": "Municipio",
7 | "type": "Copy",
8 | "dependsOn": [],
9 | "policy": {
10 | "timeout": "7.00:00:00",
11 | "retry": 0,
12 | "retryIntervalInSeconds": 30,
13 | "secureOutput": false,
14 | "secureInput": false
15 | },
16 | "userProperties": [],
17 | "typeProperties": {
18 | "source": {
19 | "type": "JsonSource",
20 | "storeSettings": {
21 | "type": "HttpReadSettings",
22 | "requestMethod": "GET"
23 | },
24 | "formatSettings": {
25 | "type": "JsonReadSettings"
26 | }
27 | },
28 | "sink": {
29 | "type": "ParquetSink",
30 | "storeSettings": {
31 | "type": "AzureBlobFSWriteSettings"
32 | },
33 | "formatSettings": {
34 | "type": "ParquetWriteSettings"
35 | }
36 | },
37 | "enableStaging": false,
38 | "translator": {
39 | "type": "TabularTranslator",
40 | "mappings": [
41 | {
42 | "source": {
43 | "path": "$['id']"
44 | },
45 | "sink": {
46 | "name": "id",
47 | "type": "String"
48 | }
49 | },
50 | {
51 | "source": {
52 | "path": "$['nome']"
53 | },
54 | "sink": {
55 | "name": "nome",
56 | "type": "String"
57 | }
58 | },
59 | {
60 | "source": {
61 | "path": "$['microrregiao']['id']"
62 | },
63 | "sink": {
64 | "name": "microrregiao_id",
65 | "type": "String"
66 | }
67 | },
68 | {
69 | "source": {
70 | "path": "$['microrregiao']['nome']"
71 | },
72 | "sink": {
73 | "name": "microrregiao_nome",
74 | "type": "String"
75 | }
76 | },
77 | {
78 | "source": {
79 | "path": "$['microrregiao']['mesorregiao']['id']"
80 | },
81 | "sink": {
82 | "name": "microrregiao_mesorregiao_id",
83 | "type": "String"
84 | }
85 | },
86 | {
87 | "source": {
88 | "path": "$['microrregiao']['mesorregiao']['nome']"
89 | },
90 | "sink": {
91 | "name": "microrregiao_mesorregiao_nome",
92 | "type": "String"
93 | }
94 | },
95 | {
96 | "source": {
97 | "path": "$['microrregiao']['mesorregiao']['UF']['id']"
98 | },
99 | "sink": {
100 | "name": "microrregiao_mesorregiao_UF_id",
101 | "type": "String"
102 | }
103 | },
104 | {
105 | "source": {
106 | "path": "$['microrregiao']['mesorregiao']['UF']['sigla']"
107 | },
108 | "sink": {
109 | "name": "microrregiao_mesorregiao_UF_sigla",
110 | "type": "String"
111 | }
112 | },
113 | {
114 | "source": {
115 | "path": "$['microrregiao']['mesorregiao']['UF']['nome']"
116 | },
117 | "sink": {
118 | "name": "microrregiao_mesorregiao_UF_nome",
119 | "type": "String"
120 | }
121 | },
122 | {
123 | "source": {
124 | "path": "$['microrregiao']['mesorregiao']['UF']['regiao']['id']"
125 | },
126 | "sink": {
127 | "name": "microrregiao_mesorregiao_UF_regiao_id",
128 | "type": "String"
129 | }
130 | },
131 | {
132 | "source": {
133 | "path": "$['microrregiao']['mesorregiao']['UF']['regiao']['sigla']"
134 | },
135 | "sink": {
136 | "name": "microrregiao_mesorregiao_UF_regiao_sigla",
137 | "type": "String"
138 | }
139 | },
140 | {
141 | "source": {
142 | "path": "$['microrregiao']['mesorregiao']['UF']['regiao']['nome']"
143 | },
144 | "sink": {
145 | "name": "microrregiao_mesorregiao_UF_regiao_nome",
146 | "type": "String"
147 | }
148 | },
149 | {
150 | "source": {
151 | "path": "$['regiao-imediata']['id']"
152 | },
153 | "sink": {
154 | "name": "regiao-imediata_id",
155 | "type": "String"
156 | }
157 | },
158 | {
159 | "source": {
160 | "path": "$['regiao-imediata']['nome']"
161 | },
162 | "sink": {
163 | "name": "regiao-imediata_nome",
164 | "type": "String"
165 | }
166 | },
167 | {
168 | "source": {
169 | "path": "$['regiao-imediata']['regiao-intermediaria']['id']"
170 | },
171 | "sink": {
172 | "name": "regiao-imediata_regiao-intermediaria_id",
173 | "type": "String"
174 | }
175 | },
176 | {
177 | "source": {
178 | "path": "$['regiao-imediata']['regiao-intermediaria']['nome']"
179 | },
180 | "sink": {
181 | "name": "regiao-imediata_regiao-intermediaria_nome",
182 | "type": "String"
183 | }
184 | },
185 | {
186 | "source": {
187 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['id']"
188 | },
189 | "sink": {
190 | "name": "regiao-imediata_regiao-intermediaria_UF_id",
191 | "type": "String"
192 | }
193 | },
194 | {
195 | "source": {
196 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['sigla']"
197 | },
198 | "sink": {
199 | "name": "regiao-imediata_regiao-intermediaria_UF_sigla",
200 | "type": "String"
201 | }
202 | },
203 | {
204 | "source": {
205 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['nome']"
206 | },
207 | "sink": {
208 | "name": "regiao-imediata_regiao-intermediaria_UF_nome",
209 | "type": "String"
210 | }
211 | },
212 | {
213 | "source": {
214 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['regiao']['id']"
215 | },
216 | "sink": {
217 | "name": "regiao-imediata_regiao-intermediaria_UF_regiao_id",
218 | "type": "String"
219 | }
220 | },
221 | {
222 | "source": {
223 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['regiao']['sigla']"
224 | },
225 | "sink": {
226 | "name": "regiao-imediata_regiao-intermediaria_UF_regiao_sigla",
227 | "type": "String"
228 | }
229 | },
230 | {
231 | "source": {
232 | "path": "$['regiao-imediata']['regiao-intermediaria']['UF']['regiao']['nome']"
233 | },
234 | "sink": {
235 | "name": "regiao-imediata_regiao-intermediaria_UF_regiao_nome",
236 | "type": "String"
237 | }
238 | }
239 | ]
240 | }
241 | },
242 | "inputs": [
243 | {
244 | "referenceName": "IBGEMunicipiosJson",
245 | "type": "DatasetReference"
246 | }
247 | ],
248 | "outputs": [
249 | {
250 | "referenceName": "IBGEMunicipiosParquet",
251 | "type": "DatasetReference"
252 | }
253 | ]
254 | }
255 | ],
256 | "annotations": [],
257 | "lastPublishTime": "2022-04-23T16:25:42Z"
258 | },
259 | "type": "Microsoft.Synapse/workspaces/pipelines"
260 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------