Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openverse-attribution with new features and improvements #4250

Merged
merged 13 commits into from
May 6, 2024

Conversation

dhruvkb
Copy link
Member

@dhruvkb dhruvkb commented May 1, 2024

Fixes

Partially relates to #4182.

Description

This PR

  • updates openverse-attribution to add lots of new features
    • support for versions and jurisdictions
    • stricter validation for slug, version and jurisdiction params
    • ability to infer missing version and jurisdiction
  • refactors openverse-attribution for a clearer API
    • Old License enum renamed to LicenseName.
    • Added dataclass License wrapping name (LicenseName) and optionally version (str) and jurisdiction (str).
    • all functionality is exposed via the License class
  • fixes problems present in openverse-attribution
    • several license names that were missing were added such as SA, ND-NC and DevNations
    • added support for license aliases e.g. 'zero' (i.e. CC0) and 'mark'/'publicdomain' (i.e. PDM)
  • updates usage of openverse-attribution in the API

@dhruvkb dhruvkb added 🟨 priority: medium Not blocking but should be addressed soon 🌟 goal: addition Addition of new feature 💻 aspect: code Concerns the software code in the repository 🐍 tech: python Involves Python 🧱 stack: api Related to the Django API labels May 1, 2024
@dhruvkb dhruvkb requested a review from a team as a code owner May 1, 2024 11:49
@dhruvkb dhruvkb requested review from obulat and sarayourfriend May 1, 2024 11:49
Copy link
Collaborator

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think there are opportunities to make this library more flexible and if we got to the point of publishing it, I think we should. But you're right, this package as it is, and maybe for forever, is meant to share logic across parts of Openverse codebase, not solve a general problem.

Sorry I got sidetracked with that. LGTM!

@dhruvkb
Copy link
Member Author

dhruvkb commented May 2, 2024

💯 We should definitely look into making this more generalised and also consider open sourcing it. But until that time, we should take up smaller incremental improvements like this one.

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So many comprehensive changes ⭐

In the catalog, we have a function to get the license information based on the license name-license version pair, and/or the licence URL. I think we should add the ability to get License from a URL, without providing the license name-version pair. It should probably done as a separate PR, though.

:param version: the version number of the license
:return: the full name of the license
# Shorten long variable names
ver = version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be easier to read if we didn't shorten the version. jur is pretty clear, but ver, for me, seems more unclear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was enjoying the similarities in both the length (3 letters) and the pronunciations.

@dhruvkb dhruvkb merged commit 1736a13 into main May 6, 2024
47 checks passed
@dhruvkb dhruvkb deleted the mega_license branch May 6, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API 🐍 tech: python Involves Python
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants