This packages crates a simple way to work with, files, folders, images and pdfs.
Project description
Files, Folders, Images and PDFs
This Python package contains 4 different classes to work with files, folder, images and pdfs in your python developements for more information about how to develop your RPA projects with python check https://automatehub.es/
1. files.py
Class to handle files. Arguments:
- file_path (str): path to the file
Attributes:
- file_path (str): path to the file
- exists (bool): whether the file exists
- file_name (str): name of the file
- byte_size (int): size of the file in bytes
- creation_datetime (datetime): datetime of the file's creation
- modification_datetime (datetime): datetime of the file's last modification
Methods:
- rename(new_file_name): renames the file
- move(new_location): moves the file to a new location
- remove(): removes the file
- copy(new_location): copies the file to a new location
- wait_for_file_to_exist(timeout=10): waits for the file to exist
2. folders.py
Class to handle folders. If folder doesn't exist it automatically creates a new one. Arguments:
- path (str) -- path to folder to be instanced.
Attributes:
- path (str) -- path to folder to be instanced.
- name (str) -- name of folder
Methods:
- rename(new_folder_name) : Rename folder
- move(new_location): move folder to new location
- remove(allow_root=False, delete_read_only=True) : remove folder and all files and folders inside
- empty(allow_root=False): delete all files and folders in folder, receives allow_root as parameter
- copy(new_location=None) : Copy folder to new location
- subfolder_list(): list of subfolders
- file_list(): list of files in folder
- download_file(url, name=None): downloads file from url
3. images.py
Image Class, heritates from File class Attributes:
- size {tuple}: size of image
- format {str}: format of image
Methods:
- rotate(): rotate image
- resize(): resize image
- crop(): crop image
- mirrorH(): mirror image horizontally
- mirrorV(): mirror image vertically
3. pdfs.py
PDF Class Heritates from File Class Arguments:
- file_path (str): Path of the file
Attributes:
- file_path (str): Path of the file
- pages (int): number of pages in the file
- info (str): info of the file
Methods:
- read_pages(page_num, encoding=None): Returns a string with the text in the page
- append(pdf_document2,merge_path): Appends a pdf document to the current document
- split(): split pdf into several pdfs.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ibott-files-1.0.6.tar.gz
(15.3 kB
view hashes)
Built Distribution
Close
Hashes for ibott_files-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 173a3868e6deef6ced32c33c921eeeda7e4c3176cc76b4c8f86dbdb8168d7f21 |
|
MD5 | 9d73cd3db8a4c1d6d2fd5d1f3d53da5e |
|
BLAKE2b-256 | 554b251eccbaf5fe6a8b16cf366a08b1c8b2a1dea3fb09e6296a13cc8c244e8b |