{"id":13433327,"url":"https://github.com/timwis/static-api","last_synced_at":"2025-09-21T00:31:48.117Z","repository":{"id":140607030,"uuid":"53049286","full_name":"timwis/static-api","owner":"timwis","description":"Creates a static API from a CSV file","archived":false,"fork":false,"pushed_at":"2016-08-01T18:26:31.000Z","size":210,"stargazers_count":29,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T17:11:10.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://timwis.github.io/static-api/sample-data.json","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timwis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-03T12:40:02.000Z","updated_at":"2021-05-04T01:53:53.000Z","dependencies_parsed_at":"2023-04-14T07:07:09.240Z","dependency_job_id":null,"html_url":"https://github.com/timwis/static-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timwis/static-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fstatic-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fstatic-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fstatic-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fstatic-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timwis","download_url":"https://codeload.github.com/timwis/static-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fstatic-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276179310,"owners_count":25598565,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T02:01:24.221Z","updated_at":"2025-09-21T00:31:47.893Z","avatar_url":"https://github.com/timwis.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Static API [![Build Status](https://travis-ci.org/timwis/static-api.svg?branch=master)](https://travis-ci.org/timwis/static-api)\nCreates a static API from a CSV file and publishes it to a static web server using Travis CI.\nInspired by @waldoj's [instant-api](https://github.com/waldoj/instant-api).\n\nAnimals.csv\n```csv\nName, Animal, Color\nFido, Dog, Brown\nWhiskers, Cat, Black\nMini, Elephant, Grey\n```\nbecomes\n```\n/animals.json\n[\n  {\"Name\": \"Fido\", \"Animal\": \"Dog\", ...},\n  {\"Name\": \"Whiskers\", ...}\n  ...\n]\n\n/animals/fido.json\n{\"Name\": \"Fido\", \"Animal\": \"Dog\", ...}\n\n/animals/whiskers.json\n{\"Name\": \"Whiskers\", ...}\n```\n\n# Example\nThe example file in this repository, [sample_data.csv](sample_data.csv), is automatically\npublished to the [gh-pages branch](https://github.com/timwis/static-api/tree/gh-pages)\nby [Travis CI](https://travis-ci.org/timwis/static-api) and can thus be viewed at\n[timwis.github.io/static-api/sample-data.json](http://timwis.github.io/static-api/sample-data.json),\n[/sample-data/23.json](http://timwis.github.io/static-api/sample-data/23.json), etc..\n\n# Manual Usage\n1. Clone this repository\n2. run `bundle install` to install dependencies\n3. Execute via command line using an environment variable\n```bash\nPRIMARY_KEY=\u003ckey\u003e ruby static-api.rb\n```\n\n# Automated Usage via Travis CI\n1. Fork this repository\n2. Enable Travis CI integration for your fork on the [travis dashboard](https://travis-ci.org/profile)\n3. Generate a new GitHub [personal access token](https://github.com/settings/tokens/new) (with `public_repo` access)\n4. On the Travis CI settings page for your fork (travis-ci.org/your-username/static-api/settings),\nadd your new personal access token as an environment variable with the name `GITHUB_TOKEN`.\nDo **not** enable the \"Display value in build log\" toggle (it's disabled by default).\n5. Add another environment variable called `PRIMARY_KEY` set to the field name to use as the CSV file's primary key.\n6. Add your `.csv` file to your fork by [drag-and-dropping](https://github.com/blog/2105-upload-files-to-your-repositories),\nusing [prose.io](http://prose.io)'s [CSV editor](https://github.com/prose/prose/pull/911), or using\ntraiditional git and push your changes to the `master` branch (default).\n\nTravis CI will be triggered by a push to the `master` branch, build your Static API, and push it\nto the `gh-pages` branch, allowing you to view it at `username.github.io/repo-name/file_name.json`\n\n**Hey,** do you have thoughts on a better way to use this? [Join the conversation!](https://github.com/timwis/static-api/issues/8) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fstatic-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimwis%2Fstatic-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fstatic-api/lists"}