Tastypie-client is a client API for Django-Tastypie REST services.
Quick start
These examples work on the tastypie_tutorial Django project.
Create an Api object
>>> from tastypie_client import Api
>>> api = Api('http://127.0.0.1:8000/api/1/')
>>> api
<Api: http://127.0.0.1:8000/api/1/>
Finds an user by its ID
>>> api.user
<EndpointProxy http://127.0.0.1:8000/api/1/user/>
>>> user = api.user(1)
>>> user
<Resource user/1: {u'username': u'test_user', ...}>
>>> user.username
u'test_user'
Look at its posts
>>> user.posts [u'/api/1/entry/1/', u'/api/1/entry/2/']
Get the first one
>>> user.posts[0]
Resource entry/1: {u'body': u'foo body', u'title': u'foo!', u'id': u'1', u'user': <ResourceProxy user/1>, u'pub_date': u'2012-04-29T08:55:08', u'slug': u'foo'}>
Alternatively, you load both of them with an unique HTTP request
>>> user.posts[:]
[<Resource entry/1: {u'body': u'foo body', u'title': u'foo!', u'id': u'1', u'user': <ResourceProxy user/1>, u'pub_date': u'2012-04-29T08:55:08', u'slug': u'foo'}>,
<Resource entry/2: {u'body': u'bar body', u'title': u'bar title', u'id': u'2', u'user': <ResourceProxy user/1>, u'pub_date': u'2012-04-29T08:55:21', u'slug': u'bar'}>]
Metadata
Release files for tastypie-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tastypie-client-0.1.0.tar.gz | 8.9 kB | Without provenance | Details for tastypie-client-0.1.0.tar.gz |
Release files / tastypie-client-0.1.0.tar.gz
| Download URL | tastypie-client-0.1.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
370f8b178d01e6134bebbc9abc577e3d629bb5b21322538cd9f27c23ea4b0b5c
|
|
BLAKE2b-256 checksum How to use checksums |
177ebb6f2ab30a51beff78d61fe5fe03697e72f9d809ea15b65247bf6d84ecbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tastypie-client 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.