본문 바로가기
REFLEX 튜토리얼

reddit에 pynecone 개발진이 직접 작성한 글

by 일코 2023. 1. 19.

아래의 글은 지난달 레딧에 올라온
파인콘의 소개글입니다.

공식 홈페이지에서도 확인할 수 있지만,
pynecone을 제작하게 된 계기와 특징을 잘 설명해 주고 있습니다.

Hello, we just launched the alpha release of Pynecone - a way to build full-stack web apps in pure Python. The framework is easy to get started with even without previous web dev experience and is completely open source / free to use.

안녕하세요, 우리는 순수 Python으로 풀 스택 웹 앱을 구축하는 방법인 Pynecone의 알파 릴리스를 방금 출시했습니다. 이 프레임워크는 이전 웹 개발 경험이 없어도 쉽게 시작할 수 있으며 완전히 오픈 소스이며 무료로 사용할 수 있습니다.

We made Pynecone for Python devs who want to make web apps, but don’t want the overhead of having to learn or use Javascript. We wanted more flexibility than existing Python frameworks like Streamlit/Dash that don't allow the user to make real, customizable web apps.

웹 앱을 만들고 싶지만 자바 스크립트를 배우거나 사용해야 하는 학습비용을 원하지 않는 Python 개발자를 위해 Pynecone을 만들었습니다. 우리는 사용자가 실제 사용자 정의 가능한 웹 앱을 만들 수 없는 Streamlit/Dash 등의 기존 Python 프레임워크보다 더 많은 유연성을 원했습니다.

With Pynecone, you can make anything from a small data science/python project to a full-scale, multi page web app. (We built our whole website and docs with Pynecone). We have over 60+ built-in components and are adding more.

Pynecone을 사용하면 소규모 데이터 과학/파이썬 프로젝트에서 본격적인 다중 페이지 웹 앱에 이르기까지 무엇이든 만들 수 있습니다(우리는 Pynecone으로 공식 웹사이트와 문서를 구축했습니다). 현재 60개 이상의 빌트인 구성 요소를 보유하고 있으며 계속해서 추가중입니다.
다음은 ~ 50 줄의 Python으로 생성 된 Dalle Pynecone 앱의 예입니다 (코드는 Github 링크 참조)

We are actively trying to grow this project so no matter you skill level we welcome contributions! Open up an issue if you find missing features/bugs or contribute to existing issue. Star us on GitHub if you want to follow our progress as new updates come!

이 프로젝트를 성장시키기 위해 적극적으로 노력 중이며, 기술 수준에 관계없이 여러분의 기여를 환영합니다! 누락된 기능 / 버그를 발견하거나 기존 문제에 기여하시려면 이슈를 등록해주세요. GitHub의 스타를 클릭해주시면 새 업데이트 소식에 대해 팔로우하실 수 있습니다.

 

원문 출처 : Reddit - Dive into anything

 

Pynecone: Web Apps in Pure Python

Posted in r/Python by u/Boordman • 607 points and 184 comments

www.reddit.com

 

아래는 해당 글에 대한 질문댓글 일부입니다.

pynecone에 관심있는 개발자라면 누구나 궁금해할 부분을 익명으로 속시원하게 물어보는데,
답변도 뚜렷하고, 개발 방향에 대해 솔직하게 이야기해주는 부분이 인상깊습니다.
(답변 일부에서 Alek이 답글을 작성하고 있음을 알려주는 맥락이 있기도 합니다.)

 

Q. Sounds amazing... But why does it need Node?

멋져 보입니다. 근데 왜 node를 필요로 하는 거죠?

A. Thanks! This is actually something we are working on getting rid of. What separates us from other python frameworks is that we compile down to a nextjs/react app (the user never sees this though). This is really beneficial because it allows us to add any react library in a matter of hours vs other python frameworks where it can take a much longer time to add new ui feature. Also for performance and SEO nextjs is great.

감사합니다! 실은 우리 프레임워크에서 node.js를 제거하는 작업을 진행중입니다. 기존의 파이썬 웹프레임워크와 pynecone의 가장 큰 차이점은, pynecone은 내부적으로 파이썬 코드를 nextjs/react 앱으로 컴파일한다는 점입니다. 컴파일 방식의 가장 큰 이점을 꼽으라면, 어떤 리액트 라이브러리든지 가져와 즉시 사용할 수 있다는 점입니다. 반면에 기존의 파이썬 웹프레임워크에서는 새 UI 요소 하나를 추가하기 위해 많은 시간을 들여 코딩을 해야 하고요. 또한, 내부적으로 nextjs를 사용하기 때문에, 이 방식이 성능이나 검색엔진 최적화 등에도 뛰어납니다.

