Skip to main content

A utility for creating sets of templated indexes for local or remote directories.

Project description

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

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
python multi_indexer.py -v --inject ./directory-index-template.html --directory /tmp/foo --prefix file:///tmp/foo -x

Example usage for local indexing, assuming indexes will be uploaded:

python3 multi_indexer.py -v --inject ./directory-index-template.html --directory $WORKSPACE/mnt --prefix https://soyouhave.afancy.website/$PROJECTDIR/ -x'

Example usage for remote indexing:

python3 multi_indexer.py -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]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multi-indexer-0.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

multi_indexer-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file multi-indexer-0.0.3.tar.gz.

File metadata

  • Download URL: multi-indexer-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for multi-indexer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9c11fc5f0d4bfa02c6ce2a94129b18e2c3a086080ae15a13011095987d866fbf
MD5 c4b76e196ff5e804a15313e2c2764993
BLAKE2b-256 867f6c0f742157fd6849281f845338a80481200bc862881c290d4fd841f8aa1a

See more details on using hashes here.

File details

Details for the file multi_indexer-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: multi_indexer-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for multi_indexer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2510ee4bfddbb9b275d4b8e273364fe4c517cebbdb0d4d5f1a054840b963f5d8
MD5 be0d721c3bf4b23befaaf0efc44afb3f
BLAKE2b-256 e1e9da8cf8d0b14e911d8c6c768a6feec20783eecf2d55cb66fd4c55faf60fcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page