ricectopy
ricectopy is a lightweight C-to-Python source translator for a limited subset of C.
Installation
pip install .
For development:
pip install -e .
Python API
import ricectopy as rep
translator = rep.start()
python_code = translator.trans("""
int main() {
printf("Hello\\n");
return 0;
}
""")
print(python_code)
Command line
ricectopy input.c
Or specify the output file:
ricectopy input.c output.py
Currently supported
- Basic function definitions
if,else if,elsewhile- Basic increasing
forloops - Primitive variable declarations
- Assignment
return- Basic
printf ++and--&&,||,!true,false,NULL
Limitations
This project is an alpha-stage source translator, not a full C compiler. It does not yet fully support pointers, structs, arrays, macros, switch, scanf, C type semantics, or the complete printf format language.
Build
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 ricectopy-0.1.1.tar.gz.
File metadata
- Download URL: ricectopy-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdb323cd811f86570fc1d73aa5d38e77642d419eaafb8c2e84b1567ce966f1ce
|
|
| MD5 |
350bca3a8593327b1486daa1b73792ee
|
|
| BLAKE2b-256 |
e303d9ff7d433c59b44a592d8fca2f5b99dfac7e84c77cd2a9993a431c4752a7
|
File details
Details for the file ricectopy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ricectopy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca28a7aec796fd16c0d1349c20b5b0dd33afa2d847bf71ec4e23afac1685b06e
|
|
| MD5 |
f6081ec7d5aebb26b6618419fb3e4f13
|
|
| BLAKE2b-256 |
024b4fa155607432662aef9a349cdb6d7c4e73cdf6f3f210cc465d5fa0c64873
|