Skip to main content

Share files with a single command

Project description

fileup - Share files with a single command

PyPI Build Status CodeCov Documentation

fileup Logo

fileup is your go-to Python package for hassle-free uploading and sharing of files right from your command-line interface. You can set a time limit after which the file will be automatically removed, ensuring the security of your data.

[!TIP] Just call fu myfile.txt to upload it and get the URL in your clipboard!

Table of Contents

Features

  • :outbox_tray: Upload via FTP or SCP (using SSH config)
  • :clipboard: Upload directly from clipboard (--clipboard)
  • :alarm_clock: Automatic file expiration and cleanup
  • :link: Smart URLs: Jupyter notebooks -> nbviewer, image markdown, direct links
  • :clipboard: Automatic URL copy to clipboard (macOS)
  • :zap: Simple config using ~/.config/fileup/config.ini
  • :closed_lock_with_key: Supports SSH keys and password authentication
  • :feather: Zero dependencies - uses Python standard library
  • :scroll: Works as a single script or installed package
  • :snake: Supports Python >=3.10

Why fileup?

I frequently need to share files quickly with colleagues or friends. Whether it's a screenshot, a code snippet, or a Jupyter notebook, I wanted a tool that:

  1. Works from the command line with minimal typing
  2. Automatically copies the URL to my clipboard
  3. Supports automatic expiration for temporary files
  4. Requires no external dependencies

fileup was born out of this need - a simple, focused tool that does one thing well.

Installation

To install fileup, simply run the following command:

pip install -U fileup

or use uv or pipx:

uv tool install fileup
pipx install fileup

Configuration

Before you can start sharing your files, you'll need to create a configuration file at ~/.config/fileup/config.ini with the following structure:

# ~/.config/fileup/config.ini
[default]
protocol = ftp  # or scp
hostname = example.com  # or the Host from your ~/.ssh/config
base_folder = /path/to/files  # where files are stored on the server
file_up_folder =  # subdirectory in URL, can be empty
url = files.example.com  # the actual URL where files are accessible

[ftp]
username = my_user_name
password = my_difficult_password

[scp]
# If empty, will use your SSH config
username =
# If using SSH config, no need for these
private_key =
password =

FTP Configuration

For FTP uploads, you need to provide both username and password in the [ftp] section.

SCP Configuration

For SCP uploads, you have two options:

  1. Use your SSH config by setting protocol = scp and using a hostname from your ~/.ssh/config
  2. Explicitly configure SCP by providing username and optionally private_key in the [scp] section

Usage

For a list of available commands, type fu -h.

In a nutshell, you can use fileup by running:

fu [filename]

The command supports several options:

  • -t DAYS, --time DAYS: Set an expiration time in days (default: 90, use 0 for no expiration)
  • -d, --direct: Return a direct URL without any prefixes
  • -i, --img: Return the URL formatted for markdown image embedding
  • -c, --clipboard: Upload image/text currently in your clipboard (image preferred)

Examples:

# Regular file upload
fu image.png

# Upload from clipboard with an auto-generated name
fu --clipboard

# Upload from clipboard with an explicit remote filename
fu --clipboard screenshot.png

This is the output of fu -h:

usage: fu [-h] [-t TIME] [-d] [-i] [-c] [filename]

Publish a file.

Create a config file at ~/.config/fileup/config.ini with the following structure:

[default]
protocol = ftp  # or scp
hostname = example.com  # or the Host from your ~/.ssh/config
base_folder = /path/to/files  # where files are stored on the server
file_up_folder =  # subdirectory in URL, can be empty
url = files.example.com  # the actual URL where files are accessible

[ftp]
username = my_user_name
password = my_difficult_password

[scp]
# If empty, will use your SSH config
username =
# If using SSH config, no need for these
private_key =
password =

positional arguments:
  filename         Local filename. With --clipboard this is an optional remote filename.

options:
  -h, --help       show this help message and exit
  -t, --time TIME  If time is 0 the file will never be deleted, default is 90 days.
  -d, --direct
  -i, --img
  -c, --clipboard  Upload clipboard content (image preferred, then text).

Special Features

  • Jupyter Notebooks: If you're uploading a Jupyter notebook (.ipynb), the returned URL will be accessible via nbviewer.jupyter.org
  • Automatic Deletion: Files with expiration times are automatically removed when their time is up
  • Clipboard Upload: Upload clipboard image/text with fu --clipboard
  • URL Copying: On macOS, the URL is automatically copied to your clipboard

macOS Integration

fileup uses pbcopy so the uploaded URL is automatically copied on macOS. For clipboard uploads, it will try common commands in order:

  • image: pngpaste, wl-paste, xclip
  • text: pbpaste, wl-paste, xclip, xsel, powershell

Limitations

  • Automatic URL-to-clipboard copy currently uses macOS pbcopy
  • Clipboard image uploads need a compatible command (e.g. pngpaste on macOS)
  • FTP passwords are stored in plain text; use with caution
  • SCP implementation requires the ssh and scp commands to be available

Support

We appreciate your feedback and contributions! If you encounter any issues or have suggestions for improvements, please file an issue on the GitHub repository. We also welcome pull requests for bug fixes or new features.

Happy sharing! :rocket:


Give fileup a try today and experience the convenience of effortless file sharing right from your command-line!

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

fileup-2.1.0.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fileup-2.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file fileup-2.1.0.tar.gz.

File metadata

  • Download URL: fileup-2.1.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fileup-2.1.0.tar.gz
Algorithm Hash digest
SHA256 6ff98a33b0ad9761060f32ad8adccaf2d73cfe1a9b384e9056ae89c4d91f5cc2
MD5 ccf60ae248751970ae3b12213b782e94
BLAKE2b-256 1cdf82f3668859682c2b5932d832f7934c945227feef4c7239a635ab07d64a03

See more details on using hashes here.

Provenance

The following attestation bundles were made for fileup-2.1.0.tar.gz:

Publisher: release.yml on basnijholt/fileup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fileup-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: fileup-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fileup-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0f2960efe0b1c522fe8fee861bc649ca38a171a8f408f9e924aab19f4929431
MD5 cd9f83719cdec772e6adad7f6272d2c4
BLAKE2b-256 baaef84bc7b1876bd79080b5d7f3eb7d84212cd90c5fdc7d098891bf1b48d1b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fileup-2.1.0-py3-none-any.whl:

Publisher: release.yml on basnijholt/fileup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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