Skip to main content

Guesses genre for text with musical context

Project description

Genres is a library that analyzes text with musical context and guesses genres.

---

# Genres
Genres is a python library (2.7) that guesses the genres for text with musical context.

## How it works
Genres is based on a list of genres and tags (database), that are compared against supplied text using regexp, found genres are then compared agains its main category to avoid mismatches.

## Usage

The api is simple.

import genres
r = genres.find("Pink Floyd is a great rock band)
r
["Rock]

You can also supply your own database.

import genres

db_obj = genres.db.Db("./example.txt")
finder_obj = genres.finder.Finder(db_obj)


## Database

The database is a simple list of words, separated by newline and structured like this:

|Data|Description|
|-------------|:-------------:|
|Rock|Main category|
|Rock|Sub category|
|-Pink Floyd|Tag associated to category rock|
|#Test|Comment|
||Categories are sparated with newline|
|Jazz|...|
|Post-bop|...|

Genres are distributed with a database that can be found under `genres/data.txt` and the genre structure is based on [Allmusic genre categorisation](http://en.wikipedia.org/wiki/List_of_popular_music_genres).


## Installation
Genres can easily be installed through pip.

$ pip install genres


## Contributing

Want to contribute? Awesome. Just send a pull request.


## License

Android-AppLog is released under the [MIT License](http://www.opensource.org/licenses/MIT).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genres-1.0.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file genres-1.0.tar.gz.

File metadata

  • Download URL: genres-1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for genres-1.0.tar.gz
Algorithm Hash digest
SHA256 c8a746e4443f9c29a76481f084796c5527937ddaaef58ae2df5e1a862da65a53
MD5 6bee2d3a4d15f5d4c45a4af6be0d690c
BLAKE2b-256 73890af2af530b5ab5355cc3feeb88b391f1e92c7c022793f90b1c16148473c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page