Skip to main content

AGenius.py

Latest Release Python Version License: LGPLv3 PyPI Last Commit

AGenius.py is a LyricsGenius fork, making it easy to use, and async ready.

Key Features

  • Pythonic async/await.
  • Removed every possible instance of the Public API to make it safer.

Setup

You'll need a free Genius account to get access to the Genius API. This provides an access_token that is required.

Installation

Python 3.9 or higher You can use pip:

# Linux
python3 -m pip install agenius

# Windows
py -3 -m pip install agenius

Examples

Importing the package and initiating the main class:

import agenius
genius = agenius.Genius(token)

PUBLIC_API has been removed in this version. You have to pass an access token to the Genius() class.

To search for a specific song, you can either search by the title or song_id:

# by title
song = await genius.search_song("Never Gonna Give You Up", "Rick Astley")

# by song_id
song = await genius.search_song(song_id=84851)

You can also look up artists and their songs via artist_id's:

# look up an artist
artist = await genius.artist(artist_id=artist_id)

# look up their songs
song_list = await genius.artist_songs(artist_id=artist_id, per_page=10, sort="title")

Configurable parameters in the Genius() class:

genius.verbose = False  # Turns status messages off
genius.excluded_terms = ["(Remix)", "(Live)"]  # Exclude songs with these words in their title

More Examples

Get a song's lyrics

import agenius

genius = agenius.Genius(token)

song = await genius.search_song("Never Gonna Give You Up")
lyrics = song.lyrics

Get a list of an artist's songs, and get the lyrics of every one of them

import agenius
genius = agenius.Genius(token)

async def get_lyrics(artist_id):
    song_list = await genius.artist_songs(artist_id, per_page=50, sort="title")

    lyrics = {}
    async for song in song_list:
        lyrics[song["title"]] = song.lyrics
    return lyrics

License Notice

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Metadata

Release files for agenius 4.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agenius 4.0.2
File Size Uploaded
agenius-4.0.2.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agenius 4.0.2
File Interpreter ABI Platform
agenius-4.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 51.9 kB

Release files / agenius-4.0.2.tar.gz

Download URL agenius-4.0.2.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
07a704e6fcd2cf0141faca699ca33cc119d19822db12296d815e1e6ff75745f2
BLAKE2b-256 checksum
How to use checksums
aec23c2a9f3efd6182d54ddedb65ee93495ab04640fe0425042d0ce918f008b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / agenius-4.0.2-py3-none-any.whl

Download URL agenius-4.0.2-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f6935b1a503948fd2e262b35314e9f501658941c0198823c91b286ac213473d
BLAKE2b-256 checksum
How to use checksums
a41e94db53bc3ff96f95b187f2da5ff34a50e4cbfc9410a68be6745115b13739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

4.0.2 This release

2 release files

4.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page