Skip to main content

Um pacote com alguns utilitarios uteis

Project description

wakatime

Supervisao Contabilidade e Consultoria

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

pre-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 pre-requirements.txt na mão

usando o gitbash

cat pre-requirements.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 pre-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

Supervisao Contabilidade e Consultoria

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.57.tar.gz (26.1 MB view hashes)

Uploaded Source

Built Distribution

idftools-0.1.57-py3-none-any.whl (26.1 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page