{"id":15443829,"url":"https://github.com/zanderlewis/idrc","last_synced_at":"2026-02-08T02:03:58.253Z","repository":{"id":253594447,"uuid":"841585628","full_name":"zanderlewis/idrc","owner":"zanderlewis","description":"idrc: Auto APIs for lazy people.","archived":false,"fork":false,"pushed_at":"2024-08-28T00:03:39.000Z","size":76,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T19:50:17.946Z","etag":null,"topics":["api","auto","lib","library","python","python-library","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/idrc/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanderlewis.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-08-12T17:44:47.000Z","updated_at":"2025-01-28T21:28:50.000Z","dependencies_parsed_at":"2024-12-20T13:33:26.450Z","dependency_job_id":"c1c31d87-27b6-4b73-8bca-f0d5500df10d","html_url":"https://github.com/zanderlewis/idrc","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"988b0c64a59d5c1257b3a022f0bcec8284fe7559"},"previous_names":["zanderlewis/idrc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanderlewis%2Fidrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanderlewis%2Fidrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanderlewis%2Fidrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanderlewis%2Fidrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanderlewis","download_url":"https://codeload.github.com/zanderlewis/idrc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249792785,"owners_count":21326417,"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","auto","lib","library","python","python-library","python3"],"created_at":"2024-10-01T19:37:06.740Z","updated_at":"2026-02-08T02:03:53.230Z","avatar_url":"https://github.com/zanderlewis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IDRC\nI Don't Really Care (IDRC): Auto APIs for lazy people\n\n[![GitHub License](https://img.shields.io/github/license/zanderlewis/idrc)](LICENSE)\n\n[![PyPI - Version](https://img.shields.io/pypi/v/idrc?logo=python\u0026logoColor=%23FFD43B\u0026link=https%3A%2F%2Fpypi.org%2Fproject%2Fidrc)](https://pypi.org/project/idrc)\n![PyPI - Downloads](https://img.shields.io/pypi/dd/idrc?logo=python\u0026logoColor=%23FFD43B\u0026color=blue)\n\n## Table of Contents\n- [IRDC](#idrc)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [IDRC vs Flask](#idrc-vs-flask)\n\n## Installation\n\nIDRC can be installed via `pip` like so:\n\n`pip3 install idrc`\n\n## Usage\n\nIDRC can integrate with any function. For example:\n\n```python\nfrom idrc import idrc\n\n# Initialize the idrc class\napi = idrc(verbose=True)\n\n# Simulate a weather database\nweather_data = {\n    \"New York\": {\"temperature\": 25, \"condition\": \"Sunny\"},\n    \"Los Angeles\": {\"temperature\": 30, \"condition\": \"Cloudy\"},\n    \"Chicago\": {\"temperature\": 18, \"condition\": \"Rainy\"}\n}\n\n# Define a weather forecast function\ndef get_weather(city: str) -\u003e dict:\n    forecast = weather_data.get(city, None)\n    if forecast:\n        return forecast\n    else:\n        return api.ecode(404, 'City not found')\n\n# Register the function as an API endpoint\napi.define(get_weather, methods=['GET'])\n\n# Run the idrc API\nif __name__ == '__main__':\n    api.run(host='0.0.0.0', port=5000, debug=True)\n```\n\nThe `define` function in the `idrc` library generated the api.\n\nThe Flask equivalent of the code above is:\n```python\nfrom flask import Flask, request, jsonify\n\n# Initialize the Flask app\napp = Flask(__name__)\n\n# Simulate a weather database\nweather_data = {\n    \"New York\": {\"temperature\": 25, \"condition\": \"Sunny\"},\n    \"Los Angeles\": {\"temperature\": 30, \"condition\": \"Cloudy\"},\n    \"Chicago\": {\"temperature\": 18, \"condition\": \"Rainy\"}\n}\n\n# Define a weather forecast function\n@app.route('/api/v1/get_weather', methods=['GET'])\ndef get_weather():\n    city = request.args.get('city')\n    if not city:\n        return jsonify({\"error\": \"City parameter is required\"}), 400\n\n    forecast = weather_data.get(city)\n    if forecast:\n        return jsonify(forecast)\n    else:\n        return jsonify({\"error\": \"City not found\"}),404\n\n# Run the Flask app\nif __name__ == '__main__':\n    app.run(host='0.0.0.0', port=5000, debug=True)\n```\n\nIDRC condensed 27 lines of code into 25 lines of code, with much less typing overall.\n\n## IDRC vs Flask\n\n### Advantages of IDRC\n\n- Rapid API development\n- Very Simple\n- Built-in error handling\n- Lightweight wrapper of Flask\n- Pretty terminal output\n\n### Advantages of Flask\n\n- Mature framework\n- Large community\n- Flexible and extensible\n- Extensive documentation\n- Stack traces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanderlewis%2Fidrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanderlewis%2Fidrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanderlewis%2Fidrc/lists"}