But to keep it short there is a way to get rid of this in the future and we are currently working on it. So the only installation step will be `pip install pynecone-io`

하지만 조만간 (node를) 제거하기 위해 작업중이기는 합니다. 그렇게 되면 "pip install pynecone-io"만 입력해도 pynecone의 설치가 완료될 것입니다.

 

Q. What is the plan? Will there just be a wrapper around node,
or are you writing something to actually replace it?

앞으로의 계획이 어떻게 되시죠? Pynecone이 그저 node를 래핑한 모듈로 남을지,
아니면 node를 교체할 수 있는 뭔가를 개발중이신 건가요?

A. We are looking to transition everything to bun which is way faster than node and an easier install. Bun is still a little early and not totally compatible with nextjs yet.

우리는 현재 node를 사용하는 모든 부분을 조만간 bun으로 교체하려고 합니다. bun은 node보다 속도도 훨씬 빠르고 설치도 간단합니다. 하지만 bun으로 전부 교체하기에는 아직 너무 이릅니다. bun과 nextjs와의 호환성이 완벽하지도 않은 상태이고요.

 

Q. This app looks great, but there's a small thing you mention which I have to question:
    "What separates us from other python frameworks is that
     we compile down to a nextjs/react app~"

I'm pretty sure both Streamlit and Dash (two other web-app design tools, though more specialized on Data Science Applications) compile down to react. I don't think either of them use NextJS, though. I should also add that from what I've read elsewhere in this thread, it sounds like you have a roadmap to make it more performant, too.

정말 멋져 보입니다. 근데 남겨주신 댓글을 읽다가 궁금한 점이 하나 생겼습니다.
"Pynecone이 다른 파이썬 프레임워크들과 가장 다른 점은 nextjs/react 앱으로 컴파일한다는 점인데요.." 라고 하셨는데 제가 알기로는 Streamlit이나 Dash 모두 (데이터과학에 특화돼 있기는 하지만) 역시 react로 컴파일합니다. NextJS를 사용하지는 않지만요. 이 스레드 어딘가에서, 다른 프레임워크보다 뛰어난 퍼포먼스를 끌어내겠다고 하셨는데, 어떤 로드맵을 갖고 계신지도 궁금합니다.

A. Thanks. Yeah, we definitely looking to be more performant in the future. Streamlit actually use tornado so not exactly the same. Not sure about dash. But our components have more of a 1 to 1 wrapping so I was trying to get at that. It's much easier for us to add components in our frameworks vs theirs.

감사합니다. 맞아요. 우리는 Pynecone이 향후 더 높은 성능을 가져올 것으로 확신하고 있습니다. 사실 Streamlit은 tornado를 사용하기 때문에, Pynecone과 같은 방식은 아닙니다. (Dash는 정확히 어떤 방식인지 잘 모르겠네요..) 하여튼 Pynecone은 (react를) 1:1로 래핑한 컴포넌트들이 더 많습니다. 그래서 Pynecone 프레임워크에는 컴포넌트를 훨씬 쉽게 추가할 수 있습니다. 다른 프레임워크들은 컴포넌트 추가가 어렵습니다.
(지나가는이 : "Dash는 react.js와 plotly.js로 구축되어 있답니다.")

 

Q. So is it currently running on Nodes engine? And that’s why you need Node?

그러니까, 현재는 node 엔진 위에서 돌아간다는 말이네요? 그래서 node가 필요한 거고요?

A. So we compile down to a traditional web app so you can expect the performance of a traditional web framework like react/nextjs but the user just sees python. To run a this node is needed. However we are looking too transition to bun which is way faster and more light weight. Bun is a little premature so we are waiting for it to support nextjs better

맞습니다. 사용자는 파이썬 코드만 다룰 뿐이지만, 내부적으로는 react/nextjs로 컴파일되어 뛰어난 성능을 보일 수 있기 때문입니다. 그래서 아직은 node가 필요합니다. 하지만 조만간 node 전체를 bun으로 교체할 예정입니다. bun은 node보다 훨씬 빠르면서도 가볍기 때문입니다. 그저, bun이 아직은 좀 덜 성숙한 라이브러리이기 때문에, bun이 nextjs와 좀 더 잘 호환이 되는 시점까지 교체를 기다리는 중입니다.

 

Q. Do javascript exceptions get caught and translated into catchable python exceptions with stack trace? I'm not even sure if this is possible (the catchable part or providing a python equivalent stack trace) but it would be fantastic if it was.

