Skip to main content

Filepass Package

Filepass package is a comprehensive Python package designed to facilitate the transfer of the files across different locations and protocols with ease. It supports SFTP, SMB, and LOCAL file systems, and offers functionalities like file renaming (in single file mode) and selective file transfer based on assigned filter. It also offeres advanced file management features such as conditional deletion of files. With support for both custom handler and local logging, 'Filepass' ensures that you can keep a detailed log of your file trasnfers, making troubleshooting and monitoring a breeze.

This package is available as:

  • A PyPI library, which can be installed via pip.
  • A GitHub Container Registry (GHCR) package, allowing you to pull and run it via docker.

Features

  • Multiple Protocols Support: Seamlessly transfer files using SFTP, SMB, and LOCAL file systems.

  • Flexible File Selection: Use 'from_filter' parameter to specify exactly which files to transfer, supporting both specific filenames and wildcards for multiple files.

  • File Renaming (in single file transfer mode) Easily rename files during single file transfer mode.

  • Connection Objects: Utilize the pre-defined connnection objects for efficient and secure connections to server.

  • Conditional File Deletion: Automatically delete older files at the destination before transfer using 'to_delete', or remove source files after a successful transfer using 'from_delete'.

  • Advanced Logging: Enable custom logging handler by defining the server name, port number and adding the handler to the logger defined. Otherwise, default to local logging to stdout for monitoring and troubleshooting.

Installation

From PyPI

To install the package from PyPI, run:

pip install filepass

From GitHub Container Registry

To pull and run the image using Docker, run:

docker pull ghcr.io/cityofkamloops/filepass:latest

docker run ghcr.io/cityofkamloops/filepass:latest

Quick Start

  1. Import Filepass package: e.g.: from filepass import file_pass, ConnectionDetails, FilepassMethod

  2. Set up connection - create a connection object (ConnectionDetails) based on your protocol of choice. FilepassMethod offers three protocols: SFTP, SMB, and LOCAL. e.g.:

sourceServer = ConnectionDetails(
method=FilepassMethod.SMB,
user="user",
password="password",
server="servername",
port="portnumber",
dir="directory/folder",
share="SMB share",
)
destinationServer = ConnectionDetails(
    method=FilepassMethod.SFTP,
    user="user",
    password="password",
    server="servername",
    port="portnumber",
    dir="directory/folder",
)
  1. Configure Logging:(Optional) If you want to enable custom handler logging, such as Graylog logging. Set the server details as follows: Example: Graylog
  • Import the required library for custom logging - import graypy
  • Add the handler to your defined logger:
handler = graypy. graypy.GELFTCPHandler(
    ("servername"), int("portnumber")
)

If you want to simply use local logging:

  • Import python logging package.
  • Define the logger and handler.
      • E.g., handler = logging.StreamHandler(sys.stdout)
  • Add the handler to your defined logger.
  1. Define the required parameters for file transfer:
  • from_filter = "filename/wildcard" e.g.
from_filter = "*.txt"  #transfers all files in the directory, with .txt extension.
from_filter = "transfer_file.csv"  #transfers the selected file.
  • to_delete = "yes or no".
  • from_delete = "yes or no".
  • logger = set custom handler or local handler.
  1. Rename file in single file transfer mode: Rename a file during transfer by specifying the new_filename parameter such as:
  • e.g.,
new_filename = "newfilename"

Defaults to 'None', if parameter is not defined.

  1. Transfer Files: Use the file_pass method to move files to move files from one location to another.
  • e.g.,
file_pass(
    logger,
    from_conn,
    to_conn,
    from_filter,
    to_delete,
    from_delete,
    new_filename,
)

Support

If you encounter any issues or have questions, please file an issue on our GitHub Issues Page

Contributing

Contributions to Filepass are welcome! Please refer to our Contribution Guidelines

Ways to Contribute

  • Submit bug reports and feature requests.
  • Write and improve documentation.
  • Write code for new features and bug fixes.
  • Review pull requests.
  • Enhance the package's test coverage.

Code of Conduct

  • Participation in this project is governed by The City of Kamloops Code of Conduct. We expect everyone to uphold the principles of respect, kindness and cooperation.

How to submit contributions

  • Reporting bugs:
  • Use the issue tracker to report bugs.
  • Describe the bug and include steps to reproduce.
  • Feature Requests:
  • Submit feature requests using the issue tracker.
  • Please include an explanation why the feature would be useful, and how it should work if possible.
  • Pull Requests:
  • Fork the repository and create your branch from 'main'.
  • If you have added code, please include tests.
  • Ensure your project lints and follows the project's coding conventions.
  • Write a clear and descriptive commit message.
  • Open a pull request with a clear title and description.

Thank you!!

Happy file transferring!

Metadata

Release files for filepass 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filepass 1.0.5
File Size Uploaded Provenance Actions
filepass-1.0.5.tar.gz 12.7 kB With provenance Details for filepass-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for filepass 1.0.5
File Interpreter ABI Platform Actions
filepass-1.0.5-py3-none-any.whl Python 3 none any Details for filepass-1.0.5-py3-none-any.whl

Total release size: 23.6 kB

Release files / filepass-1.0.5.tar.gz

Download URL filepass-1.0.5.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f43499bc809237911493dd26e9a6c246060266370a01fbba85a5fcf969879281
BLAKE2b-256 checksum
How to use checksums
e885e007a30f061e01ba95c1aeb18ad044fae2819eb863980d36ae39381a63e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / filepass-1.0.5-py3-none-any.whl

Download URL filepass-1.0.5-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a77717defc3ed99cb457cff32594e09bae5597f43876cae71badddde1ab86caa
BLAKE2b-256 checksum
How to use checksums
9dc71f042038e0af0428e59e60bccbff7f2d4485be68e923d0074f6ead784a9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for filepass 1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for filepass-1.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page