Giter VIP home page Giter VIP logo

quickdir's Introduction

Quickdir

JSON object to quick directory creator using python.

Installation

pip install Quickdir

Usage

In Json object structure, terminating values has to be supplied to end(leaf) nodes in dir structure. Supply 1 if it ends with a file, 0 if it ends with a folder.

json = {"folder": {
                "subfolder": {
                        "subsubfolder": 0,
                        "file.txt": 1
                    }
         }

Creating directories using Quickdir object

from Quickdir import Quickdir

# create object of Quickdir class 
quick = Quickdir("Quickdir")

# give custom path instead of 'Quickdir' if required
quick2 = Quickdir("S:/Files")

# create your dir structure as dict/json
x = {"root": {
    "folder1":{
        "subfolder1":0,
        "file1.txt": 1
        }
    }
}


# make directories
quick.make(x)

Applications

Example 1: HTML project

html = {"root": {
                "logs": {
                        "test": 0,
                        "log.txt": 1
                    },
                "css" : {
                        "style.css" : 1,
                        "bootstrap.css": 1
                    },
                "js": {
                        "mainFunction.js":1,
                        "bootstrap.js":1,
                        "jquery.js":1
                    },
                "common":{
                        "navbar.html" :1,
                        "footer.html" :1
                    },
                "Readme.md": 1,
                "fonts": {
                    "sample.txt" :1
                  },
                "img": 0,
                "index.html":1
                
        } 
    }

Example 2: Creating directory structure for a College course.

college = {"CSE420": {
                "cat1": {
                        "alternate material": 0,
                        "notes.txt": 1
                    },
                "cat2": {
                        "alternate material": 0,
                        "notes.txt": 1
                    },
                "lab" : {
                        "1":0,
                        "2":0, 
                        "3":0,
                        "4":0,
                        "5":0,
                        "midterm":0,
                        "labfat":0,
                        "notes.txt": 1
                    },
                "DA": {
                        "1":0,
                        "2":0
                    },
                "FAT":{
                        "notes.txt" :1
                    },
                "project": {
                        "review 1": 0,
                        "review 2": 0,
                        "review 3": 0,
                        "code": {
                                  "test.py":1  
                        }
                    },
                
                "syllabus": 0
                
        } 
    }

Accessing premade application templates

from Quickdir import config

# college
x = config.college

# html
x = config.html

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

© 2020 Avinash

quickdir's People

Contributors

avinash-550 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.