This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import errno | |
import sqlite3 | |
import sys | |
from time import time | |
from cPickle import loads, dumps | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A very simple example to show what is required to get the excellent deform module from the Pylon's project to work with Flask. | |
DeForm is a Pylon's module capable of automatically creating HTML forms that conform to a schema of classes defined in Python through the Colander module. The transformation between Schema<-->Form data is handled by another module called Peppercorn. More information about how these three modules work together can be found at: http://docs.pylonsproject.org/projects/deform/en/latest/?awesome | |
Although DeForm is a Pylon's project, it can also operate as a stand-alone module. This Gist contains all the necessary changes to objects provided by Flask so that DeForm can serialize and deserialize data posted through a Flask.Request. | |
The basic thing that this gist is trying to demonstrate is how to derive from a Flask.Request object in order to change the data type of the Flask.Request.form object that stores the data posted by the client to the server. By default, Flask uses a MultiDict i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
class VivaReal(scrapy.Spider): | |
name= 'viva' | |
def start_requests(self): | |
yield scrapy.Request(url = 'https://glue-api.vivareal.com/v2/listings?addressCity=Volta%20Redonda&addressLocationId=BR%3ERio%20de%20Janeiro%3ENULL%3EVolta%20Redonda&addressNeighborhood=&addressState=Rio%20de%20Janeiro&addressCountry=Brasil&addressStreet=&addressZone=&addressPointLat=-22.507767&addressPointLon=-44.094613&business=SALE&facets=amenities&unitTypes=&unitSubTypes=&unitTypesV3=&usageTypes=&listingType=USED&parentId=null&categoryPage=RESULT&includeFields=search(result(listings(listing(displayAddressType%2Camenities%2CusableAreas%2CconstructionStatus%2ClistingType%2Cdescription%2Ctitle%2CunitTypes%2CnonActivationReason%2CpropertyType%2CunitSubTypes%2Cid%2Cportal%2CparkingSpaces%2Caddress%2Csuites%2CpublicationType%2CexternalId%2Cbathrooms%2CusageTypes%2CtotalAreas%2CadvertiserId%2Cbedrooms%2CpricingInfos%2CshowPrice%2Cstatus%2CadvertiserContact%2CvideoTourLink%2CwhatsappNumber%2Cstamps)%2Caccount(id%2Cn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Maureen Massey | |
Nisha Howe | |
Janice Beck | |
Gracie-Leigh Wynn | |
Mariam O'Quinn | |
Blythe Perkins | |
Maariyah Blevins | |
Leia Lutz | |
Janet Mckenna | |
Jayden-Lee Keith |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from datetime import date | |
from PIL import Image, ImageFont, ImageDraw | |
inicio = time.time() | |
with open(r'nomes_certificados.txt', 'r') as f: | |
nomes = f.read() | |
for nome in nomes.split('\n'): | |
coord_pessoa = (447, 452) | |
coord_chefe = (250, 650) | |
coord_data = (682, 652) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui | |
import pandas as pd | |
from time import sleep | |
df = pd.read_excel(r'diretorio da planilha') | |
cod_IRs = df['cod_IR'] | |
codigo_ativos = df['codigo_ativo'] | |
cnpj_empresas = df['cnpj_empresa'] | |
nome_empresas = df['nome_empresa'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui, time, sys, os, win32api, win32gui, win32con, datetime, pyHook, pythoncom | |
from optparse import OptionParser | |
''' | |
Python Automated Actions Script by Ian Mckay | |
Version 0.1 - 20151217 | |
''' | |
pyautogui.PAUSE = 0 | |
pyautogui.FAILSAFE = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class MlSpider(scrapy.Spider): | |
name = 'ml' | |
start_urls = ['https://www.mercadolivre.com.br/ofertas?page=1'] | |
def parse(self, response, **kwargs): | |
for i in response.xpath('//li[@class="promotion-item"]'): |