manualindex
Generate autoindex-style HTML for your directory listings.
Install
pip install manualindex
Or if you're using poetry:
poetry add manualindex
Manualindex supports Python 3.9 and above.
Usage
Manualindex can be used both as a library and as a command-line program.
CLI
python -m manualindex /path/to/dir
A Jinja template is used to generate the index.html files. To customise the template, you'll need to pass two flags:
python -m manualindex /path/to/dir --template-path /path/to/templates --template-name mytemplate.html.j2
For this example to work, there must be a file named mytemplate.html.j2 inside /path/to/templates.
Due to how the URL generation works, if your directory listings are not at the root of your domain, you'll need to pass
the base URL path. For example, if your base URL is https://example.com/mydir/mysubdir/, you will need the following:
python -m manualindex /path/to/dir --base-urlpath /mydir/mysubdir/
You can customise the date format:
python -m manualindex /path/to/dir --date-format '%Y-%m-%d'
The default date format is %Y-%m-%d %H:%I.
To customise the timezone of the formatted timestamps:
python -m manualindex /path/to/dir --timezone Australia/Melbourne
The default timezone is UTC.
Library
To make use of all the defaults:
from pathlib import Path
from manualindex import generate_default
generate_default(Path("/path/to/dir"))
To customise the template generation options, but use the default template:
from pathlib import Path
from manualindex import default_template, generate
generate(
Path("/path/to/dir"),
default_template,
base_urlpath="/mydir/mysubdir/",
date_format = "%Y-%m-%d",
date_tz="Australia/Melbourne",
)
The second parameter to generate() accepts any Jinja Template object, so you have full control over the output.
Manualindex makes no assumptions about where the template comes from.
License
The code is available under the GPL Version 3.
Metadata
Release files for manualindex 1.0.1
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 |
|---|---|---|---|---|
| manualindex-1.0.1.tar.gz | 19.5 kB | Without provenance | Details for manualindex-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| manualindex-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for manualindex-1.0.1-py3-none-any.whl |
Total release size: 38.8 kB
Release files / manualindex-1.0.1.tar.gz
| Download URL | manualindex-1.0.1.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2374427e7d130f1131b02f277eb26b0dbb797c2904625848d862011c7a9f4b76
|
|
BLAKE2b-256 checksum How to use checksums |
88adf47d341057d39b9a4deb3ea3ee943f8b440b2e406608de9c7a33991f4f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Release files / manualindex-1.0.1-py3-none-any.whl
| Download URL | manualindex-1.0.1-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10b4efab42db8f7d06d7d9ce3b23bedb39aadb66d4cb886251e82590f7357bc1
|
|
BLAKE2b-256 checksum How to use checksums |
200817ba264ed34b8243329e4610076bec6dfd20e23d7dfc4aedfa3e3e75c606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Security for manualindex 1.0.1
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.