Signals Documentation

Similar documents
django simple pagination Documentation

Django MFA Documentation

flask-dynamo Documentation

Python Schema Generator Documentation

nacelle Documentation

django-private-chat Documentation

Django Wordpress API Documentation

django-idioticon Documentation

I hate money. Release 1.0

Python Project Example Documentation

Mantis STIX Importer Documentation

django-reinhardt Documentation

dj-libcloud Documentation

django-cas Documentation

Python wrapper for Viscosity.app Documentation

Release Fulfil.IO Inc.

git-pr Release dev2+ng5b0396a

open-helpdesk Documentation

Django-frontend-notification Documentation

Roman Numeral Converter Documentation

Poetaster. Release 0.1.1

django-konfera Documentation

TPS Documentation. Release Thomas Roten

contribution-guide.org Release

django-dynamic-db-router Documentation

django-telegram-bot Documentation

EXPERIENCES MOVING FROM DJANGO TO FLASK

chatterbot-weather Documentation

AngularJS Fundamentals

Stepic Plugins Documentation

DJOAuth2 Documentation

mongodb-tornado-angular Documentation

withenv Documentation

Python simple arp table reader Documentation

Release Nicholas A. Del Grosso

Kivy Designer Documentation

Unifer Documentation. Release V1.0. Matthew S

Gearthonic Documentation

Pulp Python Support Documentation

Cross-Platform Data Models and API Using grpc

Investigating Source Code Reusability for Android and Blackberry Applications

Gunnery Documentation

django-stored-messages Documentation

pyldavis Documentation

Django Test Utils Documentation

Quick housekeeping Last Two Homeworks Extra Credit for demoing project prototypes Reminder about Project Deadlines/specifics Class on April 12th Resul

Google Domain Shared Contacts Client Documentation

django-composite-foreignkey Documentation

petfinder-api Documentation

Django-CSP Documentation

google-search Documentation

Human-Computer Interaction Design

PROCE55 Mobile: Web API App. Web API.

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

I2C LCD Documentation

PyZillow Documentation

GMusicProcurator Documentation

Django Localized Recurrence Documentation

hg-review Documentation

welcome to BOILERCAMP HOW TO WEB DEV

Application documentation Documentation

Con. Continuous Integration

django-composite-foreignkey Documentation

Web2py Instant Admin Documentation

CID Documentation. Release Francis Reyes

sainsmart Documentation

PyCRC Documentation. Release 1.0

Human-Computer Interaction Design

Python data pipelines similar to R Documentation

JavaScript Fundamentals_

eventbrite-sdk-python Documentation

Scala Days 2018 You Are a Scala Contributor

classjs Documentation

Durga Documentation. Release dev2. transcode

Automation with Meraki Provisioning API

DNS Zone Test Documentation

invenio-formatter Documentation

RIPE Atlas Cousteau Documentation

Aldryn Installer Documentation

neo4django Documentation

Esri on GitHub: How to Participate in Open Source Projects

BanzaiDB Documentation

Orchestra. Release 0.1.2

Aircrack-ng python bindings Documentation

OpenUpgrade Library Documentation

Collaborate. w/ ArcGIS Runtime SDK for Android

django-waffle Documentation

django-users2 Documentation

Redis Timeseries Documentation

Git Basi, workflow e concetti avanzati (pt2)

Carousel Model Simulation Framework PVLIB Users Group Meeting ERPI / Sandia PV System Symposium

Tableau Automation Starter Kit:

smsghussd Documentation

e24paymentpipe Documentation

Building a Django Twilio Programmable Chat Application

TigerConnect. Product Guide. Tajreen Ahmed Jessica Edouard Kevin Finch Lillian Meng

PyCon APAC 2014 Documentation

pycall Documentation Release Randall Degges

FPLLL. Contributing. Martin R. Albrecht 2017/07/06

Extract API: Build sophisticated data models with the Extract API

Transcription:

Signals Documentation Release 0.1 Yeti November 22, 2015

