Giter VIP home page Giter VIP logo

muecken's Introduction

Muecken

Build Status Test Coverage Code Climate

Ruby library to parse and analyze financial data. This library is work in progress and not really usable yet. Feel free to look around but don't expect too much ;)

Muecken (German for "mosquitos", an informal word for money) is supposed to provide an easy way of parsing, analyzing and categorizing financial data to give you an overview of where money comes from and, most probably more important, where it goes to...

Muecken in it's most basic sense takes data from a source like a CSV file or an API, parses and analyzes it so that you end up with categorized entries. While entries represent transactions (e.g. paying your rent or getting your salary), categories are defined by the user and therefore completely dynamic.

For now the creation of fancy diagrams and reports is not part of this library. In case you are interested in collaborating on something in that direction feel free to contact me!

The main design goals for this library are simplicity, speed and stability - so I'm using the Ruby standard library as much as possible.

Check out the TODO list to find out more about the things I have in mind.

Usage

The following snippet will create a rule which adds the category "Phone" to entries containing one of the words "jazztel", "orange" or "movistar". It then loads a list of entries from a CSV file and applies the rule to each of them.

# declare rule
rules = []
rules << Muecken::Rules::OneMatch.new(
 [
   Muecken::Matcher::SubString.new(%w(jazztel)),
   Muecken::Matcher::SubString.new(%w(orange)),
   Muecken::Matcher::SubString.new(%w(movistar))
 ],
 [Muecken::Categories::Primary.new('Phone')]
)
# load entries
entries = Muecken::Parser::CSV.read_file(file_name)
# categorize entries
rules.product(entries) { |rule, entry| rule.apply(entry) }

A rule needs at least one matcher and at least one category. If one of the matcher matches, all the categories are assigned (depending on the rule type it can be required that all matcher need to match).

For more examples check the tests under spec/ or the executable.

Categories

There are two types of categories: primary and secondary. The idea is that an entry has one primary category and optionally multiple secondaries. For example a primary category could be "Groceries", "Rent" or "Running Costs" while "2014", "More than 100โ‚ฌ" or "Credit Card" would be secondary ones. The specific implementation of this is up to the consumer though, you can also just use one type and don't care about the other.

Maintainer

Daniel Sager

Contributing

  • Fork
  • Implement your Feature or Fix including Tests
  • Update the change log
  • Create Pull Request (ideally squashed into one commit)

Thank you!

See the list of contributors.

License

MIT License, see the license file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.