Skip to main content

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

  1. PyPI account (https://pypi.org/)
  2. PyPI API token configured
  3. All checks passed

Publishing steps

  1. Update version in pyproject.toml
  2. Update CHANGELOG.md
  3. Create git tag: git tag v0.1.0
  4. Push the tag: git push origin v0.1.0
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs_manim-0.1.4.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cs_manim-0.1.4-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file cs_manim-0.1.4.tar.gz.

File metadata

  • Download URL: cs_manim-0.1.4.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for cs_manim-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f2e370f4000e897be2f4e9085ec45238a2539430f9aef7d2174db4e99b11694c
MD5 3a92fdab74d0c58bff39d0ad8598fa7a
BLAKE2b-256 ff5d2f984dd54821e1e9d9a19bfd847bf247a3db088393b4c6b8748d23b34689

See more details on using hashes here.

File details

Details for the file cs_manim-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cs_manim-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for cs_manim-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa9504d9c31aa4f7daa98acd1452d1d902c713b4fc754ddf5820037835f00857
MD5 f5416167564fd9c40f3e8f61327b614f
BLAKE2b-256 b75b494aca0dc5891bac7b5fc521ad068bf3de4fefe5ebcc34ceaac604a899a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page