├── .gitignore ├── LICENSE ├── README.md └── py2nim.nim /.gitignore: -------------------------------------------------------------------------------- 1 | *.json 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2018 Zahary Karadjov, Alexander Ivanov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # py2nim 2 | 3 | A new WIP tool for porting Python code to Nim 4 | 5 | Based on [languist](https://github.com/metacraft-labs/languist) 6 | 7 | 8 | very basic still, if you're interested contact us using our emails or the #nim irc/gitter 9 | ## notice 10 | 11 | the original py2nim is on https://github.com/metacraft-labs/py2nim_deprecated/ : most of the stars/watches/forks are probably for it. it's probably closer to working state, but this version might be a better basis for the future(even if maybe less featured now), as it builds on the languist code which should support more languages 12 | 13 | ## how to use 14 | 15 | ```bash 16 | ./py2nim .py 17 | ``` 18 | 19 | generates `.nim` 20 | 21 | translating projects is WIP, but it would use 22 | 23 | ```bash 24 | ./py2nim 25 | ``` 26 | 27 | and the `languist.json` file there 28 | -------------------------------------------------------------------------------- /py2nim.nim: -------------------------------------------------------------------------------- 1 | import os, strformat 2 | 3 | if paramCount() >= 1: 4 | discard execShellCmd(&"languist {paramStr(1)}") 5 | else: 6 | echo "py2nim" 7 | --------------------------------------------------------------------------------