Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

alpaca

> 开发工具
Open source

Given a web API, Generate client libraries in node, php, python, ruby

2.4K stars0 likes0 views
WebsiteGitHub

About

Given a web API, Generate client libraries in node, php, python, ruby

alpaca

Api Libraries Powered And Created by Alpaca


Tired of maintaining API libraries in different languages for your website API? This is for you

You have an API for your website but no API libraries for whatever reason? This is for you

You are planning to build an API for your website and develop API libraries? This is for you


You define your API according to the format given below, alpaca builds the API libraries along with their documentation. All you have to do is publishing them to their respective package managers.

Join us at gitter if you need any help.

Installation

You can download the binaries (v0.2.1)

  • Architecture i386 [ linux / windows / darwin / freebsd / openbsd / netbsd / plan9 ]
  • Architecture amd64 [ linux / windows / darwin / freebsd / openbsd / netbsd ]
  • Architecture arm [ linux / freebsd / netbsd ]

Or by using deb packages (v0.2.1)

  • [ i386 / amd64 / armhf ]

Or by using golang (v1.2)

# Clone the project into your golang workspace
$ git clone git://github.com/pksunkara/alpaca
$ cd alpaca

# Install program
$ make && make install

Examples

You can find some api definitions in the examples directory. The api libraries generated are at https://github.com/alpaca-api

Completed api definitions are buffer.

Usage

$ alpaca </path/to/dir>

The path here should be a directory with api.json, pkg.json, doc.json

Usage:
  alpaca [options] <dir>

Application Options:
  -v, --version    Show version information

Language Options:
      --no-php     Do not write php library
      --no-python  Do not write python library
      --no-ruby    Do not write ruby library
      --no-node    Do not write node library

Help Options:
  -h, --help       Show this help message

Please remove the comments when actually using these json files

pkg.json

All the following fields are required unless mentioned.

…

api.json

All the following fields are required unless mentioned.

…

doc.json

The following is filled according to the entries in api.json

…

Request formats

Supported request formats are raw, form, json. The format raw is always true.

This means, the body set in the options when calling an API method will be able to be encoded according to the respective request_type

If set to raw, body is not modified at all

Response formats

Supported response formats are html, json.

Authorization strategies

Supported are basic, header, oauth

Language Versions

Supported programming language versions are:

Language V E R S I O N
node 0.8 0.9 0.10 0.11 0.12
php 5.4 5.5
python 2.6 2.7 3.2 3.3
ruby 1.8.7 1.9.1 1.9.2 1.9.3 2.0.0 2.1.0 2.1.1

Package Managers

Language Package Manager
node https://npmjs.org
php https://packagist.org
python https://pypi.python.org
ruby https://rubygems.org

Testing

Check here to learn about testing.

Contributors

Here is a list of Contributors

I accept pull requests and guarantee a reply back within a day

TODO

You get internet points for pull requesting the following features.

Responses
  • Add support for XML
  • Add support for CSV
Requests
  • HTTP Method Overloading
  • What about file uploads?
API
  • Check returned status code
  • Special case for 204:true and 404:false
Libraries
  • Pagination support
  • Classes inside classes (so on..)
  • Validations for params/body in api methods
  • Allow customization of errors
  • Tests for libraries (lots and lots of tests)
Readme
  • Optional params available
  • Return types of api calls
Comments
  • The descriptions should be wrapped
  • Align @param descriptions
Formats
  • Support YAML
  • Support API blueprint
  • Support Swagger
  • Support WADL
  • Support JSON Schema
  • Support RAML
Languages
  • Support Java
  • Support Go
  • Support Clojure
  • Support Rust
  • Support Swift
  • Support C, C++, Perl, Scala, C#, Erlang, Lua, Haskell, D, Julia, Groovy
  • Build cli tool for APIs (bash? python? go?)

Support Projects

Alternatively, you can write your own converter from alpaca.json to the following

  • Convert into API Blueprint
  • Convert into Swagger

License

MIT/X11

Bug Reports

Report here. Guaranteed reply within a day.

Contact

Pavan Kumar Sunkara ([email protected])

Follow me on github, twitter

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goalpacaapiapi-clientapis

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具