ma

package module
v0.7.14 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 28 Imported by: 0

README

ma (media archiver)

build codecov

Simple tools for managing media files with SmugMug

Uses smugmug for accessing the SmugMug API

usage

See the manual for an overview of all the commands.

NAME:
   ma - CLI for managing local and Smugmug-hosted photos

USAGE:
   ma [global options] command [command options] [arguments...]

DESCRIPTION:
   CLI for managing local and Smugmug-hosted photos

COMMANDS:
   cp            Copy files to a date-formatted directory structure
   export        Export images from albums
   find, search  Search for albums or folders by name
   ls, list      List nodes, albums, and/or images
   new, create   Create a new node
   patch         patch the metadata of albums and images
   rm            Delete an entity
   similar       Identify similar images
   title         Create a title following the specified convention
   up, upload    Upload images to SmugMug
   urlname       Create a clean urlname for each argument
   user          Query the authenticated user
   version       Show the version information of the binary
   envvars       Print all the possible environment variables
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --smugmug-client-key value     smugmug client key [$SMUGMUG_CLIENT_KEY]
   --smugmug-client-secret value  smugmug client secret [$SMUGMUG_CLIENT_SECRET]
   --smugmug-access-token value   smugmug access token [$SMUGMUG_ACCESS_TOKEN]
   --smugmug-token-secret value   smugmug token secret [$SMUGMUG_TOKEN_SECRET]
   --json, -j                     emit all results as JSON and print to stdout (default: false)
   --monochrome                   disable colored output (default: false)
   --debug                        enable debugging of http requests (default: false)
   --help, -h                     show help

new album creation

An example to create a mirror of a top level directory structure:

$ fd -t d . /Volumes/Photos00/Scans -x ma new --parent bbHHmQ album {/.}

Documentation

Index

Constants

View Source
const RuntimeKey = "github.com/bzimmer/ma#RuntimeKey"

RuntimeKey in app metadata

Variables

View Source
var ErrFileExists = errors.New("foo")
View Source
var ErrInvalidURLName = errors.New("node url name must start with a number or capital letter")

Functions

func CommandCopy

func CommandCopy() *cli.Command

func CommandExif added in v0.3.5

func CommandExif() *cli.Command

func CommandExport

func CommandExport() *cli.Command

func CommandFind

func CommandFind() *cli.Command

func CommandList

func CommandList() *cli.Command

func CommandNew

func CommandNew() *cli.Command

func CommandPatch

func CommandPatch() *cli.Command

func CommandRemove added in v0.5.3

func CommandRemove() *cli.Command

func CommandSimilar added in v0.5.4

func CommandSimilar() *cli.Command

func CommandTitle added in v0.7.4

func CommandTitle() *cli.Command

func CommandURLName added in v0.3.1

func CommandURLName() *cli.Command

func CommandUpload

func CommandUpload() *cli.Command

func CommandUser

func CommandUser() *cli.Command

func CommandVersion

func CommandVersion() *cli.Command

func Metrics added in v0.5.5

func Metrics(c *cli.Context) error

Metrics (if enabled) emits the metrics as json

Types

type Encoder

type Encoder interface {
	// Encode writes the encoding of v
	Encode(v any) error
}

Encoder encodes a struct to a specific format

type Exif added in v0.3.5

type Exif interface {
	// Extract returns metadata about a file
	Extract(afs afero.Fs, dirname string, infos ...fs.FileInfo) []MetaData
}

Exif extracts EXIF metadata from files

func NewGoExif added in v0.3.5

func NewGoExif() Exif

type Grab added in v0.1.2

type Grab interface {
	Do(req *http.Request) (*http.Response, error)
}

type InvalidVersionError added in v0.7.0

type InvalidVersionError struct {
	ImageKey string
}

func (*InvalidVersionError) Error added in v0.7.0

func (x *InvalidVersionError) Error() string

type MetaData added in v0.3.5

type MetaData struct {
	// Info is the analyzed file
	Info fs.FileInfo

	// Err is non-nil if an error occurred processing the file
	Err error
	// DateTime is the best effort `DateTimeOriginal` of the file
	DateTime time.Time
}

MetaData represents the EXIF data about a file

type Runtime

type Runtime struct {
	// Encoder encodes a struct
	Encoder Encoder
	// Smugmug returns a smugmug client
	Smugmug SmugmugFunc
	// Sink for metrics
	Sink *metrics.InmemSink
	// Metrics for capturing metrics
	Metrics *metrics.Metrics
	// Fs for file access
	Fs afero.Fs
	// Grab for bulk querying images
	Grab Grab
	// Exif for accessing EXIF metadata
	Exif Exif
	// Language for title case
	Language language.Tag
	// Start time of the execution
	Start time.Time
}

Runtime for access to runtime components

type SmugmugFunc added in v0.7.12

type SmugmugFunc func() *smugmug.Client

SmugmugFunc returns a smugmug client panics if credentials are not provided

Directories

Path Synopsis
cmd
ma

Jump to

Keyboard shortcuts

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