Skip to content

Instantly share code, notes, and snippets.

View Lucs1590's full-sized avatar
🤜
Hard Work!

Lucas Brito Lucs1590

🤜
Hard Work!
View GitHub Profile
@Lucs1590
Lucs1590 / get_scholar_articles.py
Created January 7, 2022 03:25
Script to get Articles from google scholar, browsing through all the pages of the searched topic.
import csv
import requests
import time
from lxml import html
title_list = []
author_list = []
def get_authors(element):
@Lucs1590
Lucs1590 / launch.json
Created August 4, 2021 16:57
Launch to nodemon.
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/server.js",
"restart": true,
@Lucs1590
Lucs1590 / translate_neo4j.py
Created July 5, 2021 01:09
This is a test, in which I try to put in a neo4j database, data translated from a json document (with 700,000 data).
import requests
from py2neo import Graph, Node
from time import time
import json
import re
def main():
t1 = time()
connection = connect_database()
@Lucs1590
Lucs1590 / boto.py
Created July 5, 2021 00:47
This is a repository to make tests with AWS S3 connection.
import boto3
import uuid
def create_bucket_name(bucket_prefix):
# The generated bucket name must be between 3 and 63 chars long
return ''.join([bucket_prefix, str(uuid.uuid4())])
def create_bucket(bucket_prefix, s3_connection):
@Lucs1590
Lucs1590 / remove_lines.py
Created April 2, 2021 17:02
Functions used to remove lines of an image.
def remove_lines(image, colors):
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
bin_image = cv2.threshold(
gray_image, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
h_contours = get_contours(bin_image, (25, 1))
v_contours = get_contours(bin_image, (1, 25))
for contour in h_contours:
cv2.drawContours(image, [contour], -1, colors[0][0], 2)
@Lucs1590
Lucs1590 / nkocr_usage.py
Last active January 25, 2024 21:58
This is a snippet of code that use Nkocr to read nutrition facts.
from nkocr import OcrTable
text = OcrTable("paste_image_url_here")
print(text) # or print(text.text)
@Lucs1590
Lucs1590 / remove.py
Created April 25, 2020 19:17
This is a code to remove a lot of things using Python 3
import os
import glob
import pandas as pd
def main():
data = pd.read_csv('/path/of/txt/', sep=" ", header=None)[0].values.tolist()
caminho = "/path/of/files"
finded = 0
deleted = 0
@Lucs1590
Lucs1590 / decision_tree.py
Created October 22, 2019 01:55
Plotagem de arvore de decisão a partir do dataset de iris
import sklearn.datasets as datasets
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO
from IPython.display import Image
from sklearn.tree import export_graphviz
import pydotplus
iris = datasets.load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
__author__ = 'sidharthgoyal'
import math
increment = 0.1
startingPoint = [1, 1]
point1 = [1,5]
point2 = [6,4]
point3 = [5,2]
point4 = [2,1]
@Lucs1590
Lucs1590 / gerar_nos.py
Created September 5, 2019 20:03
Esse código separa os ribossomos de uma sequencia de DNA
def gerar_nos(seq, arr= []):
seq = list(seq)
saida_array = seq[:3]
arr.append(''.join(saida_array))
if len(seq) == 3:
return arr
seq.pop(0)
return gerar_nos(seq)