multi-indexer
A utility for creating sets of templated indexes for local or remote directories.
What does this do?
The multi-indexer creates an Apache HTTPd index-like page dictated by a mustache template. Such a template is provided here in directory-index-template.html.
If provided with a remote location on an AWS S3 bucket, it will create an index of remote directories/files. (It does not upload any index files.)
Local indexing is recursive - it will index subfolders relative to the provided path.
Remote indexing is not recursive - it will create a single index for the provided path only.
Installation
Install with pip:
pip install multi-indexer
Usage
Run from the command line as python -m multi_indexer.
Arguments
| Argument | Long Argument | Description |
|---|---|---|
| -i INJECT | --inject INJECT | Mustache template file to inject into |
| -d DIRECTORY | --directory DIRECTORY | The directory to copy from |
| -p PREFIX | --prefix PREFIX | The prefix to add to all files and links |
| -x | --execute | Actually run--not the default dry run |
| -u | --up | Release version, where pages have a link pointing up one level |
| -v | --verbose | More verbose output |
| -b BUCKET | --bucket BUCKET | Name of S3 bucket if creating index for remote directory |
| -r REMOTE_DIRECTORY | --remote_directory REMOTE_DIRECTORY | Name of S3 remote directory (without leading / ) if creating index for it |
The package may be imported as multi_indexer, though the main() function provides most of the functionality.
By default, no files will be written or uploaded unless multi-indexer is passed the -x/--execute flag.
You can find an example HTML template at the project repository:
https://github.com/Knowledge-Graph-Hub/multi-indexer/blob/main/directory-index-template.html
This is also the template the multi-indexer will use if no template is provided.
Example usage for local indexing, just for local testing
This assumes that directory-index-template.html is present in your current working directory.
mkdir -p /tmp/foo/bar/bib/bab && mkdir -p /tmp/foo/bar/fish && mkdir -p /tmp/foo/bar/foul
touch /tmp/foo/top.md && touch /tmp/foo/bar/bib/bab/bottom.txt && touch /tmp/foo/bar/fish/trout.f && touch /tmp/foo/bar/fish/bass.f
multi_indexer -v --inject ./directory-index-template.html --directory /tmp/foo --prefix file:///tmp/foo -x
Example usage for local indexing, assuming indexes will be uploaded:
multi_indexer -v --inject ./directory-index-template.html --directory $WORKSPACE/mnt --prefix https://soyouhave.afancy.website/$PROJECTDIR/ -x'
Example usage for remote indexing:
multi_indexer -v --inject ./directory-index-template.html --prefix https://soyouhave.afancy.website/$PROJECTDIR/ -b a-bucket-name -r $PROJECTDIR -x'
Credits
Adapted from directory_indexer.py by Eric Douglass, Seth Carbon, and Justin Reese, originally at
https://github.com/Knowledge-Graph-Hub/go-site/blob/master/scripts/multi_indexer.py
Metadata
Release files for multi-indexer 0.0.5
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 | |
|---|---|---|---|---|
| multi-indexer-0.0.5.tar.gz | 6.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multi_indexer-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / multi-indexer-0.0.5.tar.gz
| Download URL | multi-indexer-0.0.5.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
deab41975981228eeee0740f3d8162c0d2d4194e4268b3191295a1e8125e227b
|
|
BLAKE2b-256 checksum How to use checksums |
26cf71d3c8ca3ec04d7dffa024d38dfa4067bb763fd4fb3fbec4896691e29706
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Release files / multi_indexer-0.0.5-py3-none-any.whl
| Download URL | multi_indexer-0.0.5-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7892ccf44138a20892928b9bb9b8b95553279268ea490dd8fa6831006e1515ba
|
|
BLAKE2b-256 checksum How to use checksums |
804c9da0c5fdfca87dfe1a5b390856f1d90e3dccbdc012c739b48dc7bb2c96cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Security for multi-indexer 0.0.5
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.