{"id":19178337,"url":"https://github.com/cyberpsychofc/locomotivedataapi","last_synced_at":"2026-06-20T21:30:20.218Z","repository":{"id":243454086,"uuid":"812328157","full_name":"cyberpsychofc/LocomotiveDataAPI","owner":"cyberpsychofc","description":"RESTful API about locomotives using Django REST framework","archived":false,"fork":false,"pushed_at":"2024-06-21T06:03:10.000Z","size":19019,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T02:52:13.465Z","etag":null,"topics":["api","django","django-rest-framework","jwt","python","rest-api"],"latest_commit_sha":null,"homepage":"","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/cyberpsychofc.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T15:22:34.000Z","updated_at":"2024-09-11T21:03:35.000Z","dependencies_parsed_at":"2024-11-09T10:48:59.419Z","dependency_job_id":null,"html_url":"https://github.com/cyberpsychofc/LocomotiveDataAPI","commit_stats":null,"previous_names":["cyberpsychofc/locomotivedataapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberpsychofc%2FLocomotiveDataAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberpsychofc%2FLocomotiveDataAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberpsychofc%2FLocomotiveDataAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberpsychofc%2FLocomotiveDataAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberpsychofc","download_url":"https://codeload.github.com/cyberpsychofc/LocomotiveDataAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240255297,"owners_count":19772594,"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":["api","django","django-rest-framework","jwt","python","rest-api"],"created_at":"2024-11-09T10:38:55.537Z","updated_at":"2026-06-20T21:30:20.152Z","avatar_url":"https://github.com/cyberpsychofc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# LocomotiveDataAPI\n\nLocomotiveDataAPI is a RESTful Web Service made in Django REST framework which aims to provide information Indian locomotives (Indian Railways) scraped from Wikipedia using Beautiful Soup.\n\n## Run Locally\n\nClone the project\n\n```bash\n  git clone https://github.com/cyberpsychofc/LocomotiveDataAPI\n```\n\nGo to the project directory\n\nInstall dependencies\n\n```bash\n  pip install beautifulsoup4\n  pip install requests\n  pip install Django\n  pip install djangorestframework\n  pip install pyjwt\n  pip install django-cors-headers\n```\n\nStart the server\n\n```bash\n  python manage.py runserver\n```\n## Updating the Database\n\nUpdate the database before making an API call.\n\n```bash\n  python manage.py updatemodels\n```\n## How to consume the API\n### Via Postman\n### Register a User\nCreate a superuser via CI. \n```bash\n  python manage.py createsuperuser\n```\nRegister your standard users using Postman\n\n```http\n  POST /api/register\n```\nPass the following parameters\n\n| Parameter | Type     | Description                |\n| :-------- | :------- | :------------------------- |\n| `name` | `string` | `${name}` |\n| `email` | `string` | `${email}` |\n| `password` | `string` | `${passwrd}` |\n\n#### Logging in\n\n```http\n  POST /api/login\n```\nPass the following parameters\n\n| Parameter | Type     | Description                |\n| :-------- | :------- | :------------------------- |\n| `email` | `string` | `${email}` |\n| `password` | `string` | `${passwrd}` |\n#### Status\nTo check if you're logged in\n```http\n  GET /api/user\n```\nIf you're logged in you will see your user details in the response\n\n#### Logout\n```http\n  POST /api/logout\n```\n### IMPORTANT\n\nProvide the generated JWT token at the time of login in the Authorization tab in Postman\n![token](./token.png)\n\n## Demo\n\nEndpoint demonstration of the API. For more information refer to the documentaiton.\n\nhttps://localhost:8000/locomotives\n\n![demo](./demo.png)\n\nLets search for a particular locomotive e.g. WAP-1\n\nhttps://localhost:8000/locomotives/wap-1\n\n![demo2](./demo2.png)\n\n\n## API Reference\n\n#### Get list of all locomotives\n\n```http\n  GET /api/locomotives/\n```\n\n| Parameter | Type     | Description                |\n| :-------- | :------- | :------------------------- |\n| `locomotives` | `string` | **Required**. Returns entire list of locomotives |\n\n#### Get a particular locomotive\n\n```http\n  GET /api/locomotives/${name}\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `name`      | `string` | **Required**. Returns the details of a particular locomotive |\n\n#### Get a list of Electric locomotives\n\n```http\n  GET /api/locomotives/electric\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `electric`      | `string` | **Required**. Returns entire list of electric locomotives |\n\n#### Get a list of Diesel locomotives\n```http\n  GET /api/locomotives/diesel\n```\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `diesel`      | `string` | **Required**. Returns entire list of diesel locomotives |\n\n#### Get a list of Broad-Gauge locomotives\n\n```http\n  GET /api/locomotives/broad\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `broad`      | `string` | **Required**. Returns entire list of broad-gauge locomotives |\n#### Get a list of Meter-Gauge locomotives\n\n```http\n  GET /api/locomotives/meter\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `meter`      | `string` | **Required**. Returns entire list of meter-gauge locomotives |\n\n#### Get a list of Narrow-Gauge locomotives\n\n```http\n  GET /api/locomotives/narrow\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `narrow`      | `string` | **Required**. Returns entire list of narrow-gauge locomotives |\n\n#### Get a list of Narrower-Gauge locomotives\n\n```http\n  GET /api/locomotives/narrower\n```\n\n| Parameter | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `narrower`      | `string` | **Required**. Returns entire list of narrower-gauge locomotives |\n\n\n## Authors\n\n- [@cyberpsychofc](https://www.github.com/cyberpsychofc)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberpsychofc%2Flocomotivedataapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberpsychofc%2Flocomotivedataapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberpsychofc%2Flocomotivedataapi/lists"}