Create fully typed declarative API clients quickly and easily. - martinn/quickapiclient
News and discussions about the programming language Python
-
Python @lemmy.ml daco @lemm.ee D2 (d2lang) Python Wrapper
cross-posted from: https://lemm.ee/post/48031022
Hi,
I wanted to use d2 in an environment where I could only install python and npm packages.
Given that, and that I could not find any other solution, I made d2-python-wrapper, a small python wrapper that bundles the d2 binaries.
Now you can use d2 from python like this:
python
from d2_python import D2 d2 = D2() # Simple diagram with open("test.d2", "w") as f: f.write("x -> y") # Default SVG output d2.render("test.d2", "output.svg") # PDF output with specific theme d2.render("test.d2", "output.pdf", format="pdf", theme="1")
The class just wraps the bin, so it works and supports the same as the bin. There is a GitHub Action that gets the bins for each platform (mac, win, linux) from the releases in this repo and publishes it to pip.
You can install this using
shell
pip install d2-python-wrapper
-
Python @lemmy.ml DevCuber @sh.itjust.works Updating pip in a FUSE cryptomator vault breaks venv
cross-posted from: https://sh.itjust.works/post/27097438
I store my programs in a cryptomator vault which uses a fuse virtual drive (The default on Linux), but when trying to update pip inside a venv I get an error, then any subsequent use of pip also throws an error and {path_to_venv}/lib/python3.12/site-packages/pip/ becomes empty.
I imagine this is an issue that would happen in any FUSE drive although I don't know how to test that.
- OS : Fedora 40
- pip version: 23.3.2 updating to 24.2
- python version: 3.12.7
I already made a bug report on the github
Does anyone know a temporary workaround for this ?
-
Python @lemmy.ml Arthur Besse @lemmy.ml Rust macro to inline Python(-ish) code
cross-posted from: https://lemmy.ml/post/21461907
So, this uses a macro, but if you're thinking anything is possible with a macro, it's actually not in Rust. The input does still need to parse as valid Rust tokens.
Which means the authors asked themselves at some point: Is the Rust syntax a superset of the Python syntax?
And well, it's not. In particular, some Python keywords will just be tokenized as an identifier (like a variable name).But it is close enough that the authors decided against requiring a massive string to be passed in, which does amuse me. 🙃
-
Python @lemmy.ml SpongeB0B @programming.dev Installing gunicorn once on the OS and reuse it between venv ?
cross-posted from: https://programming.dev/post/17866168
Hi,
I have quite few
venv
that run gunicorn.I would like to reuse
gunicorn
for othervenv
I launch my web application like this
bash
#PWD = venv dir source ./bin/activate gunicorn A_WebApp:app #A_WebApp is my python file A_WebApp.py
I supposes that
gunicorn
is a shell program ? if yes I should use$PATH
?
\ orgunicorn
is a Python program only ? and then what I should do to use gunicorn in anothervenv
?Thanks.
-
Python @lemmy.ml Zara @lemmy.ml Do you know a CCTV software write in Python ?
Hi,
I'm looking for a software similar to ZoneMinder
\ https://lemmy.ml/post/18530232But it seem that ZoneMinder become slowly outdated, php etc..
I've found a couples of alternatives ( hard choice as the limitations of use are often buried deep )
It seem that openCV is really famous for AI Computer vision, So I would be surprise if there were no Python program to manage cameras like a ZoneMinder !?
Do you know any ?
Thanks.
-
Python @lemmy.ml martinn @programming.dev A library for creating fully typed declarative API clients quickly and easily
github.com GitHub - martinn/quickapiclient: Create fully typed declarative API clients quickly and easily.cross-posted from: https://programming.dev/post/13395352
Would love to hear any suggestions, feedback or comments.
-
Python @lemmy.ml MichelDesmoulin @lemmy.ml Announcing py2wasm: A Python to Wasm compiler
wasmer.io Announcing py2wasm: A Python to Wasm compiler · Blog · WasmerSince starting Wasmer five years ago we've been obsessed with empowering more languages to target the web and beyond through Webassembly. One of the ...
-
Python @lemmy.ml ylai @lemmy.ml PEP 744 – JIT Compilation
peps.python.org PEP 744 – JIT Compilation | peps.python.orgEarlier this year, an experimental “just-in-time” compiler was merged into CPython’s main development branch. While recent CPython releases have included other substantial internal changes, this addition represents a particularly significant departure f...
-
Python @lemmy.ml slyuser @lemmy.ml Python IDLE: A Comprehensive Guide for Beginners
Unleash Your Python Potential with Python IDLE: The Ultimate Beginner's Guide! From Installation Hacks to Secret Debugging Tricks, Master Python IDLE in Minutes! 💻🚀 #Python #Programming #BeginnerGuide
-
Python @lemmy.ml Communist @lemmy.ml Help with a python script to control my lights?
github.com [Example request] The most basic way to turn an individual, specific light on and off · Issue #185 · mclarkk/lifxlanI've been struggling with this for hours, i'm not a python dev, i'm just trying to control my lights with my linux pc #!/usr/bin/env python import sys from lifxlan import LifxLAN def main (): lan =...
I'm just trying to control my smartlights with a script, it seems to be having a lot of problems, I really don't know what I'm doing, i'd appreciate any help I can get
Once I have a script that can individually turn lights on/off i can edit the rest myself, I just can't get the base functionality working.
-
Python @lemmy.ml bluestarshield @lemmy.ml Python workbook recommendations?
Hey, I've been looking to learn Python for a while, tried as a kid but got bored before I did anything. I was wondering if anyone knew of any good Python self-study workbooks? The ones with exercises in addition to theory. I'm using Mint, in case that brings up any IDE issues.
-
Python @lemmy.ml slyuser @lemmy.ml Coding a Python Program for Mm to Inches Conversion
Developed a script to perform mm to inches conversions, which was conveniently transformed into a web app using Streamlit.
-
Python @lemmy.ml Arthur Besse @lemmy.ml CPython PR merged yesterday: Allow disabling the GIL with
PYTHON_GIL=0
or-X gil=0
by swtaarrs · Pull Request #116338 (part of PEP 703)github.com gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpythonIn free-threaded builds, running with PYTHON_GIL=0 or -X gil=0 will now disable the GIL. #116322 and #116329 track follow-up work to re-enable the GIL when loading an incompatible extension, and to...
-
Python @lemmy.ml xiffu @kbin.social Lets create a short tutorial on how to connect, create a table and insert data in SQlite with Python
www.chat-to.dev Chat Rooms and Programming Content | Chat-to.devJoin chat rooms and explore programming content on Chat-to.dev.
-
Python @lemmy.ml ylai @lemmy.ml www.theregister.com Pope tempted by Python! Signs off on coding scheme for kidsIn the name of the firewall, the server, and the home page default, amen