Skip to contents

The Project class manages project-level metadata for survey research projects. It can initialize from a local or remote DESCRIPTION file (Git), or create an empty project when no DESCRIPTION is provided. Fields include client information, survey registry, and storage references (S3, Drive, Git).

Public fields

DESCRIPTION

A loaded DESCRIPTION object, a local file path, or a git path.

project

Character. Project ID; if NULL, taken from DESCRIPTION$get("Name").

title

Character. Human-readable project title; taken from DESCRIPTION$get("Title").

created_on

Date. Creation date; taken from DESCRIPTION$get("Date") or defaults to Sys.Date().

last_modified

POSIXct. Timestamp of the last write; set automatically by dl_project_write().

schema_version

Integer. Version of the Project structure this object was built with; set automatically. Used by dl_project_rehydrate() to detect projects that need migrating to the current class.

project_type

Character. Either "client" or "internal". Default is "client".

client

Character. The immediate client, taken from DESCRIPTION$get("Client") if available.

end_client

Character. The end client (for projects done on behalf of another agency).

industry

Character. The project's industry (e.g., "CPG", "Finance", "Tech").

region

Character. The region or market scope of the project (e.g., "US", "EU", "Global").

git_path

Character. Full git path to the project's source, e.g. "packages/g6tr.projects/vignettes/2025-08-01_fever".

monorepo_path

Character. Path to the project's S3 prefix (from DESCRIPTION$get("cloudfs.s3")).

google_drive_id

Character. Google Drive folder ID (ID only, not a URL).

google_drive_r_id

Character. Google Drive subfolder ID for R outputs (from DESCRIPTION$get("cloudfs.drive")).

vector_store_id

Character. OpenAI vector store ID holding the project's Workspace context (Drive documents, SOW, survey, emails, notes, ...).

surveys

A tibble with attached surveys and metadata.

documents

A named list registering key project documents (survey, sow, analysis_context, ...). Each entry is a list with name, url, and drive_id. Only pointers are stored — the content lives in the vector store. Populate via dl_project_attach_document().

links

A list of relevant project links. Reserved keys ("Google Drive", "Google Drive/R", "Crunch", "Crunch Dataset") are regenerated from fields by sync_links(); other keys are user-attached via dl_project_attach_link().

crunch

A list of Crunch-related project information (project, dataset, metadata).

models

A list of models-related project information.

notes

Character. Free-form project notes.

other

A list containing additional project objects.

Methods


Project$new()

Initialize a Project instance.

The DESCRIPTION argument can be:

  • A local path to a DESCRIPTION file.

  • A Git path (e.g. "packages/genie"), which will be fetched via download_desc_from_git().

  • NULL, in which case an empty project is created with default values.

Usage

Project$new(DESCRIPTION = "DESCRIPTION")

Arguments

DESCRIPTION

A local path, git path, loaded desc object, or NULL.


Project$normalize_drive_ids()

Coerce the Google Drive fields to bare IDs. Accepts either a folder ID or a full Drive URL for google_drive_id / google_drive_r_id and stores the ID.

Usage

Project$normalize_drive_ids()


Regenerate the reserved auto-links in links from the current field values (Google Drive folders and Crunch project/dataset URLs). User-attached links are preserved.

Usage

Project$sync_links()


Project$wrap_up()

Prepare the project for writing: normalize Drive IDs, refresh auto-links, and stamp last_modified. Called by dl_project_write() before serializing.

Usage

Project$wrap_up()


Project$print()

Custom print method that displays all available project information using cli.

Usage

Project$print()


Project$clone()

The objects of this class are cloneable with this method.

Usage

Project$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Initialize from local DESCRIPTION
project <- Project$new("DESCRIPTION")

# Initialize from git path
project <- Project$new("packages/g6tr.projects/vignettes/2025-08-01_fever")

# Initialize empty project
project <- Project$new(NULL)
} # }