Skip to main content

A package to create complex directories in single step using JSON objects.

Project description

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

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

Quickdir-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

Quickdir-0.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file Quickdir-0.0.1.tar.gz.

File metadata

  • Download URL: Quickdir-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.5

File hashes

Hashes for Quickdir-0.0.1.tar.gz
Algorithm Hash digest
SHA256 12cf2e26794f9c96b17369c440c7983d05f80dd343fcf24ed281e5159c191b79
MD5 6ca059aa8056a8f80b598324eb45102b
BLAKE2b-256 56d33dbdbcc835ae38dd57180b4dd448bce494a23af9b9b62a5591bb3e88967c

See more details on using hashes here.

File details

Details for the file Quickdir-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Quickdir-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.5

File hashes

Hashes for Quickdir-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 424021d1d200b9f6159c028c2dae274ac230d6ff3cc82350f8b20e19e0296d45
MD5 87e094b24cec83e619f6433e3587e19f
BLAKE2b-256 06011b1ea8579ddcabbb55ffbcd1818b4a89479a6604ccc712333830e4c2eb0e

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