hledger-lib-1.50.3: A library providing the core functionality of hledger

Safe Haskell | None
Language | GHC2021

Hledger.Read.InputOptions

Contents

- Types and helpers for input options

Description

Various options to use when reading journal files. Similar to CliOptions.inputflags, simplifies the journal-reading functions.

Synopsis

- data InputOpts = InputOpts {
  - mformat_ :: Maybe StorageFormat
  - mrules_file_ :: Maybe FilePath
  - aliases_ :: [String]
  - anon_ :: Bool
  - new_ :: Bool
  - new_save_ :: Bool
  - pivot_ :: String
  - forecast_ :: Maybe DateSpan
  - posting_account_tags_ :: Bool
  - verbose_tags_ :: Bool
  - reportspan_ :: DateSpan
  - auto_ :: Bool
  - infer_equity_ :: Bool
  - infer_costs_ :: Bool
  - balancingopts_ :: BalancingOpts
  - strict_ :: Bool
  - _defer :: Bool
  - _ioDay :: Day
  - _oldtimeclock :: Bool
  }
- class HasInputOpts c where
  - inputOpts :: Lens' c InputOpts
  - aliases :: Lens' c [String]
  - anon__ :: Lens' c Bool
  - auto__ :: Lens' c Bool
  - balancingopts :: Lens' c BalancingOpts
  - defer :: Lens' c Bool
  - forecast :: Lens' c (Maybe DateSpan)
  - infer_costs :: Lens' c Bool
  - infer_equity :: Lens' c Bool
  - ioDay :: Lens' c Day
  - mformat :: Lens' c (Maybe StorageFormat)
  - mrules_file :: Lens' c (Maybe FilePath)
  - new__ :: Lens' c Bool
  - new_save :: Lens' c Bool
  - oldtimeclock :: Lens' c Bool
  - pivot :: Lens' c String
  - posting_account_tags :: Lens' c Bool
  - reportspan :: Lens' c DateSpan
  - strict :: Lens' c Bool
  - verbose_tags :: Lens' c Bool
- definputopts :: InputOpts
- forecastPeriod :: InputOpts -> Journal -> Maybe DateSpan

# Types and helpers for input options

data InputOpts Source #

Constructors

InputOpts |

Fields

- mformat_ :: Maybe StorageFormat

  a file/storage format to try, unless overridden by a filename prefix. Nothing means try all.

- mrules_file_ :: Maybe FilePath

  a conversion rules file to use (when reading CSV)

- aliases_ :: [String]

  account name aliases to apply

- anon_ :: Bool

  do light obfuscation of the data ? Now corresponds to --obfuscate, not the old --anon flag.

- new_ :: Bool

  read only new transactions since this file was last read ?

- new_save_ :: Bool

  save latest new transactions state for next time ?

- pivot_ :: String

  use the given field's value as the account name

- forecast_ :: Maybe DateSpan

  span in which to generate forecast transactions

- posting_account_tags_ :: Bool

  propagate account tags to postings ?

- verbose_tags_ :: Bool

  add user-visible tags when generating/modifying transactions & postings ?

- reportspan_ :: DateSpan

  a dirty hack keeping the query dates in InputOpts. This rightfully lives in ReportSpec, but is duplicated here.

- auto_ :: Bool

  generate extra postings according to auto posting rules ?

- infer_equity_ :: Bool

  infer equity conversion postings from costs ?

- infer_costs_ :: Bool

  infer costs from equity conversion postings ? distinct from BalancingOpts{infer_balancing_costs_}

- balancingopts_ :: BalancingOpts

  options for transaction balancing

- strict_ :: Bool

  do extra correctness checks ?

- _defer :: Bool

  internal flag: postpone checks, because we are processing multiple files ?

- _ioDay :: Day

  today's date, for use with forecast transactions XXX this duplicates _rsDay, and should eventually be removed when it's not needed anymore.

- _oldtimeclock :: Bool

  parse with the old timeclock pairing rules?

#### Instances

Instances details

Show InputOpts Source # |
Instance details Defined in Hledger.Read.InputOptions Methods showsPrec :: Int -> InputOpts -> ShowS Source # show :: InputOpts -> String Source # showList :: [InputOpts] -> ShowS Source #
Eq InputOpts Source # |
Instance details Defined in Hledger.Read.InputOptions Methods (==) :: InputOpts -> InputOpts -> Bool Source # (/=) :: InputOpts -> InputOpts -> Bool Source #
Ord InputOpts Source # |

Instance details

Defined in Hledger.Read.InputOptions

Methods

compare :: InputOpts -> InputOpts -> Ordering Source #

(<) :: InputOpts -> InputOpts -> Bool Source #

(<=) :: InputOpts -> InputOpts -> Bool Source #

