filepass


Namefilepass JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryWrapper around fs libraries to synchronized files between different system types including SMB, SFTP, FSTP.
upload_time2024-09-18 22:15:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:
```bash
pip install filepass
```

### From GitHub Container Registry ###
To pull and run the image using Docker, run:
```bash
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",
)
```

3. 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.

4. 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.

5. 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.

6. 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](https://github.com/cityofkamloops/filepass/issues)


## Contributing ##
Contributions to Filepass are welcome! Please refer to our [Contribution Guidelines](https://docs.github.com/en/contributing)
### 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! ###

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "filepass",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Orlund Norstrom <onorstrom@kamloops.ca>, Marco Lussetti <mlussetti@kamloops.ca>, Parul Parul <pparul@kamloops.ca>",
    "download_url": "https://files.pythonhosted.org/packages/91/4b/ebac7184deb0cddba514d1158414e27289cbf98ec5ca977a7d7b7a93a82f/filepass-1.0.2.tar.gz",
    "platform": null,
    "description": "# Filepass Package #\n\n__Filepass__ package is a comprehensive Python package designed to facilitate the transfer of the files across different locations and protocols with ease.\nIt 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.\nIt also offeres advanced file management features such as conditional deletion of files.\nWith 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.\n\nThis package is available as:\n* A __PyPI library__, which can be installed via ```pip```.\n* A __GitHub Container Registry (GHCR) package__, allowing you to pull and run it via ```docker```.\n\n\n## Features ##\n\n- **Multiple Protocols Support**:\nSeamlessly transfer files using SFTP, SMB, and LOCAL file systems.\n\n- **Flexible File Selection**:\nUse 'from_filter' parameter to specify exactly which files to transfer, supporting both specific filenames and wildcards for multiple files.\n\n- **File Renaming (in single file transfer mode)**\nEasily rename files during single file transfer mode.\n\n- **Connection Objects**:\nUtilize the pre-defined connnection objects for efficient and secure connections to server.\n\n- **Conditional File Deletion**:\nAutomatically delete older files at the destination before transfer using 'to_delete', or remove source files after a successful transfer using 'from_delete'.\n\n- **Advanced Logging**:\nEnable 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.\n\n## Installation ##\n\n### From PyPI ###\nTo install the package from PyPI, run:\n```bash\npip install filepass\n```\n\n### From GitHub Container Registry ###\nTo pull and run the image using Docker, run:\n```bash\ndocker pull ghcr.io/cityofkamloops/filepass:latest\n\ndocker run ghcr.io/cityofkamloops/filepass:latest\n```\n\n## Quick Start ##\n1. Import Filepass package:\ne.g.:\n```from filepass import file_pass, ConnectionDetails, FilepassMethod```\n\n2. Set up connection - create a connection object (ConnectionDetails) based on your protocol of choice.\nFilepassMethod offers three protocols: SFTP, SMB, and LOCAL. e.g.:\n```\nsourceServer = ConnectionDetails(\nmethod=FilepassMethod.SMB,\nuser=\"user\",\npassword=\"password\",\nserver=\"servername\",\nport=\"portnumber\",\ndir=\"directory/folder\",\nshare=\"SMB share\",\n)\ndestinationServer = ConnectionDetails(\n    method=FilepassMethod.SFTP,\n    user=\"user\",\n    password=\"password\",\n    server=\"servername\",\n    port=\"portnumber\",\n    dir=\"directory/folder\",\n)\n```\n\n3. Configure Logging:(Optional)\nIf you want to enable custom handler logging, such as Graylog logging. Set the server details as follows:\nExample:\nGraylog\n* Import the required library for custom logging - import graypy\n* Add the handler to your defined logger:\n\n```\nhandler = graypy. graypy.GELFTCPHandler(\n    (\"servername\"), int(\"portnumber\")\n)\n```\n\nIf you want to simply use local logging:\n* Import python logging package.\n* Define the logger and handler.\n    * * E.g., handler = logging.StreamHandler(sys.stdout)\n* Add the handler to your defined logger.\n\n4. Define the required parameters for file transfer:\n* from_filter = \"filename/wildcard\"\ne.g.\n```\nfrom_filter = \"*.txt\"  #transfers all files in the directory, with .txt extension.\nfrom_filter = \"transfer_file.csv\"  #transfers the selected file.\n```\n* to_delete = \"yes or no\".\n* from_delete = \"yes or no\".\n* logger = set custom handler or local handler.\n\n5. Rename file in single file transfer mode:\nRename a file during transfer by specifying the new_filename parameter such as:\n* e.g.,\n```\nnew_filename = \"newfilename\"\n```\n\nDefaults to 'None', if parameter is not defined.\n\n6. Transfer Files:\nUse the file_pass method to move files to move files from one location to another.\n* e.g.,\n```\nfile_pass(\n    logger,\n    from_conn,\n    to_conn,\n    from_filter,\n    to_delete,\n    from_delete,\n    new_filename,\n)\n```\n\n## Support ##\nIf you encounter any issues or have questions, please file an issue on our [GitHub Issues Page](https://github.com/cityofkamloops/filepass/issues)\n\n\n## Contributing ##\nContributions to Filepass are welcome! Please refer to our [Contribution Guidelines](https://docs.github.com/en/contributing)\n### Ways to Contribute ###\n* Submit bug reports and feature requests.\n* Write and improve documentation.\n* Write code for new features and bug fixes.\n* Review pull requests.\n* Enhance the package's test coverage.\n\n### Code of Conduct ###\n* 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.\n\n### How to submit contributions ###\n* Reporting bugs:\n- Use the issue tracker to report bugs.\n- Describe the bug and include steps to reproduce.\n\n* Feature Requests:\n- Submit feature requests using the issue tracker.\n- Please include an explanation why the feature would be useful, and how it should work if possible.\n\n* Pull Requests:\n- Fork the repository and create your branch from 'main'.\n- If you have added code, please include tests.\n- Ensure your project lints and follows the project's coding conventions.\n- Write a clear and descriptive commit message.\n- Open a pull request with a clear title and description.\n\n## Thank you!! ##\n\n### Happy file transferring! ###\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Wrapper around fs libraries to synchronized files between different system types including SMB, SFTP, FSTP.",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/cityofkamloops/filepass/issues",
        "Homepage": "https://github.com/cityofkamloops/filepass"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c80d594acb58cebdfee7794d2ec02e6bf731b6d41c3d266ab24bf30ba4a4bee7",
                "md5": "9fe4619f3c5f63cbba1ad44ca17b377d",
                "sha256": "091c931a8e2b574e26b1c9f657ad58d70ba0fb2597de8e78f889dd02020416bf"
            },
            "downloads": -1,
            "filename": "filepass-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9fe4619f3c5f63cbba1ad44ca17b377d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10278,
            "upload_time": "2024-09-18T22:15:12",
            "upload_time_iso_8601": "2024-09-18T22:15:12.357066Z",
            "url": "https://files.pythonhosted.org/packages/c8/0d/594acb58cebdfee7794d2ec02e6bf731b6d41c3d266ab24bf30ba4a4bee7/filepass-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "914bebac7184deb0cddba514d1158414e27289cbf98ec5ca977a7d7b7a93a82f",
                "md5": "7e76773a462c81a22ca5178745a07e65",
                "sha256": "a4331b13eabfe655d353aa12040b3830e787ec82b71ae114fefc747c291e3fcf"
            },
            "downloads": -1,
            "filename": "filepass-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7e76773a462c81a22ca5178745a07e65",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 12126,
            "upload_time": "2024-09-18T22:15:13",
            "upload_time_iso_8601": "2024-09-18T22:15:13.630701Z",
            "url": "https://files.pythonhosted.org/packages/91/4b/ebac7184deb0cddba514d1158414e27289cbf98ec5ca977a7d7b7a93a82f/filepass-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-18 22:15:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cityofkamloops",
    "github_project": "filepass",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "filepass"
}
        
Elapsed time: 0.75923s