Skip to main content

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

  1. You call NiroC("your task") anywhere in your code
  2. NiroC reads the current file
  3. Sends it to AI (Pollinations / OpenRouter — free, no API key needed)
  4. AI generates new complete code
  5. NiroC overwrites your file with the new code
  6. 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_backup file before overwriting (disable with set_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

niroc-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

niroc-1.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file niroc-1.0.0.tar.gz.

File metadata

  • Download URL: niroc-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for niroc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 55b7e3b1bb10777ade6344df872b4fffb2050e76f2e2c59d9a174e9c6a2ecb2b
MD5 e5d718fbf0e8c7d23451a27c63b8cea8
BLAKE2b-256 a8d7aea475c1ad7305381d70ff6c094816058406a2c960e234982e8e6fbff009

See more details on using hashes here.

File details

Details for the file niroc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: niroc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for niroc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9bebb3bdcba2faba65eee007723c7bcacf584b7f031741370d2f69a3ebde2f7
MD5 6356da9a2321b7f44517da7155973bdc
BLAKE2b-256 8af1a2d2a2744837e3a88d71d2227e733059d114f9008181e04119e71cd0ee3d

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