Exporting files as a Python or R package

If you organize the files in a project as an installable package, then you can choose to export it as such. When another project import this project, Domino will automatically install the package at runtime, making it available to your code.

To export as a package, configure your project to export files, and select the appropriate language under "code package".

You must follow the language-specific pattern required for any package, described below.

RFor an in-depth guide to writing R extensions, please reference the official manual. An example Domino project containing such an example is available here.

In summary, each R package requires:

A directory called R/ containing code files.

A directory called man/ containing documentation files

A file named DESCRIPTION, with each line following the pattern <key>: <value>. Required keys include:

Package Version (e.g. 0.1) Title Description Author Maintainer (a name followed by an email address in angle brackets, e.g. Sample Maintainer <maintainer@example.com>) License

A file named NAMESPACE that describes the namespace of the package. If you aren't sure what to put here, exportPattern( "." ) can work in many cases.

Python

For an in-depth guide, please reference this documentation. An example Domino project containing such an example is available here.

In summary, each Python package requires:

A setup.py file. This must contain a setup() function (imported from setuptools), with arguments as described here.

A folder containing your Python modules and packages. Usually this is given the same name as the overall package.