A modern FastAPI microservice that helps developers with encoding, formatting, timestamp conversion, UUID generation, and more.
The Developer Toolkit API is a modular backend service built with FastAPI. It provides a growing set of utility endpoints to simplify common developer tasks, such as JSON formatting and string manipulation. This project is designed for clarity, scalability, and easy testing.
FastAPI is a modern, high-performance web framework for building APIs with Python 3.7+ based on standard Python type hints. It is designed for speed and developer productivity, offering automatic data validation, interactive documentation via Swagger and ReDoc, and seamless integration with asynchronous Python code.
FastAPI is ideal for building APIs quickly while maintaining readability, robustness, and scalability. It is widely adopted for backend services, microservices, and machine learning model deployment.
- JSON prettifier (minify and beautify raw JSON)
- Modular route structure using FastAPI routers
- Auto-generated OpenAPI docs (Swagger UI and ReDoc)
- Unit tested with
pytest
- Continuous integration using GitHub Actions
- Optional Docker setup (coming soon)
developer-toolkit-api/
├── app/
│ ├── __init__.py
│ ├── main.py
│ └── routes/
│ └── json_tools.py
├── tests/
│ └── test_json_tools.py
├── .github/
│ └── workflows/
│ └── ci.yml
├── pytest.ini
├── requirements.txt
├── README.md
├── .gitignore
git clone https://github.com/MeelahMe/developer-toolkit-api.git
cd developer-toolkit-api
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
By default, the API will be available at:
http://localhost:8000
Unit tests are written with pytest.
To run tests locally:
`PYTHONPATH=$(pwd) pytest`
You can also use pytest.ini
to simplify local test runs:
pytest.ini
[pytest]
python_paths = .
Then run:
pytest
Tests automatically run on each push and pull request using GitHub Actions. The workflow is defined in .github/workflows/ci.yml.
To trigger a run:
Push any commit
Open a pull request
You can view the results in the Actions tab of the repository.
FastAPI automatically generates two UIs:
-
Swagger UI:
http://localhost:8000/docs
-
Redoc UI:
http://localhost:8000/redoc
GET /
Returns a welcome message.
POST /tootls/json/prettify
Description: Beautifies a raw JSON string
Request Body:
{
"content": "{\"key\":\"value\"}"
}
Response:
{
"prettified": "{\n \"key\": \"value\"\n}"
}
You can run the Developer Toolkit API in an isolated container using Docker. This approach is recommended for local development and deployment because it ensures consistent environments across machines.
- Docker Desktop installed and running
- Clone the repository and navigate to the root directory
The project includes a Dockerfile
that defines the container build steps:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Run this command from the project root:
docker build -t developer-toolkit-api .
This will:
- Use Python 3.9 as the base image
- Install dependencies from requirements.txt
- Copy all app files into the container
- Run the FastAPI app using Uvicorn
After the image is built, start a container:
docker run -p 8000:8000 developer-toolkit-api
You can now access the API at:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
To run in detached mode use this command:
docker run -d -p 8000:8000 --name dev-tools-api developer-toolkit-api
docker stop dev-tools-api
docker rm dev-tools-api
To reduce image size and exclude unnecessary files, use a .dockerignore by adding this file in your root:
__pycache__/
*.pyc
*.pyo
*.pyd
venv/
.env
*.log
.git/
.gitignore
tests/
This ensures only the necessary application files are included in your final image.
You can also use Docker Compose to manage the application and future services like databases or caching layers. This is a scalable approach for development and deployment.
This file defines the API service and allows you to run it with a single command:
version: '3.9'
services:
api:
build: .
container_name: developer-toolkit-api
ports:
- "8000:8000"
volumes:
- .:/app
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
To build and start the service:
docker-compose up --build
Once running, the API will be available at:
Swagger UI: `http://localhost:8000/docs`
ReDoc: `http://localhost:8000/redoc`
Stop the running services:
docker-compose down
Rebuild the image and restart:
docker-compose up --build
Rebuild without using cache:
docker-compose build --no-cache
- Scales easily with additional services (e.g., databases, task queues)
- Defines infrastructure-as-code for local dev environments
- Simplifies team collaboration with one-command startup
FastAPI automatically generates two UIs:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
Method | Endpoint | Description |
---|---|---|
GET | / |
Root welcome message |
POST | /tools/json/prettify |
Prettifies raw JSON input |
GET | /tools/uuid/generate |
Generates a UUID v4 |
POST | /tools/base64/encode |
Encodes a string to Base64 |
POST | /tools/base64/decode |
Decodes a Base64 string |
POST | /tools/time/convert |
Converts between UNIX timestamp and ISO date string |
GET | /tools/password/generate |
Generates a secure random password |
Returns a welcome message confirming the API is running.
Formats a raw JSON string with proper indentation.
Request Body
{
"content": "{\"key\":\"value\"}"
}
Response
{
"prettified": "{\n \"key\": \"value\"\n}"
}
Generates a random UUID (version 4).
Response
{
"uuid": "c3d1a60e-5f63-42a5-8469-789db166e1b9"
}
Encodes a plain text string into Base64.
Request Body
{
"content": "hello world"
}
Response
{
"encoded": "aGVsbG8gd29ybGQ="
}
Decodes a Base64-encoded string back to plain text.
Request Body
{
"encoded": "aGVsbG8gd29ybGQ="
}
Response
{
"decoded": "hello world"
}
Converts between a UNIX timestamp and an ISO 8601 date string.
You must provide either a timestamp
or a date_string
.
Request Body (timestamp to date):
{
"timestamp": 1609459200
}
Response:
{
"date_string": "2021-01-01T00:00:00"
}
Request Body (date to timestamp):
{
"date_string": "2021-01-01T00:00:00"
}
Response:
{
"timestamp": 1609459200
}
Generates a secure, random password.
You can customize the password using query parameters:
Query Parameters:
Name | Type | Default | Description |
---|---|---|---|
length |
integer | 12 |
Desired length of the password (4–128) |
include_symbols |
boolean | true |
Include special characters |
include_numbers |
boolean | true |
Include digits |
include_uppercase |
boolean | true |
Include uppercase letters |
include_lowercase |
boolean | true |
Include lowercase letters |
Example Request
GET /tools/password/generate?length=16&include_symbols=false&include_numbers=true
Response
{
"password": "ab9ZxkwmT4rnqY1v"
}
- URL Encoder/Decoder
- IP Info Lookup
This project is licensed under the MIT License.