{"id":22687413,"url":"https://github.com/cablehead/lastopt","last_synced_at":"2025-03-29T15:43:22.390Z","repository":{"id":2671820,"uuid":"3663568","full_name":"cablehead/lastopt","owner":"cablehead","description":null,"archived":false,"fork":false,"pushed_at":"2014-05-21T01:54:18.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T05:05:47.350Z","etag":null,"topics":[],"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/cablehead.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}},"created_at":"2012-03-08T19:31:01.000Z","updated_at":"2015-09-07T16:46:08.000Z","dependencies_parsed_at":"2022-09-16T07:03:06.914Z","dependency_job_id":null,"html_url":"https://github.com/cablehead/lastopt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cablehead%2Flastopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cablehead%2Flastopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cablehead%2Flastopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cablehead%2Flastopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cablehead","download_url":"https://codeload.github.com/cablehead/lastopt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207491,"owners_count":20740723,"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-12-09T23:18:23.991Z","updated_at":"2025-03-29T15:43:22.365Z","avatar_url":"https://github.com/cablehead.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"lastopt\n=======\n\nlastopt is a Python utility for quickly creating command line utilities using\nfunction and class introspection.\n\nExample\n-------\n\n```python\n#!/usr/bin/env python\n\nimport lastopt\n\ndef install(package, dependencies=False):\n    print \"install %s, with dependencies: %s\" % (\n        package, dependencies and 'yes' or 'no')\n\nclass Env(object):\n    def __init__(self, name):\n        self.name = name\n\n    def start(self, package):\n        print \"starting %s.%s\" % (self.name, package)\n\nlastopt.main([install, Env])\n```\n\n$ ./command\n\n    Usage: ./command COMMAND [ARGS]\n\n    The available commands are:\n        env\n        install\n\n$ ./command install --help\n\n    Usage: ./command install \u003cpackage\u003e [options]\n\n    Options:\n      -h, --help          show this help message and exit\n      --nodependencies    unset --dependencies\n      -d, --dependencies   (default: False)\n\n$ ./command install redis -d\n\n    install redis, with dependencies: yes\n\n$ ./command env production\n\n    Usage: ./command env production COMMAND [ARGS]\n\n    The available commands are:\n        start\n\n$ ./command env production start frontend\n\n    starting production.frontend\n\nHistory\n-------\n\nlastopt is directly inspired by Simon Willison's clever introspection hack from\na few years back: https://github.com/simonw/optfunc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcablehead%2Flastopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcablehead%2Flastopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcablehead%2Flastopt/lists"}