자바 스크립트 단에서 발생하는 예외가 파이썬에서 stack trace로 나타나게 해주실 수 있을까요? 그게 구현가능한지는 모르겠습니다. (캐치 가능한 파트나, js 예외에 대응하는 파이썬의 stack trace를 만들어주신다든지?) 그렇게만 만들어주시면 정말 환상적인 기능이 될 것 같습니다.

A. Great insight, this is something we are actively working on ideals we don't want the user to every see js error and I think with better error handling over time we can improve in this!

대박 인사이트네요! 현재 우리가 진행중인 작업 중에도, 사용자에게 자바스크립트 오류를 뱉는 대신에, 좀 더 나은 에러핸들링을 제공한다든지 하는, 보다 나은 방식으로 개선하려고 하고 있습니다.

 

Q. I know this is a stupid question, but what is the difference between a web app and creating a website with something like Flask? Is the spinning icon the element the difference?

무식한 질문인 줄 알지만, 웹앱과 웹사이트(Flask 등으로 만든)의 차이점이 무엇인가요?  로딩 아이콘이 있고 없고의 차이인가요?

A. No. Great question. This question is debated a bit. But I would consider a web app to have interaction with actually logic vs a website is just kinda static. Up for debate though..

아뇨. 훌륭한 질문입니다. 사실 이 주제로 가끔씩 토론이 일어나기도 합니다. 제 주관적으로 말씀드려보자면, "웹앱"은 어떤 특정 로직을 가지고 사용자와 상호작용을 하는 반면, "웹사이트"라는 용어는 약간 정적인 것 같다는 느낌입니다.
제 답변도 논란의 소지가 있어 보이네요...

 

Q. That's very cool but I can't stop thinking: why?

멋지긴 한데, "굳이 왜?" 라는 물음을 지울 수가 없네요..

 

A. Thanks! A lot of people don't want to spend the time to learn web dev but want to share there project/idea in an interactive way like a web app. I'm in the ml/infra space and when my team wanted to make web apps frameworks like streamlit were not cutting it and we didn't have the time or drive to learn css/js/react etc.

감사합니다. 많은 사람들이 자신들의 프로젝트나 아이디어를 인터랙티브한 방식으로 공유하길 원합니다. 웹앱 같은 방식으로요. 근데 웹개발을 배우는 데 시간이 많이 걸리기 때문에 이를 포기하곤 합니다. 저도 머신러닝/인프라 업계에 종사하고 있는데, 우리 팀원들만 봐도 streamlit 같은 프레임워크를 통해 웹앱을 만들고 싶어하는데, 실상은 CSS, 자바스크립트나 리액트 같은 걸 배울 시간이나 에너지가 부족한 실정입니다..

하나만 더 쓰고 마치겠습니다...

 

Q. This looks awesome. Thanks for doing this! Just one question though, why is this free? It looks like you put a boat load of time into it. Are you planning to charge for it in the future?

정말 멋집니다. 이런 작업을 해주셔서 감사해요. 근데 질문이 하나 있습니다. 이게 왜 무료인가요? 인생 갈아넣는 중이신 것 같은데? 향후에 유료로 전환할 생각은 없으신지요? (역자도 궁금..)

A. We really care about the mission of the project: saving people time and enabling them to share their projects with the world. All transparency we plan to launch and optional hosting service but the core will always be free.

우리 프로젝트에서 가장 중요하게 여기는 우리의 미션은, "사람들의 시간을 절약하고 그들의 프로젝트를 전 세계와 공유할 수 있도록 하자" 입니다. 솔직히(?) 일부 호스팅 서비스를 유료로 제공할 계획은 있지만, 프레임워크 자체는 언제나 무료일 것입니다!

 

저도 (의역오역 왕창 범벅되어 있을) 번역을 하면서 읽으면서
Pynecone에 대해 더 잘 이해되는 느낌입니다.
앞으로 더 발전할 Pynecone을 기대해봅니다.

 


국내 유일의 파이썬+한컴오피스 자동화 입문강의

 

움짤로 빠르게 배우는 파이썬-아래아한글 자동화 레시피 - 인프런 | 강의

파이썬으로 아래아한글을 다루는 짧은 예제코드들을 소개하고, 중간중간의 결과를 GIF로 보여드립니다. 동영상 강의가 아니지만 오히려 빠르게 배울 수 있고, 따라하기도 쉽습니다., - 강의 소개

www.inflearn.com

 

댓글