gnomix / drest Goto Github PK
View Code? Open in Web Editor NEWThis project forked from datafolklabs/drest
Configurable HTTP/REST Client Library
Home Page: http://drest.rtfd.org
License: Other
This project forked from datafolklabs/drest
Configurable HTTP/REST Client Library
Home Page: http://drest.rtfd.org
License: Other
NAME: drest AUTHOR: BJ Dierkes <[email protected]> DESCRIPTION: dRest is a configurable HTTP/REST client library for Python. It's goal is to make the creation of API clients dead simple, without lacking features. FEATURES: * Light-weight API Client Library, implementing REST by default * Native support for the Django TastyPie API Framework * Only one external dependency on httplib2 * Key pieces of the library are customizable by defined handlers * Interface definitions ensure handlers are properly implemented * Support for Python 2.6+ and Python 3+ * 100% test coverage via Nose USAGE: import drest # Create a generic client api object api = drest.API('http://localhost:8000/api/v1/') # Make calls openly via any HTTP Method, and any path # GET http://localhost:8000/api/v1/users/1/ response, data = api.request('GET', '/users/1/') # Or attach a resource api.add_resource('users') # Get available resources api.resources >>> ['users', 'projects', 'etc'] # Get all objects of a resource # GET http://localhost:8000/api/v1/users/ response, data = api.users.get() # Get a single resource with primary key '1' # GET http://localhost:8000/api/v1/users/1/ response, data = api.users.get(1) # Create a resource data dictionary user_data = dict( username='john.doe', password'oober-secure-password', first_name='John', last_name'Doe', ) # POST http://localhost:8000/api/v1/users/ response, data = api.users.post(user_data) # Update a resource with primary key '1' response, data = api.users.get(1) updated_data = data.copy() updated_data['first_name'] = 'John' updated_data['last_name'] = 'Doe' # PUT http://localhost:8000/api/v1/users/1/ response, data = api.users.put(1, updated_data) # Delete a resource with primary key '1' # DELETE http://localhost:8000/api/v1/users/1/ response, data = api.users.delete(1) LICENSE: The dRest library is Open Source and is distributed under the BSD License (three clause). Please see the LICENSE file included with this software.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.