go-discogs

command module
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 1 Imported by: 0

README ¶

go-discogs

Discogs Dump Batch Updater with Go
Examples

Run with shorthand and full flag with config

go-discogs --update-marker -y 2010 --month 3 -f db-config.yaml

You would most likely wish to keep the dsn variable to ENV. If that is the case...

export GO_DISCOGS_DSN=$my_dsn # or something else...
go-discogs --update \         # will read from ENV
     -y 2010 \
     -m 3 

If all you need is to update artist AND label...

go-discogs --update \           # optional if you wish to just use local marker
     -t artist,labels \         # you call artist or artists... potato, potato. just the same.
     -y 2010 \                  # required
     -m 3 \                     # required
     -s postgres://username:password@localhost:5432/database_name   # required
Commands
FLAG HAS_VALUE DEFAULT NOTE
--chunk -b O 5000 Chunk size for batch insertion
--config -c O $HOME/go-discogs/config.yaml Config file location
--data -d O $HOME/go-discogs/ File directory
--dsn -s O X Required
--year -y O Current Year Target Year
--month -m O Current Month Target Month
--types -t O artists Batch these types
--update -u X false Update data dump records
--purge -p X false Keep files after batch
--new -n X false Keep files after batch
💾 Files
Dump XML.GZ files

By default, it uses a local file to read and dispatch insertions from data.discogs.com. You can decide where to store them via --data (or just -d) flag. It will not delete such data, as their size are large enough to be considered costly work. If you insist to delete them after batch job, please use --purge (or just -p) option.

# first run
# disabling marker will prevent usage or creation of local marker
go-discogs --no-marker -f config.yaml

# second run, but there is no local marker
# initially updates and stores marker; because it cannot find any local marker
go-discogs -f config.yaml

# third run will not update, but simply use the local marker
go-discogs -f config.yaml

# fourth run will update local marker
go-discogs -f config.yaml --update-marker
Database Connection

Database connection can be done with following options.

Documentation ¶

Overview ¶

Copyright © 2022 Seunghyun Bosco Bae <state303@dsub.io>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL