# ADR on Python Public API conventions in Learning Core

**URL:** <https://discuss.openedx.org/t/adr-on-python-public-api-conventions-in-learning-core/12872>\
**Category:** Architecture\
**Created:** [April 29, 2024, 4:04pm UTC](https://discuss.openedx.org/t/adr-on-python-public-api-conventions-in-learning-core/12872 "2024-04-29T16:04:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/dave/32/263_2.png) [@dave](https://discuss.openedx.org/u/dave)\
**Post date:** [April 29, 2024, 4:04pm UTC](https://discuss.openedx.org/t/adr-on-python-public-api-conventions-in-learning-core/12872/1 "2024-04-29T16:04:27Z")

</div>

I recently created a PR proposing a new Python API layer for Learning Core:

> <https://github.com/openedx/openedx-learning/pull/186>
>
> This proposes refactoring our apps and introducing two major new conventions at …the same time:
> 
> 1. Apps in \`\`openedx\_learning.core\`\` would now be in \`\`openedx\_learning.apps.authoring\`\`, setting a pattern for grouping apps together into larger package groups.
> 2. A new \`\`openedx\_learning.api.authoring\`\` module would be created to aggregate API modules from apps in \`\`openedx\_learning.apps.authoring\`\`.
> 
> I originally wrote this up as a part of the major refactoring in #184, but separated out here so that we can discuss it in its own space.

The short version is that Learning Core is going to have many apps, and having consumers import from each app’s `api.py` module (as specified in [OEP-49](https://docs.openedx.org/projects/openedx-proposals/en/latest/best-practices/oep-0049-django-app-patterns.html#api-py)) is going to be cumbersome. So this ADR proposes an additional layer on top that will aggregate those individual app API modules into a separate package space for public APIs.

So say we have these app API modules:

- `openedx_learning.apps.authoring.assets.api`
- `openedx_learning.apps.authoring.components.api`
- `openedx_learning.apps.authoring.contents.api`
- `openedx_learning.apps.authoring.publishing.api`
- `openedx_learning.apps.authoring.units.api`

These API modules would be used internally, but consumers of Learning Core would import these functions from `openedx_learning.api.authoring`.

There’s more to it than that, but if you’re interested in the rationale and potential consequences, please comment on the PR. I’ll hold this ADR open until at least May 6th to give people a chance to look at it.

Thanks folks.
