{"id":13467872,"url":"https://github.com/pksunkara/alpaca","last_synced_at":"2025-12-17T03:25:27.442Z","repository":{"id":9257932,"uuid":"11083045","full_name":"pksunkara/alpaca","owner":"pksunkara","description":"Given a web API, Generate client libraries in node, php, python, ruby","archived":true,"fork":false,"pushed_at":"2019-12-19T21:31:23.000Z","size":370,"stargazers_count":2453,"open_issues_count":33,"forks_count":89,"subscribers_count":72,"default_branch":"master","last_synced_at":"2024-10-29T21:59:06.819Z","etag":null,"topics":["alpaca","api","api-client","apis","client-library","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pksunkara.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-01T03:02:05.000Z","updated_at":"2024-10-27T03:47:36.000Z","dependencies_parsed_at":"2022-08-09T17:31:40.540Z","dependency_job_id":null,"html_url":"https://github.com/pksunkara/alpaca","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pksunkara%2Falpaca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pksunkara%2Falpaca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pksunkara%2Falpaca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pksunkara%2Falpaca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pksunkara","download_url":"https://codeload.github.com/pksunkara/alpaca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584727,"owners_count":20639618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpaca","api","api-client","apis","client-library","go","golang"],"created_at":"2024-07-31T15:01:01.755Z","updated_at":"2025-12-17T03:25:22.401Z","avatar_url":"https://github.com/pksunkara.png","language":"Go","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"readme":"# alpaca [![Build Status](https://travis-ci.org/pksunkara/alpaca.svg?branch=master)](https://travis-ci.org/pksunkara/alpaca) [![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pksunkara/alpaca)\n\nApi Libraries Powered And Created by Alpaca\n\n---\n\nTired of maintaining API libraries in different languages for your website API? _This is for you_\n\nYou have an API for your website but no API libraries for whatever reason? _This is for you_\n\nYou are planning to build an API for your website and develop API libraries? _This is for you_\n\n---\n\nYou 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.\n\nJoin us at [gitter](https://gitter.im/pksunkara/alpaca) if you need any help.\n\n## Installation\n\nYou can download the binaries (v0.2.1)\n\n * Architecture i386 [ [linux](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_linux_386.tar.gz?direct) / [windows](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_windows_386.zip?direct) / [darwin](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_darwin_386.zip?direct) / [freebsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_freebsd_386.zip?direct) / [openbsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_openbsd_386.zip?direct) / [netbsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_netbsd_386.zip?direct) / [plan9](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_plan9_386.zip?direct) ]\n * Architecture amd64 [ [linux](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_linux_amd64.tar.gz?direct) / [windows](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_windows_amd64.zip?direct) / [darwin](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_darwin_amd64.zip?direct) / [freebsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_freebsd_amd64.zip?direct) / [openbsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_openbsd_amd64.zip?direct) / [netbsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_netbsd_amd64.zip?direct) ]\n * Architecture arm [ [linux](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_linux_arm.tar.gz?direct) / [freebsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_freebsd_arm.zip?direct) / [netbsd](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_netbsd_arm.zip?direct) ]\n\nOr by using deb packages (v0.2.1)\n\n * [ [i386](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_i386.deb?direct) / [amd64](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_amd64.deb?direct) / [armhf](https://dl.bintray.com//content/pksunkara/utils/alpaca_0.2.1_armhf.deb?direct) ]\n\nOr by using golang (v1.2)\n\n```bash\n# Clone the project into your golang workspace\n$ git clone git://github.com/pksunkara/alpaca\n$ cd alpaca\n\n# Install program\n$ make \u0026\u0026 make install\n```\n\n## Examples\n\nYou can find some api definitions in the [examples](https://github.com/pksunkara/alpaca/tree/master/examples) directory. The api libraries generated are at [https://github.com/alpaca-api](https://github.com/alpaca-api)\n\nCompleted api definitions are [buffer](https://github.com/pksunkara/alpaca/tree/master/examples/buffer).\n\n## Usage\n\n```bash\n$ alpaca \u003c/path/to/dir\u003e\n```\n\nThe path here should be a directory with `api.json`, `pkg.json`, `doc.json`\n\n```\nUsage:\n  alpaca [options] \u003cdir\u003e\n\nApplication Options:\n  -v, --version    Show version information\n\nLanguage Options:\n      --no-php     Do not write php library\n      --no-python  Do not write python library\n      --no-ruby    Do not write ruby library\n      --no-node    Do not write node library\n\nHelp Options:\n  -h, --help       Show this help message\n```\n\n_Please remove the comments when actually using these json files_\n\n#### pkg.json\n\nAll the following fields are required unless mentioned.\n\n```js\n{\n  \"name\": \"Example\", // Name of the api (also used as class name for the library)\n  \"package\": \"example-alpaca\", // Name of the package\n  \"version\": \"0.1.0\", // Version of the package\n  \"url\": \"https://exampleapp.com\", // URL of the api\n  \"keywords\": [\"alpaca\", \"exampleapp\", \"api\"], // Keywords for the package\n  \"official\": false, // Are the api libraries official?\n  \"author\": {\n    \"name\": \"Pavan Kumar Sunkara\", // Name of the package author\n    \"email\": \"pavan.sss1991@gmail.com\", // Email of the package author\n    \"url\": \"http://github.com/pksunkara\" // URL of the package author\n  },\n  \"git\": { // Used in the package definition\n    \"site\": \"github.com\", // Name of the git website\n    \"user\": \"alpaca-api\", // Username of the git website\n    \"name\": \"buffer\" // Namespace of the git repositories\n  },\n  \"license\": \"MIT\", // License of the package\n  \"php\": { // Required only if creating php api lib\n    \"vendor\": \"pksunkara\" // Packagist vendor name for the package\n  },\n  \"python\": { // Required only if creating python api lib\n    \"license\": \"MIT License\" // Classifier of the license used for the module\n  }\n}\n```\n\n#### api.json\n\nAll the following fields are required unless mentioned.\n\n```js\n{\n  \"base\": \"https://exampleapp.com\", // Base URL of the api\n  \"base_as_arg\": true, // Force Base URL to be an argument in generated clients [optional] (default: false)\n  \"version\": \"v1\", // Default version for the api (https://api.example.com{/version}/users) [optional]\n  \"no_verify_ssl\": true, // Do not verify SSL cert [optional] (default: false)\n  \"authorization\": { // Authorization strategies\n    \"need_auth\": true, // Authentication is compulsory [optional] (default: false)\n    \"basic\" : true, // Basic authentication [optional] (default: false)\n    \"header\": true, // Token in authorization header [optional] (default: false)\n    \"header_prefix\": \"oompaloompa\", // The first word in header if using token auth header [optional] (default: token)\n    \"oauth\" : true // OAUTH authorization [optional] (default: false)\n  },\n  \"request\": { // Settings for requests to the api\n    \"formats\": { // Format of the request body\n      \"default\": \"form\", // Default format for the request body [optional] (default: raw)\n      \"form\": true, // Support form-url-encoded? [optional] (default: false)\n      \"json\": true // Support json? [optional] (default: false)\n    }\n  },\n  \"response\": { // Settings for responses from the api\n    \"suffix\": true, // Should the urls be suffixed with response format? [optional] (default: false)\n    \"formats\": { // Format of the response body\n      \"default\": \"json\", // Default response format. Used when 'suffix' is 'true'\n      \"html\": true, // Support html? [optional] (default: false)\n      \"json\": true // Support json? [optional] (default: false)\n    }\n  },\n  \"error\": { // Required if response format is 'json'\n    \"message\": \"error\" // The field to be used from the response body for error message\n  },\n  \"class\": { // The classes for the api\n    \"users\": { // Name of a class of the api\n      \"args\": [\"login\"], // Arguments required for the api class [optional]\n      \"profile\": { // Name of a method of the api\n        \"path\": \"/users/:login/:type\", // URL of the api method\n        \"method\": \"post\", // HTTP method of the api method [optional] (default: get)\n        \"params\": [ // Parameters for the api method [optional]\n          {\n            \"name\": \"type\", // Name of the parameter\n            \"required\": true, // The parameter will become an argument of api method [optional] (default: false)\n            \"url_use\": true // This parameter is only used to build url [optional] (default: false)\n          },\n          {\n            \"name\": \"bio\",\n            \"required\": true\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n#### doc.json\n\nThe following is filled according to the entries in `api.json`\n\n```js\n{\n  \"users\": { // Name of a class of the api\n    \"title\": \"Users\", // Title of the api class\n    \"desc\": \"Returns user api instance\", // Description of the api class\n    \"args\": { // Arguments of the api class\n      \"login\": { // Name of the argument\n        \"desc\": \"Username of the user\", // Description of the argument\n        \"value\": \"pksunkara\" // Value of the argument in docs\n      }\n    },\n    \"profile\": { // Name of a method of the api\n      \"title\": \"Edit profile\", // Title of the api method\n      \"desc\": \"Edit the user's profile\", // Description of the api method\n      \"params\": { // Parameter of the api class\n        \"bio\": { // Name of the parameter\n          \"desc\": \"Short bio in profile\", // Description of the parameter\n          \"value\": \"I am awesome!\" // Value of the parameter in docs\n        },\n        \"type\": {\n          \"desc\": \"Circle of the profile\",\n          \"value\": \"friends\"\n        }\n      }\n    }\n  }\n}\n```\n\n### Request formats\n\nSupported request formats are `raw`, `form`, `json`. The format `raw` is always true.\n\nThis means, the `body` set in the options when calling an API method will be able to be encoded according to the respective `request_type`\n\n__If set to `raw`, body is not modified at all__\n\n### Response formats\n\nSupported response formats are `html`, `json`.\n\n### Authorization strategies\n\nSupported are `basic`, `header`, `oauth`\n\n### Language Versions\n\nSupported programming language versions are:\n\n| Language |   V   |   E   |   R   |   S   |   I   |   O   |   N   |\n|----------|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|\n| node     | 0.8   | 0.9   | 0.10  | 0.11  | 0.12  |       |       |\n| php      | 5.4   | 5.5   |       |       |       |       |       |\n| python   | 2.6   | 2.7   | 3.2   | 3.3   |       |       |       |\n| ruby     | 1.8.7 | 1.9.1 | 1.9.2 | 1.9.3 | 2.0.0 | 2.1.0 | 2.1.1 |\n\n### Package Managers\n\n| Language | Package Manager                                    |\n|----------|----------------------------------------------------|\n| node     | [https://npmjs.org](https://npmjs.org)             |\n| php      | [https://packagist.org](https://packagist.org)     |\n| python   | [https://pypi.python.org](https://pypi.python.org) |\n| ruby     | [https://rubygems.org](https://rubygems.org)       |\n\n## Testing\n\nCheck [here](https://github.com/pksunkara/alpaca/tree/testing) to learn about testing.\n\n## Contributors\n\nHere is a list of [Contributors](https://github.com/pksunkara/alpaca/contributors)\n\n__I accept pull requests and guarantee a reply back within a day__\n\n### TODO\n\nYou get internet points for pull requesting the following features.\n\n##### Responses\n\n * [Add support for XML](https://github.com/pksunkara/alpaca/issues/36)\n * [Add support for CSV](https://github.com/pksunkara/alpaca/issues/36)\n\n##### Requests\n\n * HTTP Method Overloading\n * What about file uploads?\n\n##### API\n\n * Check returned status code\n * Special case for 204:true and 404:false\n\n##### Libraries\n\n * Pagination support\n * Classes inside classes (so on..)\n * Validations for params/body in api methods\n * Allow customization of errors\n * Tests for libraries (lots and lots of tests)\n\n##### Readme\n\n * [Optional params available](https://github.com/pksunkara/alpaca/issues/57)\n * Return types of api calls\n\n##### Comments\n\n * The descriptions should be wrapped\n * Align @param descriptions\n\n##### Formats\n\n * [Support YAML](https://github.com/pksunkara/alpaca/issues/63)\n * [Support API blueprint](https://github.com/pksunkara/alpaca/issues/56)\n * [Support Swagger](https://github.com/pksunkara/alpaca/issues/61)\n * [Support WADL](https://github.com/pksunkara/alpaca/issues/13)\n * [Support JSON Schema](https://github.com/pksunkara/alpaca/issues/17)\n * [Support RAML](https://github.com/pksunkara/alpaca/issues/54)\n\n##### Languages\n\n * [Support Java](https://github.com/pksunkara/alpaca/issues/11)\n * [Support Go](https://github.com/pksunkara/alpaca/issues/9)\n * [Support Clojure](https://github.com/pksunkara/alpaca/issues/49)\n * [Support Rust](https://github.com/pksunkara/alpaca/issues/62)\n * [Support Swift](https://github.com/pksunkara/alpaca/issues/64)\n * Support C, C++, Perl, Scala, C#, Erlang, Lua, Haskell, D, Julia, Groovy\n * Build cli tool for APIs (bash? python? go?)\n\n### Support Projects\n\nAlternatively, you can write your own converter from `alpaca.json` to the following\n\n* Convert into API Blueprint\n* Convert into Swagger\n\n## License\n\nMIT/X11\n\n## Bug Reports\n\nReport [here](http://github.com/pksunkara/alpaca/issues). __Guaranteed reply within a day__.\n\n## Contact\n\nPavan Kumar Sunkara (pavan.sss1991@gmail.com)\n\nFollow me on [github](https://github.com/users/follow?target=pksunkara), [twitter](http://twitter.com/pksunkara)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpksunkara%2Falpaca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpksunkara%2Falpaca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpksunkara%2Falpaca/lists"}