organize your files with prefixes
Project description
Riordinato
Riordinato is a python library for organizing files with prefixes.
Installation
Use the package manager pip to install riordinato.
pip install riordinato
Usage
Riordinato is used to organize files by prefixes. For example, we want to move the files that have python in their name to the python folder and similar with the files that have work.
/home/user/documents
├── pythonWork.py
├── python_examples.txt
├── family.jpg
├── dog.png
├── index.html
├── work_list.txt
├── any_work.docx
├── python_exercise.pdf
├── work_for_later.docx
│
├── python/
└── work/
First import riordinato
from riordinato.files import Organize
The prefixes are within a list where the first value is the name and the second the destination.
# NAME DESTINATION
prefixes = [('python', '/home/user/documents/python')
('work', '/home/user/documets/work')]
# You can also use windows directory syntax
We define a directory where we have the files we want to move.
path = '/home/user/documents'
We create the instance.
organize = Organize(prefixes, path)
If you want to see the files that are in the path you can print the files attribute.
>>> print(organize.files)
['pythonWork.py', 'python_examples.txt', 'family.jpg', 'dog.png', 'index.html',
'work_list.txt', 'any_work.docx', 'work_for_later.docx', 'python_exercise.pdf']
To organize our files we use the moveFiles method
organize.moveFiles()
And our directory would look like this.
/home/user/documents
├── family.jpg
├── dog.png
├── index.html
├── any_work.docx
│
├── python/
│ ├── python_exercise.pdf
│ ├── pythonWork.py
│ └── python_examples.txt
└── work/
├── work_for_later.docx
└── work_list.txt
If we want to move files with a specific prefix, use the "specific" parameter of the method.
organize.moveFiles(specific='python')
/home/user/documents
├── family.jpg
├── dog.png
├── index.html
├── work_list.txt
├── work_for_later.docx
├── any_work.docx
│
├── python/
│ ├── python_exercise.pdf
│ ├── pythonWork.py
│ └── python_examples.txt
└── work/
Contributing
A contributing.md will be added soon.
License
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
Built Distribution
Hashes for riordinato-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 034e2c622adc34602f3bf451751dd8308310797d7213c6a80674618267a5bee0 |
|
MD5 | 66485969770befd09ebf6d67c86b3cc5 |
|
BLAKE2b-256 | e8659865c1181d6d53c3370afd5cbcd044ea4ece97d93b043d6620bd7a352a0e |