Repository: codeperfectplus/movens (language: python)

Issue:
Initialzing pypi version
## Changelog

1. Initial files for workflow added
2. Initial files for the first PyPI version created
3. Changed file mover module for PyPI
4. Changelog file created.

The `start` function name needs to change to something else.

1. tested the module on CLI as well.
2. After writing the test cases. Version 1.0.5 will release. The previous versions are available on [Github Release](https://github.com/Py-Contributors/FileMover/releases)

Flake8 is not working locally due to some issues. will fix in the next PR.


Discussion / hints:

Fix patch:
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..73669d2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,25 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: bug
+assignees: ''
+
+---
+**Are you using latest code**
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Pythonversion**
+ - Python version
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..4bb9cbc
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,18 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: enhancement
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
diff --git a/.github/ISSUE_TEMPLATE/update-documentation.md b/.github/ISSUE_TEMPLATE/update-documentation.md
new file mode 100644
index 0000000..ba25282
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/update-documentation.md
@@ -0,0 +1,11 @@
+---
+name: Update Documentation
+about: Describe this issue template's purpose here.
+title: ''
+labels: documentation, enhancement
+assignees: ''
+
+---
+
+**Short introduction what you want to change in README.md **
+example:- code change, outdated Readme
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..276ab3a
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,16 @@
+
+# Pull Request Template
+
+**What have you Changed**
+
+what you changed in the codebase.write here
+
+
+### Issue No. closes #
+
+### Self Check(Tick After Making pull Request)
+
+- [ ] One Change in one Pull Request
+- [ ] I am following clean code and Documentation and my code is well linted with flake8.
+
+Join Us on Discord:- https://discord.gg/JfbK3bS
diff --git a/.github/workflows/auto_close_empty_issues.yml b/.github/workflows/auto_close_empty_issues.yml
new file mode 100644
index 0000000..a6334d6
--- /dev/null
+++ b/.github/workflows/auto_close_empty_issues.yml
@@ -0,0 +1,20 @@
+# GitHub Action that uses close-issue auto-close empty issues after they are opened.
+# If the issue body text is empty the Action auto-closes it and sends a notification.
+# Otherwise if the issue body is not empty, it does nothing and the issue remains open.
+# https://github.com/marketplace/actions/close-issue
+
+name: auto_close_empty_issues
+on:
+  issues:
+    types: [opened]
+jobs:
+  check-issue-body-not-empty:
+    runs-on: ubuntu-latest
+    steps:
+      - if: github.event.issue.body == 0
+        name: Close Issue
+        uses: peter-evans/close-issue@v1
+        with:
+          comment: |
+            Issue body must contain content.
+            Auto-closing this issue.
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000..cd1e8f2
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,55 @@
+name: "CodeQL"
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+  schedule:
+    - cron: '0 9 * * 5'
+
+jobs:
+  analyze:
+    name: Analyze
+    runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        # Override automatic language detection by changing the below list
+        # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
+        language: ['python']
+        # Learn more...
+        # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v2
+
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v1
+      with:
+        languages: ${{ matrix.language }}
+        # If you wish to specify custom queries, you can do so here or in a config file.
+        # By default, queries listed here will override any specified in a config file.
+        # Prefix the list here with "+" to use these queries and those in the config file.
+        # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild@v1
+
+    # ℹ️ Command-line programs to run using the OS shell.
+    # 📚 https://git.io/JvXDl
+
+    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+    #    and modify them (or add more) to build your code if your project
+    #    uses a compiled language
+
+    #- run: |
+    #   make bootstrap
+    #   make release
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..ec7a124
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,21 @@
+name: Publish package to PyPI
+on: push
+jobs:
+ build-and-publish:
+  name: Build and Publish to PyPI
+  runs-on: ubuntu-latest
+  if: startsWith(github.ref, 'refs/tags')
+  steps:
+    - uses: actions/checkout@v2
+    - name: Use Python 3.8
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.8
+    - name: Run setup
+      run: >-
+        python setup.py sdist
+    - name: Publish distribution to PyPI
+      uses: pypa/gh-action-pypi-publish@master
+      with:
+        user: __token__
+        password: ${{ secrets.pypi_password }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..10a4188
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,29 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [1.0.5] - 02-11-2022
+
+- PYPI package is now available
+- Only create required directories
+- Package can be updated from Github action workflow
+
+## [1.0.4] - 04-07-2022
+
+- code refactoring
+- bug fixes
+
+## [1.0.3] - 23-09-2020
+
+- Bug Fixed
+
+## [1.0.2] - 22-09-2020
+
+- New Extension Added
+- Bug Fixed
+
+
+## [Initial Release] - 13/05/2020
+
+- Initial Release
+ 
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..b7954f8
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at pycontributors@gmail.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..2cd7bfe
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,79 @@
+# Contributing to Filemover
+
+We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
+
+- Reporting a bug
+- Discussing the current state of the code
+- Submitting a fix
+- Proposing new features
+- Becoming a maintainer
+
+## Steps to contribute
+
+- Comment on the issue you want to work on. Make sure it's not assigned to someone else.
+
+### Making a PR
+
+> - Make sure you have been assigned the issue to which you are making a PR.
+> - If you make PR before being assigned, It may be labeled `invalid` and closed without merging.
+
+- Fork the repo and clone it on your machine.
+- Add a upstream link to main branch in your cloned repo
+
+    ```sh
+    git remote add upstream https://github.com/py-contributors/filemover.git
+    ```
+
+- Keep your cloned repo upto date by pulling from upstream (this will also avoid any merge conflicts while committing new changes)
+
+    ```sh
+    git pull upstream master
+    ```
+
+- Create your feature branch
+
+    ```sh
+    git checkout -b <feature-name>
+    ```
+
+- Commit all the changes
+
+    ```sh
+    git commit -am "Meaningful commit message"
+    ```
+
+- Push the changes for review
+
+    ```sh
+    git push origin <branch-name>
+    ```
+
+- Create a PR from our repo on Github.
+
+### Additional Notes
+
+- Any changes should be made in the `dev` branch.
+- Changes should be logged in the `CHANGELOG.md` file.
+- Code should be properly commented to ensure it's readability.
+- If you've added code that should be tested, add tests as comments.
+- Make sure your code properly formatted.
+- Issue that pull request!
+
+## Issue suggestions/Bug reporting
+
+When you are creating an issue, make sure it's not already present. Furthermore, provide a proper description of the changes. If you are suggesting any code improvements, provide through details about the improvements.
+
+**Great Issue suggestions** tend to have:
+
+- A quick summary of the changes.
+- In case of any bug provide steps to reproduce
+  - Be specific!
+  - Give sample code if you can.
+  - What you expected would happen
+  - What actually happens
+  - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
+
+
+## License
+
+By contributing, you agree that your contributions will be licensed under its  [MIT License](http://choosealicense.com/licenses/mit/).
diff --git a/README.md b/README.md
index 07e472c..b3ae04f 100644
--- a/README.md
+++ b/README.md
@@ -1,89 +1,55 @@
-# FileMover
-
-[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-360/)&nbsp;
-[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)&nbsp;
-![Update](https://img.shields.io/badge/update-monthly-green.svg)&nbsp;
-
-- [FileMover](#filemover)
-  - [Introduction](#introduction)
-    - [Python](#python)
-    - [FileMover](#filemover-1)
-  - [How To Run](#how-to-run)
-  - [Installation](#installation)
-  - [Usage](#usage)
-  - [Support](#support)
-  - [Roadmap](#roadmap)
-  - [Contributing](#contributing)
-  - [Authors and acknowledgment](#authors-and-acknowledgment)
-  - [License](#license)
-  - [Project status](#project-status)
-  - [Author](#author)
+<h1 align="center">FileMover 📁</h1>
+<p align="center">CLI tool to arrange your files smartly with filemover`</p>
+
+<p align="center">
+<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
+<img src="https://img.shields.io/badge/update-Quarterly-green.svg" alt="update-montly">
+<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" alt="maintained">
+<img src="https://img.shields.io/readthedocs/filemover">
+</p>
+
+- [Introduction](#introduction)
+- [How To Run](#how-to-run)
+- [Documentation](#documentation)
+- [Changelog](#changelog)
+- [Usage](#usage)
+- [Contributors](#contributors)
+- [Contributing](#contributing)
+- [License](#license)
+- [Project status](#project-status)
 
 ## Introduction
 
-### Python
-
-Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace. Python Automation To Arrange Files In One Click with the help of Python 3.0+.
-
-### FileMover
-
 This tool allows automatic file moving, each file to the folder that corresponds to its extension (e.g. ".jpg" ==> "/Pictures", ".mp4" ==> "/Videos")
 
 ## How To Run
 
-- Put in Download Folder Or Wherever You want to automatically move the file and Just run
-
-For CLI
-
 ```bash
-python filemover.py
+pip install filemover
 ```
 
-For GUI
+## Documentation
 
-```bash
-python filemovergui.py
-```
+Documentation is available at [filemover.readthedocs.io](https://filemover.readthedocs.io/en/latest/)
 
-## Installation
+## Changelog
 
-- This is A python 3 package.
-- Install Python 3.0+ or Anaconda 3.0+
+See [CHANGELOG.md](./CHANGELOG.md) 
 
 ## Usage
 
 FileMover Is a Python program to move files automatically with the help of Python. This will help you to manage your download folder for automatic cleanup.
 
-## Support
-
-Cotributors for the Project.
+## Contributors
 
-- [CodePerfectPLus](https://github.com/codePerfectPlus)
-- [AmiterCodes](https://github.com/AmiterCodes)
-- [Chems Eddine Senoussi](https://github.com/chemsedd)
+<a href="https://github.com/Py-Contributors/filemover/graphs/contributors">
+  <img src="https://contrib.rocks/image?repo=Py-Contributors/filemover"/>
+</a>
 
-## Roadmap
-
-what's new in a future update
-
-- More File Extension will be added soon
-- Contributions are welcome
 
 ## Contributing
 
-Before submitting a bug, please do the following:
-
-Perform basic troubleshooting steps:
-
-- ### Make sure you are on the latest version. If you are not on the most recent version, your problem may have been solved already! Upgrading is always the best first step
-
-- ### Try older versions. If you are already on the latest release, try rolling back a few minor versions (e.g. if on 1.7, try 1.5 or 1.6) and see if the problem goes away. This will help the devs narrow down when the problem first arose in the commit log
-
-- ### Try switching up dependency versions. If the software in question has dependencies (other libraries, etc) try upgrading/downgrading those as well
-
-## Authors and acknowledgment
-
-Show your appreciation to those who have contributed to the project.
+check [CONTRIBUTING.md](./CONTRIBUTING.md)
 
 ## License
 
@@ -91,10 +57,6 @@ For open-source projects, Under MIT License.
 
 ## Project status
 
-## Author
+This project is developed and maintained by [Py-Contributors](https://github.com/Py-Contributors/FileMover).
 
-- Module: FileMoverGUI
-- Author : Py-Contributors
-- Language: Python
-- Github: <https://github.com/codePerfectPlus>
-- Website: <http://codeperfectplus.herokuapp.com/>
+[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..d0c3cbf
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS    ?=
+SPHINXBUILD   ?= sphinx-build
+SOURCEDIR     = source
+BUILDDIR      = build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..6b88348
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,16 @@
+from datetime import datetime
+
+project = 'filemover'
+release = '1.0.5'
+templates_path = ['_templates']
+source_suffix = ".rst"
+master_doc = "index"
+year = datetime.now().year
+copyright = "{} Py-Contributors".format(year)
+extensions = ['sphinx.ext.autosectionlabel']
+releases_github_path = "Py-Contributors/filemover"
+autosectionlabel_prefix_document = True
+html_theme = 'sphinx_rtd_theme'  # 'pydata_sphinx_theme' 'alabaster'
+html_static_path = ['_static']
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
+html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
\ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..29b04ec
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,7 @@
+
+.. rst-class:: hide-header
+
+Welcome to FileMover's documentation!
+=====================================
+
+![Download badge](http://pepy.tech/badge/filemover)
\ No newline at end of file
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000..061f32f
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,35 @@
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set SOURCEDIR=source
+set BUILDDIR=build
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+	echo.
+	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+	echo.installed, then set the SPHINXBUILD environment variable to point
+	echo.to the full path of the 'sphinx-build' executable. Alternatively you
+	echo.may add the Sphinx directory to PATH.
+	echo.
+	echo.If you don't have Sphinx installed, grab it from
+	echo.https://www.sphinx-doc.org/
+	exit /b 1
+)
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+
+:end
+popd
diff --git a/filemover/__init__.py b/filemover/__init__.py
new file mode 100644
index 0000000..f064dad
--- /dev/null
+++ b/filemover/__init__.py
@@ -0,0 +1,3 @@
+from filemover.main import start
+
+__all__ = ['start']
\ No newline at end of file
diff --git a/filemover/cli.py b/filemover/cli.py
new file mode 100644
index 0000000..bcff3d5
--- /dev/null
+++ b/filemover/cli.py
@@ -0,0 +1,14 @@
+from filemover import start
+
+import argparse
+
+parser = argparse.ArgumentParser(description="CLI tool to arrange files smartly")
+parser.add_argument("-p", "--path", help="Path of the file to be moved", required=True)
+
+args = parser.parse_args()
+
+def main():
+    start(args.path)
+    
+if __name__ == "__main__":
+    main()
\ No newline at end of file
diff --git a/filemovergui.py b/filemover/gui/filemovergui.py
similarity index 100%
rename from filemovergui.py
rename to filemover/gui/filemovergui.py
diff --git a/filemover.py b/filemover/main.py
similarity index 84%
rename from filemover.py
rename to filemover/main.py
index e559b19..3e3807d 100644
--- a/filemover.py
+++ b/filemover/main.py
@@ -7,19 +7,17 @@
   / ____/____   ____/ /___     / __ \ ___   _____ / __/___   _____ / /_   / __ \ / /__  __ _____
  / /    / __ \ / __  // _ \   / /_/ // _ \ / ___// /_ / _ \ / ___// __/  / /_/ // // / / // ___/
 / /___ / /_/ // /_/ //  __/  / ____//  __// /   / __//  __// /__ / /_   / ____// // /_/ /(__  ) 
-\____/ \____/ \__,_/ \___/  /_/     \___//_/   /_/   \___/ \___/ \__/  /_/    /_/ \__,_//____/  1.0.4
+\____/ \____/ \__,_/ \___/  /_/     \___//_/   /_/   \___/ \___/ \__/  /_/    /_/ \__,_//____/  1.0.5
     
   | _____________________________________________________________________________________ |
   | || This Program will move files according to their extension in respective folders.|| |
   | ------------------------------------------------------------------------------------- |
-  | //                                     Version : 1.0.4                             // |
+  | //                                     Version : 1.0.5                             // |
   | //                                  Programming : Python3                          // |
   | //                                GitHub : py contributors                         // |
   | //                                Author : Py-Contributors                         // |  
   | //                             Email : pycontributors@gmail.com                    // |
-  | //                             Last Update : July 2022                             // |
-  | //                          Telegram : https://t.me/pycontributors                 // |
-  | //                       Website : http://codeperfectplus.herokuapp.com            // |
+  | //                             Last Update : November 2022                         // |
   | ------------------------------------------------------------------------------------- |
 ''')
 
@@ -50,7 +48,7 @@ def create_folder(folder_name: str):
         print('{} Already Exists'.format(folder_name))
 
 
-def move_files(file_folder_map: dict):
+def move_files(folder_path:str, file_folder_map: dict):
     '''
     Move files to respective folder
 
@@ -58,8 +56,11 @@ def move_files(file_folder_map: dict):
         ext_file_map (dict) : File to Folder map
     '''
     for folder, files in file_folder_map.items():
+        os.makedirs(os.path.join(folder_path, folder), exist_ok=True)
         for file in files:
-            move(file, folder)
+            old_file_path = os.path.join(folder_path, file)
+            new_file_path = os.path.join(folder_path, folder)
+            move(old_file_path, new_file_path)
 
 
 def get_folder(ext):
@@ -78,13 +79,16 @@ def get_folder(ext):
     return 'Other'
 
 
-def start():
+# TODO  need to change function name
+def start(folder_path: str):    
     '''
     Organize files on the current directory, each to the corresponding folder.
+    
+    folder_path: The path of the folder to be organized.
     '''
 
     file_folder_map = dict()
-    for filename in os.listdir():
+    for filename in os.listdir(folder_path):
         # ignore filemover.py, hidden files or a directory
         if filename == os.path.basename(__file__) or filename[0] == '.' or '.' not in filename:
             continue
@@ -106,8 +110,5 @@ def start():
         create_folder(folder)
 
     # move files to folder
-    move_files(file_folder_map)
-
+    move_files(folder_path, file_folder_map)
 
-if __name__ == '__main__':
-    start()
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..50ebae3
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,29 @@
+import setuptools
+
+with open("README.md", "r") as fh:
+    long_description = fh.read()
+
+setuptools.setup(
+    name="filemover",
+    version="1.0.5",
+    author="CodePerfectPlus",
+    author_email="deepak008@live.com",
+    description="CLI tool to arrange files smartly",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    url="https://github.com/Py-Contributors/FileMoverGUI",
+    keywords="filemover, movefiles, organizefiles, organizefiles, filemovergui, filemover-gui",
+    packages=setuptools.find_packages(),
+    classifiers=[
+        "Development Status :: 3 - Alpha",
+        "Programming Language :: Python :: 3",
+        "License :: OSI Approved :: MIT License",
+        "Operating System :: OS Independent",
+        "Intended Audience :: End Users/Desktop",
+        "Intended Audience :: Developers",
+    ],
+    python_requires=">=3.1",
+    entry_points={
+        "console_scripts": ["filemover = filemover.cli:main"],
+    },
+)


Test patch:
diff --git a/.github/workflows/run-pytest.yaml b/.github/workflows/run-pytest.yaml
new file mode 100644
index 0000000..be6843e
--- /dev/null
+++ b/.github/workflows/run-pytest.yaml
@@ -0,0 +1,34 @@
+name: Run Pytest
+
+on: [push, pull_request]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ["3.10"]
+
+    steps:
+      - uses: actions/checkout@v3
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install dependencies
+        run: |
+          sudo apt-get update
+          sudo apt install libespeak-dev
+          python -m pip install --upgrade pip
+          pip install flake8 pytest
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+      - name: Lint with flake8
+        run: |
+          # stop the build if there are Python syntax errors or undefined names
+          flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+          # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+          flake8 . --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics
+      - name: Test with pytest
+        run: |
+          pytest