Title: | Create Folders and Files Structure for Data Science Projects |
---|---|
Description: | Use JSON templates to create folders and files structure for data science projects. Includes customized templates and accepts your own as JSON files. |
Authors: | Miguel Conde |
Maintainer: | Miguel Conde <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2025-02-14 05:27:04 UTC |
Source: | https://github.com/miguel-conde/rprojtree |
This package allows you to easily create file and directory structures for data science projects
For more details see the tutorial vignette:
vignette("rprojtree-primer", package = "rprojtree")
Useful links:
available_templates
available_templates()
available_templates()
These are the structures defined by the currently available builtin templates:
basic_template
data/
clean/
raw/
docs/
outputs/
files/
reports/
R/
global.R
scripts/
src/
py_template
data/
clean/
raw/
docs/
outputs/
files/
reports/
PYTHON/
setup.py
notebooks/
projpkj/
__init__.py
scripts/
tests/
py_r_template
: a combination of basic_template
and py_template
A character list with the names of the built-in templates available in the package
available_templates()
available_templates()
Create a files structure from a builtin template or from a customized template provided as .json file
make_prj_tree(json_str, file, path = ".", verbose = FALSE)
make_prj_tree(json_str, file, path = ".", verbose = FALSE)
json_str |
string with the name of the builtin template to use |
file |
string for the name of the .json file describing a customized files structure to use as template |
path |
string containing which directory to use as root of the files structure to create |
verbose |
logical, show or not info while creating the files structure |
Only one of json_str
or file
must be supplied.
An error is raised if any node in the .json structure is found malformed
JSON format:
All the nodes must have a type
and a name
. Allowed
types are dir
, for directories, and file
for files.
All the directory nodes can contain any number of sub-nodes for subdirectories
The file nodes can include a content
field for the text the file should
contain.
invisible, an R list that corresponds to the JSON object in
json_str
, as returned by rjson::fromJSON
.
rprojtree::print_template
,
rprojtree::available_templates
,
rjson::fromJSON
## Not run: root_path = "..." make_prj_tree(json_str = "basic_template", path = root_path) my_template <- ".../some_template.json" make_prj_tree(file = my_template, path = root_path) ## End(Not run)
## Not run: root_path = "..." make_prj_tree(json_str = "basic_template", path = root_path) my_template <- ".../some_template.json" make_prj_tree(file = my_template, path = root_path) ## End(Not run)
print the files structure described by a builtin template or by a .json file
print_template(template_name)
print_template(template_name)
template_name |
name of the builtin template or the .json file to use. |
jsonlite::prettify
is internally
used to add indentation to the JSON content.
a JSON
class object as returned by jsonlite::prettify
.
print_template("basic_template")
print_template("basic_template")