(>) :: InputOpts -> InputOpts -> Bool Source #

(>=) :: InputOpts -> InputOpts -> Bool Source #

max :: InputOpts -> InputOpts -> InputOpts Source #

min :: InputOpts -> InputOpts -> InputOpts Source #

HasBalancingOpts InputOpts Source # |
Instance details Defined in Hledger.Read.InputOptions Methods balancingOpts :: Lens' InputOpts BalancingOpts Source # commodity_styles :: Lens' InputOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' InputOpts Bool Source # infer_balancing_costs :: Lens' InputOpts Bool Source # txn_balancing :: Lens' InputOpts TransactionBalancingPrecision Source #
HasInputOpts InputOpts Source # |

Instance details

Defined in Hledger.Read.InputOptions

Methods

inputOpts :: Lens' InputOpts InputOpts Source #

aliases :: Lens' InputOpts [String] Source #

anon__ :: Lens' InputOpts Bool Source #

auto__ :: Lens' InputOpts Bool Source #

balancingopts :: Lens' InputOpts BalancingOpts Source #

defer :: Lens' InputOpts Bool Source #

forecast :: Lens' InputOpts (Maybe DateSpan) Source #

infer_costs :: Lens' InputOpts Bool Source #

infer_equity :: Lens' InputOpts Bool Source #

ioDay :: Lens' InputOpts Day Source #

mformat :: Lens' InputOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' InputOpts (Maybe FilePath) Source #

new__ :: Lens' InputOpts Bool Source #

new_save :: Lens' InputOpts Bool Source #

oldtimeclock :: Lens' InputOpts Bool Source #

pivot :: Lens' InputOpts String Source #

posting_account_tags :: Lens' InputOpts Bool Source #

reportspan :: Lens' InputOpts DateSpan Source #

strict :: Lens' InputOpts Bool Source #

verbose_tags :: Lens' InputOpts Bool Source #

class HasInputOpts c where Source #

Minimal complete definition

inputOpts

Methods

inputOpts :: Lens' c InputOpts Source #

aliases :: Lens' c [String] Source #

anon__ :: Lens' c Bool Source #

auto__ :: Lens' c Bool Source #

balancingopts :: Lens' c BalancingOpts Source #

defer :: Lens' c Bool Source #

forecast :: Lens' c (Maybe DateSpan) Source #

infer_costs :: Lens' c Bool Source #

infer_equity :: Lens' c Bool Source #

ioDay :: Lens' c Day Source #

mformat :: Lens' c (Maybe StorageFormat) Source #

mrules_file :: Lens' c (Maybe FilePath) Source #

new__ :: Lens' c Bool Source #

new_save :: Lens' c Bool Source #

oldtimeclock :: Lens' c Bool Source #

pivot :: Lens' c String Source #

posting_account_tags :: Lens' c Bool Source #

reportspan :: Lens' c DateSpan Source #

strict :: Lens' c Bool Source #

verbose_tags :: Lens' c Bool Source #

#### Instances

Instances details

HasInputOpts InputOpts Source # |

Instance details

Defined in Hledger.Read.InputOptions

Methods

inputOpts :: Lens' InputOpts InputOpts Source #

aliases :: Lens' InputOpts [String] Source #

anon__ :: Lens' InputOpts Bool Source #

auto__ :: Lens' InputOpts Bool Source #

balancingopts :: Lens' InputOpts BalancingOpts Source #

defer :: Lens' InputOpts Bool Source #

forecast :: Lens' InputOpts (Maybe DateSpan) Source #

infer_costs :: Lens' InputOpts Bool Source #

infer_equity :: Lens' InputOpts Bool Source #

ioDay :: Lens' InputOpts Day Source #

mformat :: Lens' InputOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' InputOpts (Maybe FilePath) Source #

new__ :: Lens' InputOpts Bool Source #

new_save :: Lens' InputOpts Bool Source #

oldtimeclock :: Lens' InputOpts Bool Source #

pivot :: Lens' InputOpts String Source #

posting_account_tags :: Lens' InputOpts Bool Source #

reportspan :: Lens' InputOpts DateSpan Source #

strict :: Lens' InputOpts Bool Source #

verbose_tags :: Lens' InputOpts Bool Source #

definputopts :: InputOpts Source #

forecastPeriod :: InputOpts -> Journal -> Maybe DateSpan Source #

Get the Maybe the DateSpan to generate forecast options from. This begins on: - the start date supplied to the `--forecast` argument, if present - otherwise, the later of - the report start date if specified with -b-pdate: - the day after the latest normal (non-periodic) transaction in the journal, if any - otherwise today. It ends on: - the end date supplied to the `--forecast` argument, if present - otherwise the report end date if specified with -e-pdate: - otherwise 180 days (6 months) from today.