================
Functions for command-line server tools used by humans.
Description
-----------
Path-and-address resolves ambiguities for command-line interface applications
with the following pattern:
```bash
$ your_app [<path>] [<address>]
```
The library applies [the principal of least surprise][pols] to command-line
interfaces.
Some examples:
```bash
$ your_app .
* Serving . on http://localhost:5000/
$ your_app 80
* Serving . on http://localhost:80/
$ your_app ./80
* Serving ./80 on http://localhost:5000/
$ your_app path/to/file
* Serving path/to/file on http://localhost:5000/
$ your_app 0.0.0.0
* Serving 0.0.0.0 on http://localhost:5000/
$ your_app . 0.0.0.0
* Serving . on http://0.0.0.0:5000/
$ your_app 0.0.0.0:8080
* Serving . on http://0.0.0.0:8080/
```
Usage
-----
Implement a CLI front-end in Python that exposes the above `[path] [address]`
pattern. Then call `resolve(path, address)`.
Example, using `sys.argv` directly:
```python
import sys
from path_and_pattern import resolve
path, address = resolve(*argv[1:])
```
More examples can be found in the "examples" directory.
Installation
------------
To install, simply:
```bash
$ pip install path-and-address
```
Or put it in your project's `requirements.txt`.
Contributing
------------
1. Check the open issues or open a new issue to start a discussion around
your feature idea or the bug you found
2. Fork the repository, make your changes, and add yourself to [Authors.md][]
3. Send a pull request
[pols]: http://en.wikipedia.org/wiki/Principle_of_least_astonishment
Metadata
Release files for path-and-address 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| path-and-address-1.1.0.zip | 7.7 kB | Without provenance | Details for path-and-address-1.1.0.zip |
Release files / path-and-address-1.1.0.zip
| Download URL | path-and-address-1.1.0.zip |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9cbea6919464ff2bbe441b996341e97d112ef876d8eeaa7ab127fe9fb811471
|
|
BLAKE2b-256 checksum How to use checksums |
9d17e1afeb3587c51c8fe71ef32cfd72715dd7d90ded7ebe622213d14b6c1acb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for path-and-address 1.1.0
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.