Contents 1 Quickstart 1 2 What is Signals? 3 3 Contents 5 3.1 Get Started................................................ 5 3.2 Try the Demo Server........................................... 5 3.3 How It Works............................................... 6 3.4 Writing Your Own Generator...................................... 6 3.5 Writing Your Own Template....................................... 6 3.6 Contributing............................................... 6 i

ii

CHAPTER 1 Quickstart 1. pip install yak-signals 2. signals --schema ~/path/to/schema.json --generator ios 1

Signals Documentation, Release 0.1 2 Chapter 1. Quickstart

CHAPTER 2 What is Signals? Signals is a code generation tool to take the grunt work out of communicating between your front-end and backend applications. Simply describe your server endpoints in a JSON file and watch Signals automatically generate Objective-C data model files. When you update your API, all you have to do to update your front-end code is re-run the script. Signals is an open-source project initially built by the folks at Yeti. 3

Signals Documentation, Release 0.1 4 Chapter 2. What is Signals?

CHAPTER 3 Contents 3.1 Get Started Signals is a tool that will automatically generate front-end code for you based on a JSON schema file. This means that you can simply define your API endpoints, and if they change, you can just update the JSON schema, run signals, and have your front-end update to reflect the changes. No more need to write boilerplate code to define your models or how they talk to your server. Signals is backend-agnostic, and can be used for Django, Rails, Node, etc. apps. 1. Signals is written in Python. You ll need Python on your machine if you don t have it yet. 2. pip install yak-signals 3. To see if signals successfully installed, run signals --help 4. To run signals, you just need to specify the JSON schema file you want to use, what sort of code you want to generate (ObjC, Angualar, etc.), and any options for that generator See below for specific instructions for each generator. 3.1.1 ios Currently, our ios generator assumes you are using Objective-C, Core Data, and Restkit. If you have a different setup (Alamofire, Swift, etc.), see the section on writing-your-own-template. 1. If your API changes will affect Core Data (e.g., you are changing the fields you receive as a response to a call): Make sure you first quit Xcode Run signals and pass the --coredata flag (e.g., signals --schema ~/path/to/schema.json --generator ios --coredata) (TODO: is this how you do it?) If you changed the core data models, you ll need to have xcode auto generate the new model files (TODO: someone mention how to do this) 2. If you re not changing Core Data, just run signals: signals --schema ~/path/to/schema.json --generator ios (TODO: is this how you do it?) 3.2 Try the Demo Server Signals comes with a demo server that you can test against just to see how this is all working. 5

Signals Documentation, Release 0.1 1. Save the sample schema from the demo server docs. 2. signals --schema ~/path/to/schema.json --generator ios 3. TODO: what sort of thing can a user now do automatically? 3.3 How It Works Signals has three main components: The parser The generators The templates 3.3.1 Parser The parser reads your JSON schema file and translates those JSON objects into Python objects. It creates two main types of objects DataObject s, which include the fields, relationships, and structure of the data your API sends, and URL s with specific API endpoints associated. 3.3.2 Generators By and large, each generator should correspond to a front-end platform (e.g., ios, Android, AngularJS). TODO: Better explanation of what a generator does that is separate from what the templates do 3.3.3 Templates We use Jinja, the popular Python templating engine, to produce the actual model definitions and code to make server requests. A single generator could have multiple template styles. For example, the ios generator could have both Objective-C and Swift templates, an AngularJS generator could have templates for $http, $resource, and restangular. 3.4 Writing Your Own Generator 3.5 Writing Your Own Template 3.6 Contributing Signals is an open-source project and we welcome suggestions, questions, and code. Report bugs, issues, and feature requests to the Github issue tracker. 6 Chapter 3. Contents

Signals Documentation, Release 0.1 3.6.1 Recommended Setup 1. Fork and clone your own copy of the Signals Github repo 2. Create a new python virtual environment 3. pip install -r requirements.txt 4. pip install -r dev-requirements.txt 3.6.2 Run Tests To run the tests, just run nosetests. 3.6.3 Submitting Changes Open a pull request from your Github repo to /yeti/signals/master Provide an overview of your changes Specify any issues (by number) that your PR addresses PRs won t be merged if they break tests Feel free to ask for help or guidance! 3.6. Contributing 7