mboauth2 package
Submodules
Module contents
OAuth2 client for MusicBrainz API.
See https://musicbrainz.org/doc/Development/OAuth2
- class mboauth2.AccessType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumAccess types for the MusicBrainz OAuth2 API.
- OFFLINE = 'offline'
Access when the user is not present at the browser.
- ONLINE = 'online'
Access when the user is present at the browser.
- class mboauth2.AuthClient(client_id: str, client_secret: str, redirect_uri: str, session: Session | None = None)[source]
Bases:
objectOAuth2 client for helping with obtaining api token.
- class mboauth2.Scope(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumScopes for the MusicBrainz OAuth2 API.
- COLLECTION = 'collection'
View and modify the user’s private collections.
- EMAIL = 'email'
View the user’s email.
- PROFILE = 'profile'
View the user’s public profile information
- RATING = 'rating'
View and modify the user’s private ratings.
- SUBMIT_BARCODE = 'submit_barcode'
Submit barcodes to the database.
- SUBMIT_ISRC = 'submit_isrc'
Submit new ISRCs to the database.
- TAG = 'tag'
View and modify the user’s private tags.
- class mboauth2.Token(access_token: str, expires_in: int, token_type: str, refresh_token: str, last_refresh: ~datetime.datetime = <factory>)[source]
Bases:
objectbearer token for the MusicBrainz API.
- access_token: str
- property expired: bool
Returns True if the token is expired, False otherwise.
- expires_in: int
- last_refresh: datetime
- refresh_token: str
- token_type: str
mboauth2.app module
MusicBrainz OAuth2 API client and helpers.
- class mboauth2.app.AccessType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumAccess types for the MusicBrainz OAuth2 API.
- OFFLINE = 'offline'
Access when the user is not present at the browser.
- ONLINE = 'online'
Access when the user is present at the browser.
- class mboauth2.app.ApprovalPrompt(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumApproval prompts for the MusicBrainz OAuth2 API.
- AUTO = 'auto'
The user should only be prompted for consent the first time through the sequence.
- FORCE = 'force'
The user should be prompted for consent every time.
- class mboauth2.app.AuthClient(client_id: str, client_secret: str, redirect_uri: str, session: Session | None = None)[source]
Bases:
objectOAuth2 client for helping with obtaining api token.
- class mboauth2.app.GrantType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumGrant types for the MusicBrainz OAuth2 API.
- AUTHORIZATION_CODE = 'authorization_code'
- REFRESH_TOKEN = 'refresh_token'
- class mboauth2.app.Scope(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,EnumScopes for the MusicBrainz OAuth2 API.
- COLLECTION = 'collection'
View and modify the user’s private collections.
- EMAIL = 'email'
View the user’s email.
- PROFILE = 'profile'
View the user’s public profile information
- RATING = 'rating'
View and modify the user’s private ratings.
- SUBMIT_BARCODE = 'submit_barcode'
Submit barcodes to the database.
- SUBMIT_ISRC = 'submit_isrc'
Submit new ISRCs to the database.
- TAG = 'tag'
View and modify the user’s private tags.
- class mboauth2.app.Token(access_token: str, expires_in: int, token_type: str, refresh_token: str, last_refresh: ~datetime.datetime = <factory>)[source]
Bases:
objectbearer token for the MusicBrainz API.
- access_token: str
- property expired: bool
Returns True if the token is expired, False otherwise.
- expires_in: int
- last_refresh: datetime
- refresh_token: str
- token_type: str