Skip to content

Commit

Permalink
Change readme and packing 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MarlonJD committed Dec 28, 2020
1 parent fc146aa commit 7d7451a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
38 changes: 12 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
parasut-python
==========================

Parasut Python API Wrapper
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

## Using
```
CLIENT_ID = os.environ['PARASUT_CLIENT_ID']
CLIENT_SECRET = os.environ['PARASUT_CLIENT_SECRET']
USERNAME = os.environ['PARASUT_USERNAME']
PASSWORD = os.environ['PARASUT_PASSWORD']
client_obj = Client(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
username=USERNAME,
password=PASSWORD,
#sandbox=True
)
client_obj.initialize()
# Call functions that calls endpoints on parasut api
client_obj.functions.indexInvoice()
# POST Example
import os
from parasut.client import Client
Expand All @@ -35,21 +17,24 @@ 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 making auth, token and other requirements, it's required
# It's required
client_obj.initialize()
# You can get request parameters from
# https://apidocs.parasut.com/#operation/createContact
# Remove ids if you creating new object
# All required request data examples can be found at
# https://apidocs.parasut.com
data = {
"data": {
"id": "string",
"type": "contacts",
"attributes": {
"email": "[email protected]",
Expand Down Expand Up @@ -93,8 +78,6 @@ data = {
obj = client_obj.functions.createContact(data)
print(obj.json())
#
```

## Package
Expand Down Expand Up @@ -152,3 +135,6 @@ To see an html output of coverage open ```htmlcov/index.html``` after running th

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
3 changes: 1 addition & 2 deletions parasut/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
from .functions import Functions
from . import urls
from functools import wraps
# from functools import wraps


class Client(object):
Expand Down Expand Up @@ -76,7 +76,6 @@ def getToken(self):
tokenUrl = urls.SANDBOX_TOKEN_URL
else:
tokenUrl = urls.TOKEN_URL
print(tokenUrl)
token = self.request.fetch_token(token_url=tokenUrl,
username=self.username,
password=self.password,
Expand Down

0 comments on commit 7d7451a

Please sign in to comment.