Skip to content

Commit

Permalink
Merge pull request #1 from viniciusandrade01/feature/awstwo
Browse files Browse the repository at this point in the history
Insert file to aws
  • Loading branch information
viniciusandrade01 authored Nov 21, 2023
2 parents b44b0aa + afc3b85 commit bab69b1
Show file tree
Hide file tree
Showing 50 changed files with 32 additions and 63 deletions.
File renamed without changes.
49 changes: 0 additions & 49 deletions Log_20231103.log

This file was deleted.

Empty file added Log_20231121.log
Empty file.
46 changes: 32 additions & 14 deletions teste.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"cells": [
{
"cell_type": "code",
"execution_count": 85,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Importações\n",
"import boto3\n",
"import pandas as pd\n",
"import numpy as np\n",
"import requests as rq\n",
Expand All @@ -15,12 +16,13 @@
"import io\n",
"import os\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns"
"import seaborn as sns\n",
"from utils.aws import AboutAWS"
]
},
{
"cell_type": "code",
"execution_count": 86,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,6 +40,8 @@
"\n",
"data = datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\")\n",
"\n",
"client = AboutAWS()\n",
"\n",
"name_directory = f\"Emenda_Parlamentar_{data.split(' ')[0].replace('-','')}\"\n",
"\n",
"if not os.path.exists(name_directory):\n",
Expand All @@ -48,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 87,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -69,7 +73,7 @@
},
{
"cell_type": "code",
"execution_count": 89,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -86,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 90,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -133,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 91,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -267,7 +271,7 @@
},
{
"cell_type": "code",
"execution_count": 92,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -307,7 +311,7 @@
},
{
"cell_type": "code",
"execution_count": 93,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -438,7 +442,7 @@
},
{
"cell_type": "code",
"execution_count": 94,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -567,7 +571,7 @@
},
{
"cell_type": "code",
"execution_count": 95,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -704,7 +708,7 @@
},
{
"cell_type": "code",
"execution_count": 96,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -714,7 +718,7 @@
},
{
"cell_type": "code",
"execution_count": 97,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -751,6 +755,20 @@
"plt.savefig(f\"{name_directory}/Soma_Valor_Empenhado_e_Valor_Incristo_por_Ano.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"# Inserindo arquivos Bucket S3\n",
"\n",
"s3 = client.createClient('s3')\n",
"for arquivos in os.listdir(name_directory):\n",
" localfile = f\"{name_directory}/{arquivos}\"\n",
" client.uploadFile(s3, localfile, 'engdadostest', localfile)"
]
}
],
"metadata": {
Expand Down
Binary file modified utils/__pycache__/aws.cpython-311.pyc
Binary file not shown.
Binary file modified utils/__pycache__/logger_config.cpython-311.pyc
Binary file not shown.
Binary file modified utils/__pycache__/tools.cpython-311.pyc
Binary file not shown.

0 comments on commit bab69b1

Please sign in to comment.