Skip to content

Repository files navigation

Pythonic C++ Library

Welcome! Pythonic is a modern C++20 library that brings the expressive power and clean syntax of Python to C++. It aims to make C++ code feel as natural and productive as Python, while retaining the performance and flexibility of C++.

What is Pythonic?

Pythonic is a C++ library designed for developers who love Python's dynamic features but need the speed and control of C++. It provides:

  • Dynamic typing and flexible containers
  • Python-style slicing, comprehensions, and string methods
  • Easy-to-use data structures (list, dict, set, etc.)
  • Graph algorithms and interactive graph visualization with ImGui
  • Terminal media rendering (images and videos in braille or true color)
  • Math utilities and more
  • A familiar, readable syntax—no weird hacks, just clean C++

Why use this library?

  • Write C++ code that feels like Python—concise, readable, and expressive
  • Rapid prototyping and algorithm development in C++
  • Seamless integration with modern C++ projects
  • Great for teaching, competitive programming, and research

Quick Example

#include<pythonic/pythonic.hpp>usingnamespacepythonic::vars;usingnamespacePythonic;intmain() {
// Python-style dynamic variables
var x = 42;
var name = "Alice";
var data = list({1, 2, 3, 4, 5});
print("Hello,", name, "! Sum:", sum(data));
// Terminal plottingpythonic::plot::plot([](double x) { returnsin(x); }, -3.14, 3.14);
// Print images/videos in terminalprint("photo.png"); // Displays image as braille artprint("video.mp4"); // Plays video in terminalreturn0;
}

User Guides & Documentation

  • Getting Started Guide — Complete step-by-step guide on cloning, building, installing, and using this library (includes all optional dependencies)
  • API Documentation — Detailed user guide for all features

Optional Features

The library includes several optional features that can be enabled during build:

FeatureDescriptionCMake FlagDependencies
Graph ViewerInteractive graph visualization with ImGui-DPYTHONIC_ENABLE_GRAPH_VIEWER=ONGLFW, OpenGL, ImGui
Audio PlaybackSynchronized audio for video playback-DPYTHONIC_ENABLE_SDL2_AUDIO=ONSDL2 or PortAudio
GPU RenderingGPU-accelerated video rendering-DPYTHONIC_ENABLE_OPENCL=ONOpenCL
OpenCV SupportWebcam capture & advanced processing-DPYTHONIC_ENABLE_OPENCV=ONOpenCV

Note: All features are optional. The core library works without any of these dependencies. See the Getting Started Guide for detailed installation instructions for each feature.

Basic Installation

# Clone the repository
git clone https://github.com/Creamy-pie-96/Pythonic.git
cd Pythonic
# Build and install (core features only)
mkdir build &&cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target install
# Use in your project's CMakeLists.txt
find_package(pythonic REQUIRED)
target_link_libraries(your_target pythonic::pythonic)

For detailed installation with optional features, see the Getting Started Guide.


ScriptIt — Scripting Language

ScriptIt is a dynamic scripting language built on top of Pythonic's var system, with a full VS Code extension, notebook support, and color customizer. See the ScriptIt Language Guide for full documentation.


Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer:

We’re looking for users to test the library and provide feedback! Please open Issues or Discussions with any bug reports, questions, or feature ideas. Note: Direct code contributions are not accepted at this time.

Acknowledgments

Parts of this project, including some code generation and much of documentation, were assisted by GitHub Copilot (AI programming assistant). Copilot provided suggestions and support throughout the development process.


AUTHOR: MD. NASIF SADIK PRITHU GITHUB:Creamy-pie-96


About

Hey there! So you love Python's clean syntax but need C++'s performance? You're in the right place. This library brings Python's most beloved features to C++ - dynamic typing, easy containers, slicing, string methods, comprehensions, and tons more. No weird hacks, just modern C++20 that feels surprisingly Pythonic.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages