Skip to main content

Command line to for exporting data over the moco api

Project description

moco-explorer

https://img.shields.io/pypi/v/moco_explorer.svg https://img.shields.io/travis/sommalia/moco_explorer.svg Documentation Status

The quick and easy interface for exporting data from moco.

  • Free software: GNU General Public License v3

Disclaimer

This project is in no way finished, or polished. I am not responsible for any commercial, financial or emotional damage that may or may not be caused by using this project.

Features

  • Easy access to your moco data

  • Csv/Json/Text Export

  • Authentication over cli with username and password

Requirements

  • python 3.5 or greater

  • moco_wrapper 0.6.2 or greater

Installation

From source

$ git clone https://github.com/sommalia/moco_explorer moco-explorer
$ cd moco-explorer
$ pip install -r requirements_dev.txt
$ make install

From pip

$ pip install moco_explorer

Quickstart

Authentication

To retrieve information from yout moco instance the moco_explorer needs to authenticate with it. For your first request, it will stop and ask for your account information.

You can also manually create the configuration file with moco_explore config create.

$ moco_explorer config create
$ > Enter your moco domain: testcompany.mocoapp.com // testcompany would also work
$ > Enter your moco email: testaccount@testcompany.com
$ > Enter your moco password: *******

After that a config file in your users home directory will be created.

$ cat $HOME/.moco_explorer.json
{
    "domain": "testcompany",
    "api_key": "HERE IS THE API KEY"
}

If you want to load or create your configuration file in an alternative location you can specify the path with the -c/–config option.

$ moco_explorer -c $HOME/alternative-moco-config.json config create

By default the moco_explorer will look for the configuration file under $HOME/.moco_explorer.json. If you created the configuration file in an alternative location make sure you always specify the -c/–config option.

What can I do?

Currently the following endpoints can be queried (also accessible with moco_explorer –help)

activity
company
contact
deal
    category
invoice
    payment
offer
planning-entry
project
    contract
    expense
    payment_schedule
    recurring_expense
    task
schedule
user
    employment
    holiday
    presence
unit

Retrieving a list of all contacts in csv format

$ moco_explorer -f csv contact getlist -a

Retrieving a single company object (id 123) in json format

$ moco_explorer -f json company get 123

Get an overview over a specific project (id 1233)

$ moco_explorer -f text project get 1233

Work through the pages of the projects (100 items per page). If you have more than 100 objects, the results are paginated (eg. for 105 items, the first page will contain 100, the second 5 items).

$ moco_explorer -f json project getlist --page 1
$ moco_explorer -f json project getlist --page 2

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.3.0 (2020-05-28)

  • Implemented Planning Entry

  • Implemented Schedule

  • Implemented User Employment, Presences and Holidays

  • Moco-Wrapper required version increased to 0.7.0

0.2.0 (2020-04-23)

  • Implemented deal and contact endpoints

  • Updated readme with more consistent information about how to get started

  • Fixed an error in formatter objects about how nested sublists get displayed

0.1.0 (2020-03-21)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moco_explorer-0.3.0.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

moco_explorer-0.3.0-py2.py3-none-any.whl (46.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file moco_explorer-0.3.0.tar.gz.

File metadata

  • Download URL: moco_explorer-0.3.0.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for moco_explorer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 64dbe62930496025f2f282780031cb32cc0b685ada61f0cd808989a874b892c9
MD5 c0759b27d0f3e90060492037aa19a1cd
BLAKE2b-256 a1518f681950fe6beaf18caddb0d8a8809902ab352197eee1d6676f74cfe69ff

See more details on using hashes here.

File details

Details for the file moco_explorer-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: moco_explorer-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for moco_explorer-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 14eaee7fc079303a4ff472fa5bbd0689ff9b9c7e2e66c67d8292257eae65ecd0
MD5 a288ba71e25506db6f3283934297b353
BLAKE2b-256 3e2b3795d6fa9321f25e69d396064ca948477e76def2cc6355d8567447d1b4a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page