Coder Social home page Coder Social logo

splitwisecpp's Introduction

Splitwise C++ API

GitHub Workflow Status (branch) Codecov

GitHub repo size

A native C++ API for the Splitwise App. Written in C++14.

Tested in Linux.

⚠️ This library is in beta phase. All APIs are implemented but corner-cases might not be tested. Use at your own risk. ⚠️

Quick Start

#include <iostream>
#include <cassert>
#include <splitwisecpp/splitwisecpp.h>

int main()
{
    splitwisecpp::Config config;
    config.consumer_key = "your_consumer_key";
    config.consumer_secret = "your_consumer_secret";
    config.oauth1_token = "your_oauth1_token";
    config.oauth1_token_secret = "your_oauth1_token_secret";
    splitwisecpp::Splitwise splitwise(config);

    splitwisecpp::ApiResponse the_user = splitwise.get_current_user();
    assert(spliwisecpp::ErrorCodes::NoError = the_user.error);
    std::cout << the_user.json["user"]["first_name"] << std::endl;
}

Requirements

Additional components if you want to develop this:

  • C++ compiler that supports C++14 (preferably gcc or clang)
  • CMake
  • gcovr, for code coverage
  • clang-format, for code formatting
  • clang-tidy, for static analysis
  • Python 3.6
  • Python Jinja2

GTest will be automatically downloaded from GitHub if you don't have it pre-installed.

Features

  • Authentication using OAuth1 tokens. Please read the Splitwise docs to learn more.
  • (As of 26 May 2020) Implemented all the APIs described in Splitwise's developer documentation.
  • Exports public types from jsoncpp

Limitations

  • Thread-unsafe. The splitwisecpp::Splitwise class must be instantiated in one thread.

Backlog

  • Allow C linkage
  • Allow replacement of libcurl via plugins
  • Support OAuth2
  • Support for Windows (ie Win32)
  • Extra tools for:
    • OAuth1 generation
    • Command line interface
  • API documentation

For Developers

Add new API methods in src/api_method_descriptors.yaml (the schema is in the comments). Then run tools/generate_cpp_api_from_descriptor to generate interfaces and implementation code.

You may use pipenv to install a virtual environment.

splitwisecpp's People

Contributors

ginolatorilla avatar

Watchers

 avatar

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.