pizzatorque, to python
@pizzatorque@emacs.ch avatar

Stream starting! Let's implement commits from scratch in https://twitch.tv/pizzatorque

ramikrispin, to machinelearning
@ramikrispin@mstdn.social avatar

(1/2) New release for skforecast 🎉

Version 0.12.0 of the skforecast Python library for time series forecasting with regression models was released this week. The release includes new features, updates for existing ones, and bug fixes. 🧵👇🏼

image/png
image/png

oliverandrich, to python
@oliverandrich@fosstodon.org avatar

Perfect, the combination of playwright, trafilatura and scrapinghub extracts all the information I need from a webpage. My little #python project evolves nicely.

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

🔍 The other day I learned via @pythonbytes that you can also write decorators using classes! 💡

Check out the basic comparison below:

• Function-based: keeps it simple. 🛠️
• Class-based: scalable for more complex needs. 📈

Ever used class-based decorators? How?

oliverandrich, to python
@oliverandrich@fosstodon.org avatar

Is there a better approach to scraping a SPA in than to use ?

Edent, to python
@Edent@mastodon.social avatar

🆕 blog! “Untappd to Mastodon - Updated!”

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying. First up, you'll need a file called config.py to hold all your API keys: instance = "https://mastodon.social" access_token = "…" write_access_token = "…" untappd_client_id = "…" untappd_cli…

👀 Read more: https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

blog, to Untappd
@blog@shkspr.mobi avatar

Untappd to Mastodon - Updated!
https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying.

First up, you'll need a file called config.py to hold all your API keys:

instance = "https://mastodon.social"access_token          = "…"write_access_token    = "…"untappd_client_id     = "…"untappd_client_secret = "…"

Then a file called untappd2mastodon.py to do the job of grabbing your data, finding your latest check-in, then posting it to the Fediverse:

#!/usr/bin/env python# -*- coding: utf-8 -*-from mastodon import Mastodonimport jsonimport requestsimport config#  Set up accessmastodon = Mastodon( api_base_url=config.instance, access_token=config.write_access_token )#       Untappd APIuntappd_api_url = 'https://api.untappd.com/v4/user/checkins/edent?client_id=' + config.untappd_client_id + '&client_secret='+ config.untappd_client_secretr = requests.get(untappd_api_url)untappd_data = r.json()#       Latest checkin objectcheckin = untappd_data["response"]["checkins"]["items"][0]untappd_id = checkin["checkin_id"]#       Was this ID the last one we saw?check_file = open("untappd_last", "r")last_id = int( check_file.read() )print("Found " + str(last_id) )check_file.close()if (last_id != untappd_id ) :        print("Found new checkin")        check_file = open("untappd_last", "w")        check_file.write( str(untappd_id) )        check_file.close()        #       Start creating the message        message = ""        if "checkin_comment" in checkin :                message += checkin["checkin_comment"]        if "beer" in checkin :                message += "nDrinking: " + checkin["beer"]["beer_name"]        if "brewery" in checkin :                message += "nBy: "       + checkin["brewery"]["brewery_name"]        if "venue" in checkin :                if "venue_name" in checkin["venue"] :                        message += "nAt: "       + checkin["venue"]["venue_name"]        #       Scores etc        untappd_checkin_url = "https://untappd.com/user/edent/checkin/" + str(untappd_id)        untappd_rating      = checkin["rating_score"]        untappd_score       = "🍺" * int(untappd_rating)        message += "n" +  untappd_score + "n" + untappd_checkin_url + "n" + "#untappd"        #       Get Image        if checkin["media"]["count"] > 0 :                photo_url = checkin["media"]["items"][0]["photo"]["photo_img_lg"]                download = requests.get(photo_url)                with open("untappd.tmp", 'wb') as temp_file:                        temp_file.write(download.content)                media = mastodon.media_post("untappd.tmp", description="A photo of some beer.")                mastodon.status_post(status = message, media_ids=media, idempotency_key = str(untappd_id))        else:                   #       Post to Mastodon. Use idempotency just in case something went wrong                mastodon.status_post(status = message, idempotency_key = str(untappd_id))else :        print("No new checkin")

You can treat this code as being MIT licenced if that makes you happy.

https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

oliverandrich, to django
@oliverandrich@fosstodon.org avatar
oliver, to django German
@oliver@2pxnl.de avatar
MrBerard, to python
@MrBerard@pilote.me avatar

BeeTeeDubs, I'm going live in ten with a Tutorial drawing flags with turtle graphics.

Really it's about abstraction and decomposition.
@edutooters

Live Coding: Drawing flags with
https://youtube.com/live/LLiHSBzxNBE?si=4qSVSJXe7pkMgT9z

leonid, to python German
@leonid@norden.social avatar

