Skip to main content

Parasut API Python Wrapper

Project description

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": "user@example.com",
        "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": "user@example.com",
                "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

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

parasut-python-0.0.56.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

parasut_python-0.0.56-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file parasut-python-0.0.56.tar.gz.

File metadata

  • Download URL: parasut-python-0.0.56.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for parasut-python-0.0.56.tar.gz
Algorithm Hash digest
SHA256 029d05e5e8036f5bcedd13448072a1bf4213b503e37fa0642faeb41be171bea8
MD5 7840c11c1380acbc9f226fe86c42f31d
BLAKE2b-256 d912ddc57e77c5bedf5e6ac36a9712d9931e316e12daacfe566085bd014abc70

See more details on using hashes here.

File details

Details for the file parasut_python-0.0.56-py3-none-any.whl.

File metadata

  • Download URL: parasut_python-0.0.56-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for parasut_python-0.0.56-py3-none-any.whl
Algorithm Hash digest
SHA256 efd5e0131b6ef11f47fc5b5a66e258f6a4c8f02e512b8e4424afc1c76c37b054
MD5 b477b9655692259260a28e39b9008863
BLAKE2b-256 651b6372006973454742947ceabe47c012e700182e74087ef353c1b540ae81ed

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