Um pacote com alguns utilitarios uteis
Project description
Ideia do Futuro - IdFtools
instalação do python
criando .venv para o python
primeiro baixar o python
no windows, no cmd do DOS:
C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python39\python.exe -m venv .venv
no windows, no gitbash:
/c/Users/$(whoami)/AppData/Local/Programs/Python/Python39/python.exe -m venv .venv
no linux, no shell
/home/$(whoami)/.pyenv/shims/python3 -m venv .venv
requirements.txt
webdriver_manager
wincertstore
undetected_chromedriver
winreg
pywin32
pyautogui
subprocess
database
json
cv2
intertools
cryptography
openpyxl
PyInstaller
pip
pandas
winreg
csv
configparser
sys
os
selenium
pyautogui
time
datetime
pytz
openpyxl
numpy
subprocess
os
sys
re
sys
os
anticaptchaofficial
psycopg2-binary
Pillow
opencv-python
img2pdf
xlsxwriter
setuptools
colorama
pyautogui
imp
dica para instalar os requirements.txt na mão
usando o gitbash
cat equirements.txt| grep -v "#" |sort|uniq | xargs -n 1 .venv/Scripts/pip3.exe install; .venv/Scripts/pip3.exe --upgrade pip ; .venv/Scripts/python.exe -m pip install --upgrade pip
usando o shell do linux
cat requirements.txt| grep -v "#" |sort|uniq | xargs -n 1 .venv/bin/pip install; .venv/bin/pip --upgrade pip ; .venv/bin/python3 -m pip install --upgrade pip
instalando
pip install idftools
atualizando
pip install --upgrade pip
pip install --upgrade idftools
importando e exemplo de uso
#exemplo
from idftools.driversfactory import DriverFactory
from idftools.utilities import Utilities
import os, sys, time
# use as funções do seu pacote
nome_robo_exec = 'teste-v1.0'
arquivo_de_config = 'src/config.ini'
self.util = Utilities(nome_robo_exec=nome_robo_exec, robo_pid_exec=os.getpid(), arquivo_de_config=arquivo_de_config)
self.logger = self.util.pega_logger_atual()
self.logger.info('Olá mundo')
self.headless = False
dir_download = 'TMP'
driverfactory = DriverFactory()
driver = driverfactory.create_driver(type='chrome', headless=self.headless, path_to_download=dir_download, install_extension=False, largura=1200, altura=900, kiosk=False, nome_robo_exec=sys.argv[0], robo_pid_exec=os.getpid(), logger=self.logger, scale_factor=0.8, posX=0, posY=0)
driver.get('http://www.google.com.br')
time.sleep(5)
self.util.saindo_driver(driver=driver, logger=self.logger)
criando e enviando para o PyPi
.venv/bin/python3 -m pip install wheel
rm -rf dist/ ; .venv/bin/python3 setup.py sdist bdist_wheel ; twine upload --skip-existing dist/*
comandos úteis
GIT
- lembre se trocar o nome do branch de acordo com a necessidade
iniciar o repo
git init
git remote add origin https://github.com/eniodefarias/pypi-idftools.git
puxar "git pull" da branch
git pull -f origin main
trocar branch main
git branch main ; git checkout main
gerar o venv
primeiro baixar o python
no windows, no cmd do DOS:
C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python39\python.exe -m venv .venv
no windows, no gitbash:
/c/Users/$(whoami)/AppData/Local/Programs/Python/Python39/python.exe -m venv .venv
no linux, no shell
/home/$(whoami)/.pyenv/shims/python3 -m venv .venv
instalar os requirements.txt na mão
usando o gitbash
cat requirements.txt| grep -v "#"|sort|uniq | xargs -n 1 .venv/Scripts/pip3.exe install ; .venv/Scripts/python.exe -m pip install --upgrade pip
usando o shell do linux
cat requirements.txt| grep -v "#"|sort|uniq | xargs -n 1 .venv/bin/pip install ; .venv/bin/python3 -m pip install --upgrade pip
atualizar modulos no Gitbash
.venv/Scripts/python.exe -m pip install PyInstaller
.venv/Scripts/python.exe -m pip install --upgrade pip
.venv/Scripts/python.exe -m pip install --upgrade idftools
enviar "git push" da branch
git add . ; git add * ; git commit -m "update: ajuste" ; git push -f origin main
executar:
terminal gitbash
.venv/Scripts/python.exe app.py
terminal shell do linux:
.venv/bin/python3 app.py
compilar:
- lembre-se de alterar o nome do executavel ".exe" e script python ".py" de acordo com a versão e script que vai compilar
terminal do pycharm
.venv/bin/python3 -m PyInstaller --onefile --paths .\venv\Lib\site-packages --icon=icone\logo_circle.ico -n app .\app.py ; rm app.exe ; mv dist/app.exe .
terminal do gitbash
set UPX= --ultra-brute --best --compress-icons#0 ; time .venv/Scripts/python.exe -m PyInstaller --upx-dir=./ --noconfirm --onefile --paths .venv/Lib/site-packages --icon=icone/logo.ico -n app app.py ; rm app.exe ; mv dist/app.exe . ; ls -latrh *.exe
links uteis
- https://coderslegacy.com/python/pyautogui-keyboard-automation/
- https://pyautogui.readthedocs.io/en/latest/quickstart.html
- https://automatetheboringstuff.com/2e/chapter20/
- https://www.bannerbear.com/blog/how-to-extract-images-from-a-video-using-ffmpeg/
- https://ottverse.com/create-video-from-images-using-ffmpeg/
- https://shotstack.io/learn/use-ffmpeg-to-convert-images-to-video/
-
- https://pyautogui.readthedocs.io/en/latest/mouse.html
- https://aoredordoburacotudoebeira.wordpress.com/?s=video
- https://crashlaker.github.io/2021/01/18/selenium_+_chromium_+_flash_+_vnc.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
idftools-0.1.182.tar.gz
(26.1 MB
view details)
Built Distribution
File details
Details for the file idftools-0.1.182.tar.gz
.
File metadata
- Download URL: idftools-0.1.182.tar.gz
- Upload date:
- Size: 26.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d373a509fc4c56802b41c1ae6598b6347162c0381155bf8e00c6162487dd003e |
|
MD5 | 06f59fecb01fdc22f32f85d503f1bcf0 |
|
BLAKE2b-256 | e7c2dd46b80c90107caec36229059639213e2b3c02d46fafc6bfb57d7cb88d26 |
File details
Details for the file idftools-0.1.182-py3-none-any.whl
.
File metadata
- Download URL: idftools-0.1.182-py3-none-any.whl
- Upload date:
- Size: 13.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc731c0db1f8ce8af32839e08a7a0312fcc39e6485da63d4317e3ce327255a1 |
|
MD5 | 1775f7826677147d050691314d25a25d |
|
BLAKE2b-256 | 10e38e86ef013522b7729dc96dea6c0b74784b102e77cd2f9b9f431fae61069f |