Welcome to Procountor’s documentation!

Procountor

Build status on travis Documentation Status Updates status Coveralls status

Python library for calling Procountor services

Features

  • Full client for calling Procountor REST API

Credits

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

Releasing new version to pypi

Install dev tools

` pipenv install --dev `

Update HISTORY.rst and commit the changes.

Bump version. (patch | minor | major depending on the scale of changes)

` bumpversion patch `

Push changes and tags.

` git push git push --tags `

Double check that the github action runs successfully.

Installation

Stable release

To install Procountor, run this command in your terminal:

$ pip install procountor

This is the preferred method to install Procountor, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for Procountor can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/vilkasgroup/Procountor

Or download the tarball:

$ curl  -OL https://github.com/vilkasgroup/Procountor/tarball/master

Once you have a copy of the source, you can install it with:

$ python setup.py install

Usage

To use Procountor in a project:

import procountor

procountor

procountor package

Submodules

procountor.client module

class procountor.client.Client(api_key, client_id, client_secret, redirect_uri, test_mode=True, api_version='supported')[source]

Bases: procountor.api_methods.ApiMethods

Class for Procountor accounting API

Following packages need to be installed:
  • requests
Parameters:
  • api_key – Procountor API Key, string
  • client_id – Procountor REST API client id, string
  • client_secret – Procountor REST API client secret, string
  • redirect_uri – URI where redirected after authentication, string
  • test_mode – Wether to use test api or real api, bool
  • api_version – Cen be latest, supported or >= 20.01, string
api_host
api_url
invalidate_token()[source]

Method invalidates the access token

request(method, endpoint, headers=None, url=None, files=None, *args, **kwargs)[source]

Method to make HTTP requests over Procountor REST API

Parameters:
  • method – wanted request method, uppercase string
  • endpoint – wanted REST API endpoint, string
  • headers – Overwrite HTTP-headers, dict
  • kwargs – query parameters to pass to Procountor, dict
Returns:

response from rest server, dict

Module contents

Top-level package for Procountor.

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs at https://github.com/vilkasgroup/Procountor/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.

Write Documentation

Procountor could always use more documentation, whether as part of the official Procountor docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/vilkasgroup/Procountor/issues.

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Get Started!

Ready to contribute? Here’s how to set up Procountor for local development.

  1. Fork the Procountor repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:vilkasgroup/Procountor.git
    
  3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:

    $ mkvirtualenv Procountor
    $ cd Procountor/
    $ python setup.py develop
    
  4. Create a branch for local development:

    $ git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:

    $ flake8 procountor tests
    $ python setup.py test or py.test
    $ tox
    

    To get flake8 and tox, just pip install them into your virtualenv.

  6. Commit your changes and push your branch to GitHub:

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature
    
  7. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.
  2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
  3. The pull request should work for Python 2.7 and 3.6, and for PyPy. Check https://travis-ci.org/vilkasgroup/Procountor/pull_requests and make sure that the tests pass for all supported Python versions.

Tips

To run a subset of tests:

$ python -m unittest tests.test_client

Releasing new version

When you are ready to release a new version follow these steps:

  1. Merge all changes that should be included in the new release to master. And checkout master.

  2. Update HISTORY.rst with the new version number and changes. And commit your changes to master.

  3. run:

    $ bumpversion patch|minor|major
    
  4. push to master with tags to trigger travis deploy:

    $ git push --tags
    $ git push
    

Travis will build the tag and when it is successfull will also deploy to pypi

Credits

Development Lead

Contributors

None yet. Why not be the first?

History

2.3.2 (2022-06-26)

  • up version number to test new release process

2.3.1 (2022-06-26)

  • Don’t send empty json body in get requests * fixes problem with azure api gateway rejecting messages
  • remove travis

2.2.1 (2021-11-15)

  • Better API Token error message if getting token fails

1.2.0 (2020-04-08)

  • Support for new API urls
    • latest
    • supported (Default)
    • Special version >= 20.02 - not yet new functionalities.

1.1.0 (2019-06-17)

  • Support to use a specified version of Procountor API

1.0.0 (2019-04-21)

  • Version 1.0.0 is compatibled with Procountor API version 10.
  • Returns response as dict with keys: status, message and data

0.2.1 (2018-05-24)

  • Fix get_invoices and get_ledger_receipts
  • Return attachment data parsed

0.2.0 (2018-05-16)

  • Add an option for using the real API endpoint

0.1.0 (2018-03-15)

  • Bump version: 0.0.1 -> 0.1.0

0.0.1 (2018-03-15)

  • First release for PyPi

Indices and tables