Yesterday I created a small project for managing Python packages and building a new package based on added modules. I only tested the local installations of various Python versions and the creation of a new package, but it worked.
python catafest_build_package_001.py
🔍 Verificare module standard...
[✓] Modul standard 'json' este disponibil.
[✓] Modul standard 'subprocess' este disponibil.
[✓] Modul standard 'platform' este disponibil.
[✓] Modul standard 'datetime' este disponibil.
[✓] Modul standard 'os' este disponibil.
[✓] Modul standard 'sys' este disponibil.
📦 Verificare și instalare module pip...
[✓] Modulul 'PyQt6' este deja instalat.
[✓] Modulul 'build' este deja instalat.
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools
- wheel
...
from manim import *
class AdvancedAnimation(Scene):
def construct(self):
# Scene 1: Introduction
title = Text("Advanced Animation with Manim").scale(0.76)
self.play(FadeIn(title))
self.wait(2)
# Scene 2: Custom Animation
circle = Circle().set_fill(color=BLUE, opacity=0.5)
square = Square().set_fill(color=RED, opacity=0.5)
self.add(circle, square)
self.play(
Rotate(circle, angle=TAU),
Rotate(square, angle=-TAU),
run_time=2,
rate_func=linear
)
self.wait()
# Scene 3: Text Animation
text = Text("This is a custom text animation", font_size=40).to_edge(UP)
self.play(Write(text), run_time=2)
self.wait()
# Scene 4: Shapes Manipulation
triangle = Triangle().shift(RIGHT * 2)
self.play(GrowFromCenter(triangle), run_time=1.5)
self.wait()
# Scene 5: Transition to next scene
self.play(Uncreate(triangle), FadeOut(text))
# Scene 6: Final Animation
final_text = Text("This is the end of our animation", font_size=50).to_edge(DOWN)
self.play(FadeIn(final_text), run_time=1.5)
self.wait(2)
# Run the animation
AdvancedAnimation()
Use this command to render:
python.exe -m manim render manim_test_001.py AdvancedAnimation -p
AdvancedAnimation -p
Manim Community v0.19.0
[06/27/25 19:52:43] INFO Animation 0 : Partial movie file scene_file_writer.py:588
written in
'D:\PythonProjects\manim_projects\med
ia\videos\manim_test_001\1080p60\part
ial_movie_files\AdvancedAnimation\397
7891868_355746014_223132457.mp4'
...
[06/27/25 19:53:56] INFO Previewed File at: file_ops.py:237
'D:\PythonProjects\manim_projects\media\videos
\manim_test_001\1080p60\AdvancedAnimation.mp4'
The result comes with many files, see this 1080p60 video result:
I was very busy with development and testing for about two weeks and my laptop was stuck and I was working hard... Today I managed to test local background clipping on my laptop with a local Ollama installation separated by a Python module but with processing from the Python script. I also used Microsoft's Copilot artificial intelligence for python and it works well even though it is not theoretically specialized in development. The source code is quite large but the result is very good and fast:
import subprocess
import os
import json
from PIL import Image, ImageOps
class OllamaProcessor:
def __init__(self, config_file):
self.config_file = config_file
self.model_methods = self.load_config()
def load_config(self):
try:
with open(self.config_file, 'r') as file:
config = json.load(file)
print("Configuration loaded successfully.")
return config
except FileNotFoundError:
print(f"Configuration file {self.config_file} not found.")
raise
except json.JSONDecodeError:
print(f"Error decoding JSON from the configuration file {self.config_file}.")
raise
def check_ollama(self):
try:
result = subprocess.run(["ollama", "--version"], capture_output=True, text=True, check=True)
print("Ollama is installed. Version:", result.stdout)
except subprocess.CalledProcessError as e:
print("Ollama is not installed or not found in PATH. Ensure it's installed and accessible.")
raise
...
Here is the result obtained after finishing running in the command line:
python ollama_test_001.py
Configuration file ollama_config.json created successfully.
Configuration loaded successfully.
Ollama is installed. Version: ollama version is 0.5.7
Available models: ['NAME']
pulling manifest
pulling 170370233dd5... 100% ▕██████████████▏ 4.1 GB
pulling 72d6f08a42f6... 100% ▕██████████████▏ 624 MB
pulling 43070e2d4e53... 100% ▕██████████████▏ 11 KB
pulling c43332387573... 100% ▕██████████████▏ 67 B
pulling ed11eda7790d... 100% ▕██████████████▏ 30 B
pulling 7c658f9561e5... 100% ▕██████████████▏ 564 B
verifying sha256 digest
writing manifest
success
Model llava pulled successfully for method process_images_in_folder.
Some "Command failed ..." but the result is cutting well and it has transparency !
Today I tested the urllib python module with python 3.7.3 and json python module.
The issue was to get the location of International Space Station - Open Notify. The International Space Station is moving at close to 28,000 km/h so its location changes really fast! Where is it right now?
This is an open source project to provide a simple programming interface for some of NASA’s awesome data.
I do some of the work to take raw data and turn them into APIs related to space and spacecraft.
C:\Python373>python.exe
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD6
4)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> with urllib.request.urlopen('http://api.open-notify.org/iss-now.json') as f:
print(f.read(300))
...
b'{"iss_position": {"longitude": "-86.9247", "latitude": "-38.3744"}, "message":
"success", "timestamp": 1556575039}'
>>> with urllib.request.urlopen('http://api.open-notify.org/iss-now.json') as f:
... source = f.read()
... data = json.loads(source)
...
>>> print(data)
{'iss_position': {'longitude': '151.1941', 'latitude': '49.4702'}, 'message': 's
uccess', 'timestamp': 1556578621}
>>> print(data['iss_position']['longitude'])
151.1941
>>> print(data['iss_position']['latitude'])
49.4702
>>> print(data['message'])
success
Today I will come with a simple example about geocoding.
I used JSON and requests python modules and python version 2.7.
About geocoding I use this service provide by datasciencetoolkit.
You can use this service free and you don't need to register to get a key.
Let's see the python script:
import requests
import json
url = u'http://www.datasciencetoolkit.org/maps/api/geocode/json'
par = {
u'sensor': False,
u'address': u'London'
}
my = requests.get(
url,
par
)
json_out = json.loads(my.text)
if json_out['status'] == 'OK':
print([r['geometry']['location'] for r in json_out['results']])
I run this script and I test with google map to see if this works well.
This is output and working well with the geocoding service: