Video animations with Manim to explain technical concepts related to computer science
Project description
CS-Manim
Video animations with Manim to explain technical concepts related to computer science.
Description
CS-Manim is a Python library that provides reusable objects and styles to create educational animations with Manim, specially designed to explain computer science and programming concepts.
Installation
pip install cs-manim
Usage
from manim import *
from cs_manim import Computer, Server, MobilePhone
from cs_manim import CLIENT_COLOR, SERVER_COLOR, FONT_NAME
class MyScene(Scene):
def construct(self):
# Create objects for your animations
computer = Computer("PC Client")
server = Server("API Server")
mobile = MobilePhone("Smartphone")
# Position and animate
computer.shift(LEFT * 3)
server.shift(RIGHT * 3)
self.play(Create(computer))
self.play(Create(server))
self.play(Create(api_call))
Features
- Reusable objects: Computers, servers, mobile phones, HTTP calls
- Consistent styles: Predefined colors and fonts
- Manim compatible: Uses Manim 0.19.0+
- Easy to use: Simple import and intuitive API
Available Objects
PortableComputer
computer = PortableComputer(name="My PC", color=CLIENT_COLOR)
Server
server = Server(name="My Server", color=SERVER_COLOR)
MobilePhone
mobile = MobilePhone(name="My Phone", color=PURPLE)
AndroidLogo
android = AndroidLogo(color=GREEN)
AppleLogo
apple = AppleLogo(color=WHITE)
Database
database = Database(name="My Database", color=BLUE)
Cloud
cloud = Cloud(name="My Cloud", color=GRAY)
Monitor
monitor = Monitor(name="My Monitor", color=BLACK)
TestTube
test_tube = TestTube(color=RED)
Development
Environment Setup
# Clone the repository
git clone https://github.com/PierreOlivierBrillant/cs-manim.git
cd cs-manim
# Create a virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or .venv\Scripts\activate # Windows
# Install in development mode
pip install -e .[dev]
Tests
# Run tests
pytest
# With coverage
pytest --cov=cs_manim
Formatting and linting
# Format the code
black cs_manim tests examples
# Check style
ruff cs_manim tests examples
# Check types
mypy cs_manim
Package building
# Build the package
python -m build
# Check the package
twine check dist/*
Publishing
Prerequisites for publishing
- PyPI account (https://pypi.org/)
- PyPI API token configured
- All checks passed
Publishing steps
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create git tag:
git tag v0.1.0 - Push the tag:
git push origin v0.1.0 - Create release on GitHub
Publishing to PyPI happens automatically via GitHub Actions when creating a release.
Manual publishing
# Build the package
python -m build
# Publish to PyPI
twine upload dist/*
Examples
See the examples/ folder for usage examples.
Contributing
See CONTRIBUTING.md for contribution instructions.
Dependencies
- Python >= 3.10
- Manim >= 0.19.0
- Pillow >= 11.0.0
- NumPy >= 1.24.0
- SciPy >= 1.10.0
License
MIT License - see the LICENSE file for details.
Author
Pierre-Olivier Brillant - pierreolivierbrillant@gmail.com
Links
Project details
Release history Release notifications | RSS feed
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 cs_manim-0.1.2.tar.gz.
File metadata
- Download URL: cs_manim-0.1.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9a36c700db50e165de32f992e0807c8dc1601b1a5f570462d0fb54c28361daa
|
|
| MD5 |
2e618a1467f061f269917cf2eb545397
|
|
| BLAKE2b-256 |
a29ab5de8650ac90b02b5658ba27637d9684441c5d4abddc14a0638e3ae7f3ad
|
File details
Details for the file cs_manim-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cs_manim-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6001edecf74e5dd5fb51930e641df5f3b8ef99252b348a8f1118da475304c0f
|
|
| MD5 |
219f7bedf7ac678c3231c8161e1ce869
|
|
| BLAKE2b-256 |
58322b9d137cd294f72f6979ff22151fe4f03eec5ac4179ed3074548b35b0fc0
|