fileroute
Fileroute records where project artifacts come from, where they live locally, and where they should be published. A YAML or JSON descriptor connects local files to SharePoint, Google Drive, and S3 locations. Preview transfers without credentials, visualize the relationships, pull remote inputs, and publish to supported targets through the CLI or Python API. Python 3.11+ is required.
Current transfer support: SharePoint, Google Drive, and S3 can be pulled;
SharePoint and Google Drive can be pushed. S3 targets can be described and
diagrammed, but push --dry-run rejects them until upload support exists.
Fileroute does not transform files or transfer directly between cloud providers.
Descriptor format change
Catalogs and resources are now keyed maps: resources: {report: {path: report.csv}}.
The map key is the registered name. Cross-file catalogs use
catalogs: {archive: {descriptor: catalogs/archive.yaml}}.
Run fileroute migrate OLD_DESCRIPTOR NEW_DIRECTORY --dry-run before
converting existing named lists and $ref links. See the
migration guide.
Get started
For a repeatable project workflow, add Fileroute as a dependency and commit the
descriptor and uv.lock:
uv add fileroute
uv run fileroute diagram config/fileroute.yaml
uv run fileroute pull config/fileroute.yaml --dry-run
For occasional CLI use, run the published tool in a separate environment:
uvx fileroute diagram config/fileroute.yaml
uvx fileroute pull config/fileroute.yaml --dry-run
uv run uses the project's dependencies and supports Python imports;
uvx does not install Fileroute into the project. Pin a version with
uv add 'fileroute==X.Y.Z' or
uvx --from 'fileroute==X.Y.Z' fileroute --help.
See uv's project,
dependency, and
tool guides.
One supported workflow downloads a selected SharePoint file to a local artifact and publishes it to two SharePoint destinations:
resources:
monthly-report:
path: artifacts/monthly-report.csv
sources:
- path: https://contoso.sharepoint.com/sites/data/Shared%20Documents/monthly-report.csv
targets:
- path: https://contoso.sharepoint.com/sites/reports/Shared%20Documents/monthly-report.csv
- path: https://contoso.sharepoint.com/sites/archive/Shared%20Documents/monthly-report.csv
annual-report:
path: artifacts/annual-report.csv
sources:
- path: https://contoso.sharepoint.com/sites/data/Shared%20Documents/annual-report.csv
targets:
- path: https://contoso.sharepoint.com/sites/reports/Shared%20Documents/annual-report.csv
Save this as config/fileroute.yaml, replace the example URLs, and run:
uv run fileroute resolve config/fileroute.yaml
uv run fileroute diagram config/fileroute.yaml
uv run fileroute list config/fileroute.yaml
uv run fileroute pull config/fileroute.yaml --select monthly-report --dry-run
uv run fileroute pull config/fileroute.yaml --select monthly-report
uv run fileroute push config/fileroute.yaml --select monthly-report --dry-run
uv run fileroute push config/fileroute.yaml --select monthly-report
Omit --select to process all eligible resources; selecting a catalog includes
its descendants. A selected pull uses its remote source, while a selected push
publishes to all effective targets.
resolve parses URLs and scoped paths offline; resolve --online --write
verifies remote locations and saves their IDs and entity types. diagram and
dry runs also work without provider access; --online and actual transfers
require credentials. Configure a reusable authentication profile, then select it
for a transfer or set authProfile on individual source/target locations:
uv run fileroute auth configure work --provider sharepoint
uv run fileroute auth login sharepoint --profile work
uv run fileroute pull config/fileroute.yaml --profile work
Configuration guides you through the selected provider's settings; cloud app
registration and access grants are still required. Profiles store settings and
credential references, with session tokens cached privately outside the project.
Existing environment and .env workflows remain supported. See
Authentication for setup, selection precedence, and
the profile template.
To publish a new file to Google Drive, target an existing folder; Fileroute creates or replaces the file below it. An exact file URL instead replaces that file by ID and preserves its existing name:
resources:
report:
path: artifacts/report.csv
targets:
- path: https://drive.google.com/drive/folders/FOLDER_ID
- path: https://drive.google.com/file/d/EXISTING_FILE_ID/view
The two targets receive separate copies. See Transfers for nested folders, shared drives, and ambiguous names.
Documentation
- Descriptor model, paths, references, and resolution
- More use cases, saved YAML, and generated diagrams
- Transfer behavior and provider support
- Diagram formats and Python graph API
- JSON Schemas and editor completion
- CLI reference and Python API
- Agent Skill for coding agents
- Development, migration, and package releases
The descriptor path is a local artifact for transfers. sources are
upstream inputs or provenance; targets are publication destinations.
For nested edits, fileroute list shows exact JSONPath selectors; the leading
$ is optional when passing one to list, update, or add --parent.
Diagrams show intent, not a completed transfer. Use fileroute --help for
commands and options. To develop this repository, run uv sync and see the
contributor guide.
HTTP retries and upload recovery
Fileroute retries transient Microsoft Graph reads and content PUTs up to three times,
respecting Retry-After when supplied. A content PUT reopens the local file on
each attempt. Folder-creation POSTs are not automatically replayed after an
uncertain result. Google Drive resumable uploads query the upload session after
a transient or rate-limit error and continue from the byte offset confirmed by
the server. Network and HTTP failures retain their provider-specific exception
types and expose status_code, response_text, response_json, and
response_headers for callers that need details.
Root catalogs and profile schemas
Use catalog.yaml (also .yml or .json) as a project resource inventory.
Discovery checks an explicit argument, then the activated descriptor, then a root
catalog, then resources/descriptor.*. A stale activation remains an error;
Fileroute does not search parent directories.
Catalog.resourcePathTemplate describes an artifact naming pattern relative to path.
pathTemplate is also accepted as an input alias. During resolve, Fileroute
uses the parse library to extract named
fields into each resource's pathProperties (resource.path_properties in
Python):
profile: fileroute-catalog
targets: []
catalogs:
surveys:
path: data
resourcePathTemplate: "{surveyid}/{env}/v{version}/schema.json"
Absolute paths and URI templates match the whole resource path. For example:
pathTemplate: "drive://test/{var1}/{var2}/test.csv"
resources:
file1:
path: "drive://test/xx/yy/file1.csv"
fileroute resolve catalog.yaml returns pathProperties: {var1: xx, var2: yy}
for file1. A literal filename is a naming example: when it differs, directory
fields are still extracted. If the filename contains a field, the complete
template must match. Use {filename} to extract varying filenames. Matching is
case-sensitive, normalizes path separators, and supports parse format types
such as {year:d}. Named fields supply metadata; anonymous fields do not.
The nearest catalog template applies to its resources and descendants. Relative
templates use the declaring catalog's path; child templates replace inherited
ones. Resolution replaces computed properties, clearing them to {} for a
nonmatching path, so old folder metadata cannot survive a path change. Without
an applicable template, authored pathProperties are preserved. Loading alone
does not calculate properties; use resolve or fileroute resolve --write to
calculate or persist them. Saves use the canonical resourcePathTemplate name;
conflicting values for its two input names are rejected.
Transfers do not expand placeholders, discover matching files, or replace
explicit resource paths. Extracted properties are metadata, not authorization
or approval decisions. Select publication scope explicitly, for example
fileroute push catalog.yaml --select documentation.
Catalogs and authentication profile configuration both have model-derived JSON
Schemas. poe schema-update regenerates the checked-in files in schemas/;
poe schema-check detects stale output. poe schema-export writes both schemas
under dist/schemas/, and stable releases publish both as GitHub Release assets:
fileroute-catalog.schema.jsoncovers catalogs, resources, locations, and links.fileroute-auth-profiles.schema.jsoncovers named profiles and all supported provider/mode combinations, with required settings and field help.
The repository includes VS Code associations and schema hints in YAML templates
for completion and validation. auth configure also adds a schema hint to
generated YAML profiles: version-pinned for stable packages, local for source
checkouts. Associate another YAML file with a released schema
using this editor comment (replace VERSION):
# yaml-language-server: $schema=https://github.com/mbkranz/fileroute/releases/download/vVERSION/fileroute-catalog.schema.json
profile: fileroute-catalog
For a profile file use fileroute-auth-profiles.schema.json instead. Keep
profile as catalog document data; $schema is only in the editor comment.
For JSON, use editor settings instead of adding $schema to the configuration.
See JSON Schemas and editor assistance for JSON/YAML starters,
versioned/latest URLs, and field suggestions.
Schema validation covers structural constraints. Runtime checks still validate
case-insensitive name collisions, descriptor paths and cycles, filesystem state,
and operational transfer requirements. Service aliases normalized at runtime may
need canonical spelling for editor validation.
Release preparation regenerates versioned source schemas and saves the complete
bundle under dist/schemas/ alongside distributions. PyPI receives only
distributions. Retries reuse the saved release artifact and refuse to replace an
existing GitHub schema asset with different bytes.
License
Fileroute's code and generated profile schemas are covered by the MIT license
in LICENSE. Resources referenced by user catalogs retain their own terms.
Metadata
Release files for fileroute 0.2.6
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 |
|---|---|---|---|---|
| fileroute-0.2.6.tar.gz | 140.4 kB | Without provenance | Details for fileroute-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fileroute-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for fileroute-0.2.6-py3-none-any.whl |
Total release size: 238.8 kB
Release files / fileroute-0.2.6.tar.gz
| Download URL | fileroute-0.2.6.tar.gz |
|---|---|
| Size | 140.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca2c1e553ec06e1ea89f597b4a61a7ccfce8c272b84387150bee3f779befffff
|
|
BLAKE2b-256 checksum How to use checksums |
b30db5b73fbc68df7975ca87105dc74a3d1b9bdc94605aaa44083fafb0da727a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fileroute-0.2.6-py3-none-any.whl
| Download URL | fileroute-0.2.6-py3-none-any.whl |
|---|---|
| Size | 98.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d068936f2f658aec3fbb4347d59f5cd20e9e0127d82b2105e5f8109d9148159
|
|
BLAKE2b-256 checksum How to use checksums |
a6873efe73041b9308b1008b03820699d3052765dd02fd4eadfb9a416335643e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fileroute 0.2.6
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.