Giter Site home page Giter Site logo

parasut-python's Introduction

codecov contributions welcome PyPI - Downloads PyPI - License

parasut-python

Parasut Python API Wrapper (Unoffical)

Warning

This project is not offical library. It's unoffical python wrapper This project is under heavy development. Please be aware before use Query parameters not included for functions

Install

pip install parasut-python

Using

import os
from parasut.client import Client

CLIENT_ID = os.environ['PARASUT_CLIENT_ID']
CLIENT_SECRET = os.environ['PARASUT_CLIENT_SECRET']
USERNAME = os.environ['PARASUT_USERNAME']
PASSWORD = os.environ['PARASUT_PASSWORD']

# Remove sandbox=True when production.
# It's activating sandbox urls for testing
# Sandbox link: api.heroku-staging.parasut.com
client_obj = Client(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET,
                    username=USERNAME,
                    password=PASSWORD,
                    sandbox=True)

# It's required
client_obj.initialize()

# You can get request parameters from
# https://apidocs.parasut.com/#operation/createContact
# All required request data examples can be found at
# https://apidocs.parasut.com
data = {
    "data": {
      "type": "contacts",
      "attributes": {
        "email": "[email protected]",
        "name": "string",
        "short_name": "string",
        "contact_type": "person",
        "tax_office": "string",
        "tax_number": "string",
        "district": "string",
        "city": "string",
        "address": "string",
        "phone": "string",
        "fax": "string",
        "is_abroad": True,
        "archived": True,
        "iban": "string",
        "account_type": "customer"
      },
      "relationships": {
        "category": {
          "data": {
            "type": "item_categories"
          }
        },
        "contact_people": {
          "data": [
            {
              "type": "contact_people",
              "attributes": {
                "name": "string",
                "email": "[email protected]",
                "phone": "string",
                "notes": "string"
              }
            }
          ]
        }
      }
    }
  }

obj = client_obj.functions.createContact(data)
print(obj.json())

Package

Basic structure of package is

├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── parasut
│   ├── __init__.py
│   ├── client.py
│   ├── functions.py
│   ├── urls.py
│   └── version.py
├── pytest.ini
├── requirements.txt
├── script
│   └── test
├── setup.py
└── tests
    ├── __init__.py
    ├── helpers
    │   ├── __init__.py
    │   └── my_helper.py
    ├── tests_helper.py
    └── unit
        ├── __init__.py
        ├── test_example.py
        └── test_version.py

Requirements

Package requirements are handled using pip. To install them do

pip install -r requirements.txt

Tests

Testing is set up using pytest and coverage is handled with the pytest-cov plugin.

Run your tests with py.test in the root directory.

Coverage is ran by default and is set in the pytest.ini file. To see an html output of coverage open htmlcov/index.html after running the tests.

Travis CI

There is a .travis.yml file that is set up to run your tests for python 2.7 and python 3.2, should you choose to use it.

License

MIT, Copyright (c) 2020 Burak Karahan

parasut-python's People

Contributors

marlonjd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

parasut-python's Issues

showEArchivePDF should be update

`

def showEArchivePDF(self, pk):
> url = self.replaceUrl(urls.E_ARCHIVES_URL + '/' + pk + '/pdf')
> return self.makeRequest(url, 'GET')

`

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.