Transform your code with AI using NiroC('your task')
Project description
⚡ NiroC — AI Code Transformer
Transform your code with a single function call.
from niroc import NiroC
NiroC("Make a Tetris game")
Run your file → NiroC calls AI → rewrites your file → restarts it. Magic.
Install
pip install niroc
Usage
In Python code
from niroc import NiroC
# At the top of your file — NiroC rewrites everything below
NiroC("Make a Snake game with pygame")
from niroc import NiroC
NiroC("Add a REST API with FastAPI for a todo app")
from niroc import NiroC
NiroC("Optimize this bubble sort to use quicksort")
From command line
niroc "Make a Tetris game" game.py
niroc "Add dark mode" app.py --no-restart
niroc "Add login form with JWT" --file=app.py
How it works
- You call
NiroC("your task")anywhere in your code - NiroC reads the current file
- Sends it to AI (Pollinations / OpenRouter — free, no API key needed)
- AI generates new complete code
- NiroC overwrites your file with the new code
- Restarts the file automatically
Configuration
from niroc import NiroC, set_config
# Optional: use your OpenRouter key for better models
set_config(api_key="sk-or-...")
# Don't auto-restart
set_config(auto_restart=False)
# Disable backup
set_config(backup=False)
# Silent mode
set_config(verbose=False)
NiroC("Make a calculator app")
Examples
# game.py
from niroc import NiroC
NiroC("Make a fully working Tetris game using pygame")
# api.py
from niroc import NiroC
NiroC("Create a FastAPI REST API with CRUD for a blog")
# sort.py
from niroc import NiroC
NiroC("Implement merge sort with step-by-step visualization")
Notes
- Creates a
.niroc_backupfile before overwriting (disable withset_config(backup=False)) - Works with Python, JavaScript, TypeScript, Ruby, Go, Rust, Java, C/C++
- Zero dependencies — only Python stdlib
- Free AI providers used by default (Pollinations AI)
License
MIT
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
niroc-2.0.0.tar.gz
(10.1 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
niroc-2.0.0-py3-none-any.whl
(9.6 kB
view details)
File details
Details for the file niroc-2.0.0.tar.gz.
File metadata
- Download URL: niroc-2.0.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4d7cdc96815dfce15b9369180cb5fcdc6d9cecb537f3aa73af8eaffe95e4c3f
|
|
| MD5 |
64a671f8d1b80e1a626df3bd17516184
|
|
| BLAKE2b-256 |
a65c61183cc0404394b3f500b7670c9a8078394316ba87f807b45fc0e14be1b8
|
File details
Details for the file niroc-2.0.0-py3-none-any.whl.
File metadata
- Download URL: niroc-2.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
394d63321275ffe42cb2839ca5442c624be7196b8275dba8f643709d89deccf6
|
|
| MD5 |
0c5bd287a759401e69cfe022eb03d492
|
|
| BLAKE2b-256 |
437a1ff9e7d5e0003c500f9df63a869e6448a227ff4b434741e32e3b17a2085b
|