{"id":13502221,"url":"https://github.com/usablica/liaar","last_synced_at":"2025-03-29T10:32:50.090Z","repository":{"id":19317344,"uuid":"22555456","full_name":"usablica/liaar","owner":"usablica","description":"Create fake REST API in a minute","archived":false,"fork":false,"pushed_at":"2023-10-25T21:16:40.000Z","size":141,"stargazers_count":199,"open_issues_count":1,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-04T14:47:53.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://usablica.github.io/liaar","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usablica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2014-08-02T19:29:42.000Z","updated_at":"2024-11-28T16:29:47.000Z","dependencies_parsed_at":"2024-01-17T08:44:29.433Z","dependency_job_id":"31f6e504-ad1a-49d8-b018-aa73e7a8a44c","html_url":"https://github.com/usablica/liaar","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Fliaar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Fliaar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Fliaar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Fliaar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usablica","download_url":"https://codeload.github.com/usablica/liaar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174207,"owners_count":20735406,"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":[],"created_at":"2024-07-31T22:02:06.513Z","updated_at":"2025-03-29T10:32:49.652Z","avatar_url":"https://github.com/usablica.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Liaar\n\nCreate fake REST API in a minute\n\n\u003cp align=\"center\"\u003e\u003cimg src='http://usablica.github.io/liaar/images/pinocchio.jpg' /\u003e\u003c/p\u003e\n\n\n##Install\n\nIssue following command:\n\n     pip install liaar\n     \nor with `easy_install`:\n\n     easy_install liaar\n\nAbove commands install all dependecies automatically. Then use following command to run the liaar:\n\n    liaar\n\nThen you should see the liaar picture.\n\n##How to use\n\nYou should create directories as resources’ namespace and place JSON files inside them as API methods.\n\nSuppose you have following directory structure:\n\n```\napps\n     |_ .\n     |_ ..\n     |_ blog\n             |_ .\n             |_ ..\n             |_ setting.json\n             |_ resources\n                          |_ .\n                          |_ ..\n                          |_ users\n                                   |_ .\n                                   |_ ..\n                                   |_ profile.json\n```\n\nAnd the url would be `http://127.0.0.1:1234/blog/v1/users/profile`. In next parts you can read more about resource and application setting JSON file's format.\n\n##Schema\n\nIn order to run the application, you should define application’s setting and resources using JSON files.\nThis section shows you the schema of these JSON files.\n\n###setting.json: Application setting\n\nUsing this file you can define global properties for the application. The `setting.json` can have following properties:\n\n####Mandatory\n- version {string} - Version number of application\n\nFollowing JSON file shows an example of `setting.json`:\n\n     {\n       \"version\": \"1\"\n     }\n\n\n###Application resources\nUsing this file you define application's resources. This JSON file can have as many as fields you need and each value can be either `string` or `object`. Following JSON file is an example of a resource:\n\n          {\n            \"firstName\": \"first_name\",\n            \"lastName\": \"last_name\",\n            \"username\": \"user_name\"\n          }\n\nThe output of above resource file is:  \n\n     {\n       \"firstName\": \"Polk\",\n       \"lastName\": \"Nienow\",\n       \"username\": \"kbogan\"\n     }\n\n\nIf you need a list of values instead of a single value, you can use nested object like following:\n\n     {\n       \"firstName\": \"first_name\",\n       \"lastName\": \"last_name\",\n       \"username\": \"user_name\",\n       \"email\": {\n         \"liaar_type\": \"list\",\n         \"liaar_count\": 3,\n         \"liaar_formatter\": \"email\"\n       }\n     }\n\nAnd then the output of above JSON file would be:\n\n     {\n       \"username\": \"kbogan\",\n       \"lastName\": \"Nienow\",\n       \"email\": [\"darcie.pfannerstill@mohr.com\", \"barton.elvira@haneoconnell.com\", \"imills@hotmail.com\"],\n       \"firstName\": \"Polk\"\n     }\n\n\nLiaar uses [Faker](http://www.joke2k.net/faker/) library to generate fake data for API methods. You can use all Faker's formatters to produce fake data. Following list shows current available formatters to use in Liaar:\n\n**file**:\n\n     mime_type                   # video/webm\n\n**user_agent**:\n\n     chrome                      # Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_8_4) AppleWebKit/5341 (KHTML, like Gecko) Chrome/13.0.803.0 Safari/5341\n     firefox                     # Mozilla/5.0 (Windows 95; sl-SI; rv:1.9.1.20) Gecko/2012-01-06 22:35:05 Firefox/3.8\n     internet_explorer           # Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.1)\n     linux_platform_token        # X11; Linux x86_64\n     linux_processor             # x86_64\n     mac_platform_token          # Macintosh; U; PPC Mac OS X 10_7_6\n     mac_processor               # U; PPC\n     opera                       # Opera/9.41 (Windows CE; it-IT) Presto/2.9.168 Version/12.00\n     safari                      # Mozilla/5.0 (Windows; U; Windows NT 5.1) AppleWebKit/534.34.4 (KHTML, like Gecko) Version/5.0 Safari/534.34.4\n     user_agent                  # Mozilla/5.0 (iPod; U; CPU iPhone OS 3_2 like Mac OS X; en-US) AppleWebKit/531.15.3 (KHTML, like Gecko) Version/4.0.5 Mobile/8B119 Safari/6531.15.3\n     windows_platform_token      # Windows 98; Win 9x 4.90\n\n\n**phone_number**:\n\n     phone_number                # (593)652-1880\n\n\n**miscelleneous**:\n\n     random_number               # 3438\n     random_digit                # 3\n     boolean                     # True\n     country_code                # BB\n     language_code               # fr\n     locale                      # pt_GN\n     md5                         # ab9d3552b5c6e68714c04c35725ba73c\n     null_boolean                # True\n     sha1                        # 3fc2ede28f2596050f9a94c15c59b800175409d0\n     sha256                      # f06561a971d6b1306ecef60be336556d6de2540c2d0d2158f4d0ea3f212cd740\n\n\n**internet**:\n\n     company_email               # ggreenfelder@ortizmedhurst.com\n     domain_name                 # mayer.com\n     domain_word                 # gusikowski\n     email                       # gbrakus@johns.net\n     free_email                  # abbey60@yahoo.com\n     free_email_domain           # hotmail.com\n     ipv4                        # 81.132.249.71\n     ipv6                        # 4c55:8c8b:54b5:746d:44ed:c7ab:486a:a50e\n     safe_email                  # amalia49@example.com\n     slug                        # TypeError\n     tld                         # net\n     uri                         # http://www.parker.com/\n     uri_extension               # .asp\n     uri_page                    # terms\n     uri_path                    # explore/list/app\n     url                         # http://dubuque.info/\n     user_name                   # goodwin.edwin\n\n**company**:\n\n     bs                          # maximize end-to-end infrastructures\n     catch_phrase                # Multi-tiered analyzing instructionset\n     company                     # Stanton-Luettgen\n     company_suffix              # Group\n\n**date_time**:\n\n     am_pm                       # AM\n     century                     # IX\n     date                        # 1985-02-17\n     date_time                   # 1995-06-08 14:46:50\n     date_time_ad                # 1927-12-17 23:08:46\n     date_time_between           # 1999-08-22 22:49:52\n     date_time_this_century      # 1999-07-24 23:35:49\n     date_time_this_decade       # 2008-01-27 01:08:37\n     date_time_this_month        # 2012-11-12 14:13:04\n     date_time_this_year         # 2012-05-19 00:40:00\n     day_of_month                # 23\n     day_of_week                 # Friday\n     iso8601                     # 2009-04-09T21:30:02\n     month                       # 03\n     month_name                  # April\n     time                        # 06:16:50\n     timezone                    # America/Noronha\n     unix_time                   # 275630166\n     year                        # 2002\n\n**person**:\n\n     first_name                  # Elton\n     last_name                   # Schowalter\n     name                        # Susan Pagac III\n     prefix                      # Ms.\n     suffix                      # V\n\n**address**:\n\n     address                     # 044 Watsica Brooks West Cedrickfort, SC 35023-5157\n     building_number             # 319\n     city                        # Kovacekfort\n     city_prefix                 # New\n     city_suffix                 # ville\n     country                     # Monaco\n     geo_coordinate              # 148.031951\n     latitude                    # 154.248666\n     longitude                   # 109.920335\n     postcode                    # 82402-3206\n     secondary_address           # Apt. 230\n     state                       # Nevada\n     state_abbr                  # NC\n     street_address              # 793 Haskell Stravenue\n     street_name                 # Arvilla Valley\n     street_suffix               # Crescent\n\n**lorem**\n\n     paragraph                   # Itaque quia harum est autem inventore quisquam eaque. Facere mollitia repudiandae\n                                          qui et voluptas. Consequatur sunt ullam blanditiis aliquam veniam illum voluptatem.\n     paragraphs                  # ['Alias porro soluta eum voluptate. Iste consequatur qui non nam.',\n                                             'Id eum sint eius earum veniam fugiat ipsum et. Et et occaecati at labore\n                                             amet et. Rem velit inventore consequatur facilis. Eum consequatur consequatur\n                                             quis nobis.', 'Harum autem autem totam ex rerum adipisci magnam adipisci.\n                                             Qui modi eos eum vel quisquam. Tempora quas eos dolorum sint voluptatem\n                                             tenetur cum. Recusandae ducimus deleniti magnam ullam adipisci ipsa.']\n     sentence                    # Eum magni soluta unde minus nobis.\n     sentences                   # ['Ipsam eius aut veritatis iusto.',\n                                             'Occaecati libero a aut debitis sunt quas deserunt aut.',\n                                             'Culpa dolor voluptatum laborum at et enim.']\n     text                        # Dicta quo eius possimus quae eveniet cum nihil. Saepe sint non nostrum.\n                                          Sequi est sit voluptate et eos eum et. Pariatur non sunt distinctio magnam.\n     word                        # voluptas\n     words                       # ['optio', 'et', 'voluptatem']\n\n\n\n##Roadmap\n- Allow cross-domain XHR request\n- Better error handling\n- Add URL format to `setting.json`\n\n\n##Requirements\n\n- Python v2.7\n- Twisted v14.0\n- Faker v0.4.0\n\n\n##Thanks\n\n - [Mohammad Efazati](https://github.com/efazati)\n - [Amir Mohammad Said](https://github.com/amir)\n - http://investingcaffeine.com/ for Pinocchio picture\n\n\n## Author\n**Afshin Mehrabani**\n\n- [Twitter](https://twitter.com/afshinmeh)\n- [Github](https://github.com/afshinm)\n- [Personal page](http://afshinm.name/)\n\n\n##License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusablica%2Fliaar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusablica%2Fliaar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusablica%2Fliaar/lists"}