NJMTech Upload Blob API
Tech Stack
This project is built using the following technologies:
- 🐍 Python: The core programming language.
- ⚡ FastAPI: A modern, fast (high-performance) web framework for building APIs with Python 3.7+ based on standard Python type hints.
- ☁️ Vercel Blob: A serverless, scalable, and cost-efficient object storage solution for the web.
- 🦄 Uvicorn: A lightning-fast ASGI server, used to run the FastAPI application.
- .env python-dotenv: Manages environment variables, loading them from a
.envfile. - 🛠️ Werkzeug: A comprehensive WSGI web application library, used here for secure filename handling.
- 🧪 Pytest: A mature full-featured Python testing framework.
This is a simple FastAPI application to upload files to Vercel Blob storage.
Setup
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env.localfile in the root of the project and add your Vercel Blob read-write token:BLOB_READ_WRITE_TOKEN="YOUR_BLOB_READ_WRITE_TOKEN"Replace
"YOUR_BLOB_READ_WRITE_TOKEN"with your actual token. -
Run the application:
uvicorn api.main:app --reload
The application will be running at
http://127.0.0.1:8000.
Testing
To run the tests for this project, follow these steps:
-
Install test dependencies:
pip install -r tests/requirements.txt
-
Run the tests:
pytest tests/
API Endpoint
Upload File
- URL:
/api/v1/upload - Method:
POST - Headers:
Authorization: Bearer YOUR_API_TOKEN
- Form Data:
file(the file to upload)
Example using curl:
curl -X POST \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "file=@/path/to/your/file.txt" \
http://127.0.0.1:8000/api/v1/upload
Metadata
Release files for njmtech-upload-blob 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| njmtech_upload_blob-0.1.1.tar.gz | 10.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| njmtech_upload_blob-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.3 kB
Release files / njmtech_upload_blob-0.1.1.tar.gz
| Download URL | njmtech_upload_blob-0.1.1.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e080e0385faf3e2cc9fffa86f303b80c12067de03f42dfe51e4e393a542bc74d
|
|
BLAKE2b-256 checksum How to use checksums |
ac036060d1f067b1beb5ff0f19ce3f89dc33b4046cf8a9796ca47994571d349f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / njmtech_upload_blob-0.1.1-py3-none-any.whl
| Download URL | njmtech_upload_blob-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c262c5e3732638edab54e107025e341d47765f95a41601dc1933582030fc354
|
|
BLAKE2b-256 checksum How to use checksums |
e0ab3eb41780829edc2fb8248d040c9070d586edec80e481cdf46653c772347c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|