This is an Elixir library that stores Discogs user collections to a local database and allows interaction via Ecto wrappers.
make build
./discogs
Usage: discogs [options]
--sync USER Sync a user collection
--shuffle USER <N=30> Pick n random records from a user collection
make test-unit
You might find this library useful if you are an Elixir developer who needs to work with the Discogs API in some form.
It includes Ecto mappings for the Discogs User -> Release -> Record
and
Artist -> Release -> Record
relationships, and could be easily extended.
I kept the Ecto model structs quite slim, since I originally wrote this repo for a fairly simple use-case (creating a shuffled sample of records to experiment with aleatory DJ mixes).
Here are a few more reasons this library might be of interest to Elixir developers:
- as an example of a tested Ecto library that does not include Phoenix
- as an example of a library using the uncommon
sqlite_ecto2
adapter - as an example of a CLI app making very minimal use of Elixir's OptionParser
This project uses credo and formatter for style consistency. Please run
mix format
and
mix credo -a --strict
before committing changes.
All public functions for the Ecto models should be tested exhaustively,
including changeset/2
.
All public modules and their functions should be documented with the appropriate typespecs.
This library uses ExDoc conventions for documentation. You can run
mix docs
to build the docs and open them in your local environment.
Typespecs are validated through dialyzer.
mix dialyzer
MIT