Skip to main content

A Python package to expose local files through a public URL using ngrok

Project description

remote-expose

A Python package that allows you to easily expose local files through a public URL using ngrok.

Installation

pip install remote-expose

Usage

from remote_expose import exposeRemote, exposeRemoteAsync

# Synchronous usage with context manager
with exposeRemote('path/to/your/file.txt') as url:
    print(f"Your file is available at: {url}")
    # The file will be accessible at the URL while in this context
    # Once the context is exited, the tunnel will be closed if no other files are being exposed

# Multiple files can be exposed simultaneously
with exposeRemote('file1.txt') as url1, exposeRemote('file2.txt') as url2:
    print(f"File 1 is at: {url1}")
    print(f"File 2 is at: {url2}")

# Async usage with async context manager
import asyncio

async def expose_files():
    async with exposeRemoteAsync('file1.txt') as url1, \
              exposeRemoteAsync('file2.txt') as url2:
        print(f"File 1 is at: {url1}")
        print(f"File 2 is at: {url2}")
        await asyncio.sleep(60)  # Keep files exposed for 60 seconds

# Run the async function
asyncio.run(expose_files())

Features

  • Easy-to-use context manager interface
  • Async support with async context manager
  • Automatic resource cleanup
  • Support for exposing multiple files simultaneously
  • Secure file serving (no directory listing)
  • Thread-safe implementation
  • Automatic port management
  • Efficient resource sharing (single server for multiple files)

Requirements

  • Python 3.7+
  • ngrok account (free tier works fine)
  • pyngrok

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

remote_expose-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

remote_expose-0.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file remote_expose-0.0.1.tar.gz.

File metadata

  • Download URL: remote_expose-0.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for remote_expose-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ae7cbf117e037bdecb048a3a880742d01fd47e704111a56dc92057b40fecf3e8
MD5 a0e11012dba28c35d06e724b528135a5
BLAKE2b-256 de4d53fc9e36453f3d606d91f675a1a21cd22be93fbe90b27f559138475ee4c5

See more details on using hashes here.

File details

Details for the file remote_expose-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: remote_expose-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for remote_expose-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77dbb7ae80a067c5a46762f8caa04636ae84f312b7ccc198de01c2b58f7ec880
MD5 ee6fd68e01db2d980d25581941a86a18
BLAKE2b-256 1cd4562e2008e6c36e7df6ba269c39913ce95c8a48e9a103abe8e6daff5775ac

See more details on using hashes here.

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