forked from core-api/python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
32 lines (24 loc) · 958 Bytes
/
__init__.py
File metadata and controls
32 lines (24 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8
from coreapi.codecs import dump, load, negotiate_decoder, negotiate_encoder
from coreapi.client import Client
from coreapi.document import Array, Document, Link, Object, Error, Field
from coreapi.exceptions import ParseError, TransportError, ErrorMessage
from coreapi import codecs, history, transports
__version__ = '1.17.0'
__all__ = [
'Array', 'Document', 'Link', 'Object', 'Error', 'Field',
'ParseError', 'NotAcceptable', 'TransportError', 'ErrorMessage',
'Client',
'load', 'dump', 'negotiate_encoder', 'negotiate_decoder',
'get', 'action', 'reload',
'codecs', 'history', 'transports'
]
def get(url):
client = Client()
return client.get(url)
def action(document, keys, params=None, action=None, transform=None):
client = Client()
return client.action(document, keys, params, action=action, transform=transform)
def reload(document):
client = Client()
return client.reload(document)