R and Python Package in One GitHub Repo or Two?
A subdirectory-per-language layout keeps both ports findable in one place. It also moves costs into CI, releases and issue triage, and it has clear limits.

You maintain the same library for R and for Python, and the two ports do the same job. Now you have to decide whether they share a GitHub repository or each gets its own. The question came up on Stack Overflow with a wrinkle: the Python package is called good_name and the R package is called good.name, so the two are not even spelled the same.
The asker framed it as a trade-off. One repo makes the project easier to find, use and reference. Two repos feel neater. Neither side is wrong, but they cost different things, and the cost shows up later in CI, releases and issue triage rather than on day one.
The accepted answer recommends a single repository with one subdirectory per language, and says you can split later if the packages diverge. The rest of this article works through that advice, what it assumes and where it can go wrong.
The layout the accepted answer proposes
The answer treats the repository as a house and each language package as a room in it. Each room keeps its own tools, files and setup. The shared parts, a README that covers both packages and a LICENSE, sit at the top level:
good-package/
python/
good_name/ Python package
R/
good.name/ R package
README.md explains both packages
LICENSE
The point of the structure is separation. Python packaging files stay inside the Python folder and R's DESCRIPTION and NAMESPACE stay inside the R folder, so neither toolchain sees the other's files. Only the README and license are common.
One detail is worth a second look. A top-level directory called R/ sits next to a package that will itself contain an R/ folder of source files. It works, but you end up with paths like R/good.name/R/, which confuses newcomers. A name such as r-package/ or r/ avoids that.
The name mismatch is not a reason to split
The asker worried that good_name and good.name are not identical. The answer's position is that they can stay different, because each language has its own naming conventions. That matches how the ecosystems work. A dot in a Python import name would be read as a submodule separator, so the underscore is the idiomatic choice there. R package names allow dots but not underscores, so the dotted form is the natural one.
The repository name is a third, independent choice. In the example it is good-package, which is neither of the two package names. That gives you a neutral project name for the repo, while each package keeps the name its own users expect to type in library() or import.
What one repo buys you
The asker's own argument for a single repo is discoverability, and the answer repeats it: people can find both versions in one place. Someone who lands on the repo from a Python search sees that an R version exists, and the reverse. You also get a single README, one stars-and-watchers count, and one URL to cite when you reference the project.
- One place to explain what the package does and how the two ports relate.
- One license file covering both, so the terms cannot drift apart.
- Shared material, such as docs or example data, can live at the top level instead of being copied between repos.
The last point is my inference, not something the answer states, so treat it as a reason to check your own situation rather than a guarantee.
What one repo costs you
The answer does not go into the costs, so this section reasons from how the layout works. When two packages share a repository, they share a commit history, an issue tracker and a set of tags. A fix to the R side shows up in the log that Python users read. An issue titled 'fails on install' is ambiguous until someone adds a label saying which language it concerns.
Install paths also change. Both ecosystems can install from a subdirectory of a Git repo, but the command is less obvious than pointing at a repo root. Check the options in your installer's documentation before telling users how to install, and test the instructions from a clean machine.
CI is the other place the cost lands. A change that touches only the Python folder should not have to wait for the R test run, so you will want separate workflows triggered by path. That is extra configuration you would not need with two repos.
Splitting later is the escape hatch
The answer's closing advice is the practical one: if the packages eventually become very different or need independent maintenance, you can split them into separate repositories later. This lowers the stakes of the initial decision. Because each package already lives in its own folder with its own files, pulling one out is a mechanical job and not an untangling exercise.
That only holds if you keep the discipline the layout invites. If the Python folder starts importing files from the R folder, or a top-level script builds both, the split stops being cheap. Keep each package self-contained and the option stays open.
Where this approach does not fit
A single repo assumes the two ports are close relatives. If one is a thin wrapper around the other, such as R calling Python, the layout still works but the dependency between them should be explicit. If they are separate implementations with different maintainers, release cadences or contribution rules, the shared history and issue tracker become friction, and two repos are the more honest structure.
Watch for the signs the answer itself points to: the packages diverging, or needing independent maintenance. Other signs are issues that need a language label on every report, CI that spends most of its time running unrelated tests, and contributors who only know one language and are put off by a repo that is half foreign to them. If two or three of those appear, split, and keep the README in each repo pointing at its sibling so the discoverability benefit survives the move.
This article draws on When developing the same package for R and Python, do you put them in one github repo or separate repos and an answer to it, on the Stack Exchange network, licensed under CC BY-SA 4.0.
- #Python
- #best-practices
- #github
- #monorepo
- #package development
- #r


Comments