Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_dev_python3_10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Dev Python3.10

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build_dev_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r dev_requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_dev_python3_11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Dev Python3.11

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build_dev_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r dev_requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_dev_python3_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Dev Python3.8

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build_dev_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r dev_requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_dev_python3_9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Dev Python3.9

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build_dev_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r dev_requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_stable_python3_10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Stable Python3.10

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build_stable_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_stable_python3_11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Stable Python3.11

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build_stable_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_stable_python3_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Stable Python3.8

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build_stable_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
31 changes: 31 additions & 0 deletions .github/workflows/file_automation_stable_python3_9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FileAutomation Stable Python3.9

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build_stable_version:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Dir Module Test
run: python ./tests/unit_test/dir/dir_test.py
- name: File Module Test
run: python ./tests/unit_test/file/test_file.py
- name: Zip Module Test
run: python ./tests/unit_test/zip/zip_test.py
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# FileAutomation

### FileAutomation

### Documentation

* TODO

---
> Project Kanban \
> https://github.com/orgs/Intergration-Automation-Testing/projects/2 \
> FileAutomation is used to manager files and dirs.


---
### Features
* Process multi file.
* copy file.
* copy specify extension file.
* copy all file to dir.
* rename file.
* remove file.
* Process multi dir.
* copy dir.
* remove dir.
* rename dir.
* create dir.
* Process zip files.
* zip a dir.
* zip a file.
* read zip file.
* unzip file on zip.
* un zip all file on zip.
* show zip info.
* show file on zip info.

## install
> pip install automation_file

## Requires
> python 3.8 or later

### Architecture Diagram


* TODO
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
automation_file_dev
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_file"
version = "0.0.1"
name = "automation_file_dev"
version = "0.0.2"
authors = [
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
automation_file
4 changes: 2 additions & 2 deletions dev.toml → stable.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_file_dev"
version = "0.0.1"
name = "automation_file"
version = "0.0.2"
authors = [
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
]
Expand Down
1 change: 0 additions & 1 deletion tests/unit_test/file/first_file_dir/test_file

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit_test/file/second_file_dir/test_file.txt

This file was deleted.

4 changes: 4 additions & 0 deletions tests/unit_test/file/test_file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from pathlib import Path

from file_automation import copy_file, copy_specify_extension_file, copy_all_file_to_dir, rename_file, remove_file
from file_automation import create_dir

create_dir(str(Path.cwd()) + "/first_file_dir")
create_dir(str(Path.cwd()) + "/second_file_dir")
create_dir(str(Path.cwd()) + "/test_file")
first_file_dir = Path(str(Path.cwd()) + "/first_file_dir")
second_file_dir = Path(str(Path.cwd()) + "/second_file_dir")
test_file_dir = Path(str(Path.cwd()) + "/test_file")
Expand Down
1 change: 0 additions & 1 deletion tests/unit_test/file/test_file/test_file

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit_test/file/test_file/test_file.test

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit_test/zip/dir_to_zip/test3.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit_test/zip/dir_to_zip/test4.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit_test/zip/file_to_zip.txt

This file was deleted.

Binary file removed tests/unit_test/zip/test.zip
Binary file not shown.
Binary file removed tests/unit_test/zip/test_generate.zip
Binary file not shown.
7 changes: 6 additions & 1 deletion tests/unit_test/zip/zip_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import time
from pathlib import Path

from file_automation import create_dir
from file_automation import zip_dir, zip_file, read_zip_file, unzip_file, unzip_all, zip_info, zip_file_info, \
set_zip_password

zip_file_path = Path(Path.cwd(), "test.zip")
dir_to_zip = Path(Path.cwd(), "dir_to_zip")
file_to_zip = Path(Path.cwd(), "file_to_zip.txt")

create_dir(str(dir_to_zip))

with open(str(file_to_zip), "w+") as file:
file.write("test")


def test_zip_dir():
zip_dir(dir_we_want_to_zip=str(dir_to_zip), zip_name="test_generate")
Expand Down