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
Release history Release notifications | RSS feed
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.2.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remote_expose-0.0.2.tar.gz.
File metadata
- Download URL: remote_expose-0.0.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc5b07aa1e80b89b4a28c3ba056ca5b8ee821c26d62f56718679c69a6def7255
|
|
| MD5 |
e96ac1d10de666579653219c81b91c92
|
|
| BLAKE2b-256 |
0e2648ab3606ae107a2e504b2005efd115fad63c0305a2c567a9ecdccaa316c3
|
File details
Details for the file remote_expose-0.0.2-py3-none-any.whl.
File metadata
- Download URL: remote_expose-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c629ba143b9677a7e5af744cf181b11dbe07c76e9d352efbf41346361e37bd
|
|
| MD5 |
81a0b2585bd4dbeca4202f3d127569f2
|
|
| BLAKE2b-256 |
f90d1adc2ffdf1e6be6643ba78607aa18bb3c6f930bc4ff91d8cd093075daec0
|