djangoproject.com is down :omya_python:

ljegou, to ai
@ljegou@vis.social avatar

Data-to-paper framework

data-to-paper is a framework for systematically navigating the power of to perform complete end-to-end with

https://github.com/Technion-Kishony-lab/data-to-paper

SebastianM6L, to django
@SebastianM6L@mastodon.social avatar

Any cracks here who can explain me why when I run my tests with the django built in manage.py test (runs unittest) I have 51 tests run.

When I run them with pytest It will only run 38 tests.

henryiii, to python
@henryiii@fosstodon.org avatar

I've just released cibuildwheel 2.18.0, with prerelease support for CPython 3.13 - set CIBW_PRERELEASE_PYTHONS to test building 3.13 wheels! (No free-threading yet, waiting on binaries & pip) https://github.com/pypa/cibuildwheel/releases/tag/v2.18.0 #python #release

leanpub, to devops
@leanpub@mastodon.social avatar

Learn Kubernetes & Docker - .NET Core, Java, Node.JS, PHP or Python by Arnaud Weil is free with a Leanpub Reader membership! Or you can buy it for $11.99! http://leanpub.com/k8s

vic, to python
@vic@howcyborgs.chat avatar
ramikrispin, to Excel
@ramikrispin@mstdn.social avatar

(1/2) I have been following the work of @stevensanderson and David Kum for a few years now, and I am excited to see the release of their new book 🥳- Extending Excel with Python and R 🚀.

The book focuses on the common conjunction and collaboration between data scientists and Excel users. This includes scaling and automating tasks with and and core data science applications such as data wrangling, working with APIs, data visualization, and modeling.

pizzatorque, to python
@pizzatorque@emacs.ch avatar

Streaming git from scratch in , come hang out! https://www.twitch.tv/PizzaTorque?sr=a

villares, to python Portuguese
@villares@ciberlandia.pt avatar
mblayman, to python
@mblayman@mastodon.social avatar

At #Python Frederick, Chris Malec gave a cool overview talk on Pandas. Want to see how GME looked on the market during the "Gamestonk" week? Chris showed us some interesting financial analysis. https://www.youtube.com/watch?v=uFP-W_9UtfQ

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Streamline your test data generation in #Python with Faker 💡 🎉

Here's a quick snippet to create realistic user profiles with matching names and emails.

Enhance your testing with data that feels real. 🐍🔧📈

ffissore, to python
@ffissore@hachyderm.io avatar

I won’t be able to go to @pycon. If you need tickets, I’m happy to sell you mine #python #pycon

hamub, to fediverse
@hamub@fosstodon.org avatar

Hey friends on the !
It's been 6 years since our last, beloved PyCon Zimbabwe took place. brought us together. It was a time for connecting, sharing, & learning. Now, after years of silence, it's coming back!
We're a community-driven event, & like before we need your help to make it a success. We're calling on all of you to join us in this endeavor. Whether you can offer your time, resources, or just a share on your networks, every bit counts!

hynek, to python
@hynek@mastodon.social avatar

Come for wisdom on tox & Nox – stay for unrelated gems that will improve your life! #python #video

https://youtu.be/ImBvrDvK-1U https://mastodon.social/@treyhunner/112419178337248517

carmenbianca, to python
@carmenbianca@todon.eu avatar

i want to create a module but i need a 🦆

problem: sometimes i write a program that can be configured with json/yaml/toml/whatever. but i hate dealing with raw dictionaries and validating the data myself (or checking whether ["my"]["deep"]["key"] exists before accessing it). creating my own Config class to do that stuff for me is boring and repetitive.

what i want to do is this:

class MyConfig:
foo: str
bar: int

my_config = MyConfig.from_dict({"foo": "hello", " bar": 1})

... and have that be validated, ready to go, with convenience functions and everything. if a type doesn't match, raise an error. (also, some more validators like selections, or 'value matches regex'.)

i know attrs can do something like that, but the attributes are stored on the object instead of in an internal dict, and it's not a perfect match. pydantic has BaseSettings, but pydantic is so thoroughly overengineered that i don't want it.

but when i sit down to think about writing a module to do what i want, i realise i'm just reimplementing attrs, but lighter, without attributes stored on the object, and with certain convenience functions.

ought i just build my module on top of attrs, somehow? does my dream module already exist?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • tester
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • hgfsjryuu7
  • mdbf
  • vwfavf
  • kavyap
  • tsrsr
  • ngwrru68w68
  • PowerRangers
  • DreamBathrooms
  • Leos
  • everett
  • Durango
  • osvaldo12
  • khanakhh
  • ethstaker
  • rosin
  • cubers
  • tacticalgear
  • GTA5RPClips
  • normalnudes
  • cisconetworking
  • modclub
  • anitta
  • All magazines