Skip to main content
lastopt
=======

lastopt is a Python utility for quickly creating command line utilities using
function and class introspection.

Example
-------

```python
#!/usr/bin/env python

import lastopt

def install(package, dependencies=False):
print "install %s, with dependencies: %s" % (
package, dependencies and 'yes' or 'no')

class Env(object):
def __init__(self, name):
self.name = name

def start(self, package):
print "starting %s.%s" % (self.name, package)

lastopt.main([install, Env])
```

$ ./command

Usage: ./command COMMAND [ARGS]

The available commands are:
env
install

$ ./command install --help

Usage: ./command install <package> [options]

Options:
-h, --help show this help message and exit
--nodependencies unset --dependencies
-d, --dependencies (default: False)

$ ./command install redis -d

install redis, with dependencies: yes

$ ./command env production

Usage: ./command env production COMMAND [ARGS]

The available commands are:
start

$ ./command env production start frontend

starting production.frontend

History
-------

lastopt is directly inspired by Simon Willison's clever introspection hack from
a few years back: https://github.com/simonw/optfunc

Metadata

Release files for lastopt 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lastopt 0.0.2
File Size Uploaded Provenance Actions
lastopt-0.0.2.tar.gz 4.6 kB Without provenance Details for lastopt-0.0.2.tar.gz

Release files / lastopt-0.0.2.tar.gz

Download URL lastopt-0.0.2.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1421e940c67aeb8bf25153fa591e9e37bc0f40d0aba4cbb3d5725df63c67635b
BLAKE2b-256 checksum
How to use checksums
a77b9c5b602e8c607afac5a061eab99684e89c5d163e7081c208c2f2a7139ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lastopt 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page