Skip to main content

No project description provided

Project description

FileAutomation

This project provides a modular framework for file automation and Google Drive integration. It supports local file and directory operations, ZIP archive handling, Google Drive CRUD (create, search, upload, download, delete, share), and remote execution through a TCP Socket Server.

Features

Local File and Directory Operations

  • Create, delete, copy, and rename files
  • Create, delete, and copy directories
  • Recursively search for files by extension

ZIP Archive Handling

  • Create ZIP archives
  • Extract single files or entire archives
  • Set ZIP archive passwords
  • Read archive information

Google Drive Integration

  • Upload: single files, entire directories, to root or specific folders
  • Download: single files or entire folders
  • Search: by name, MIME type, or custom fields
  • Delete: remove files from Drive
  • Share: with specific users, domains, or via public link
  • Folder Management: create new folders in Drive

Automation Executors

  • Executor: central manager for all executable functions, supports action lists
  • CallbackExecutor: supports callback functions for flexible workflows
  • PackageManager: dynamically loads packages and registers functions into executors

JSON Configuration

  • Read and write JSON-based action lists
  • Define automation workflows in JSON format

TCP Socket Server

  • Start a TCP server to receive JSON commands and execute corresponding actions
  • Supports remote control and returns execution results

Installation and Requirements

  • Requirements
    • Python 3.9+
    • Google API Client
    • Google Drive API enabled and credentials.json downloaded

install

pip install automation_file

Usage

  1. Initialize Google Drive
from automation_file.remote.google_drive.driver_instance import driver_instance

driver_instance.later_init("token.json", "credentials.json") 
  1. Upload a File
from automation_file.remote.google_drive.upload.upload_to_driver import drive_upload_to_drive

drive_upload_to_drive("example.txt") 
  1. Search Files
from automation_file.remote.google_drive.search.search_drive import drive_search_all_file

files = drive_search_all_file()
print(files)
  1. Start TCP Server
from automation_file.utils.socket_server.file_automation_socket_server import start_autocontrol_socket_server

server = start_autocontrol_socket_server("localhost", 9943)

Example JSON Action

[
  ["FA_create_file", {"file_path": "test.txt"}],
  ["FA_drive_upload_to_drive", {"file_path": "test.txt"}],
  ["FA_drive_search_all_file"]
]

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

automation_file_dev-0.0.31.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

automation_file_dev-0.0.31-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file automation_file_dev-0.0.31.tar.gz.

File metadata

  • Download URL: automation_file_dev-0.0.31.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for automation_file_dev-0.0.31.tar.gz
Algorithm Hash digest
SHA256 83b5257786584f6e34e3cf658bf8beee75091eda66380da90cfea82ef6fce5e6
MD5 70305fcbca144590f1d9904088341b0d
BLAKE2b-256 5a9d37941ba0c8e4c653323d5631a83f4cd42c6741a28bc21e6db93177cc8a25

See more details on using hashes here.

File details

Details for the file automation_file_dev-0.0.31-py3-none-any.whl.

File metadata

File hashes

Hashes for automation_file_dev-0.0.31-py3-none-any.whl
Algorithm Hash digest
SHA256 38aae66a65260ca2a61c4331bf932722ac4726ab8324cf8b323926330d3947c1
MD5 073cf777169386c024a82203010f5f0e
BLAKE2b-256 4f104e1e55c1b29cdcba80f6ba7ae9301aacfb185daedae70b9d3e908c73aee2

See more details on using hashes here.

Supported by

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