#python-discussion

1 messages · Page 347 of 1

golden mortar
#

It was decided that we would try it out, but I'm definitely going to vote for getting rid of them again.

warped lotus
#

😆

true flax
#

Hi

dry pike
inland karma
#

no, missbehaviour gets you banned

#

as our rules clearly states

velvet trout
#
@dataclass(slots=True)
class ParseContext:
    command: Command
    namespace: Namespace
    token_stream: TokenStream
    end_of_options: bool = False
    operand_index: int = 0

Okay so this class is used when we call parse_arguments() function, the function creates and uses this object and passes to other functions who need the context to work. It is mutated by both others functions and a while loop as we parse arguments.

I was wondering if I should use ParseContext or ParsingContext as a class name? pithink ducky_concerned

Are -ing in class names a recommended convention?

solemn rain
#

PC

velvet trout
#

Pythonic Computer

solemn rain
#

Program Counter

inland karma
#

sp ParseContext

dry pike
#

what

velvet trout
#

EnglishErrorForMe

dry pike
#

imperative speech?

inland karma
#

ermm.. trying to live translate 😄

dry pike
inland karma
#

yes, like Go West instead of Going West

final acorn
#

@inland karma Are you the server manager?

inland karma
#

i do manage servers in my basement and at work

velvet trout
#

pithink good point, although using CapWords convention do helps defferentiating

inland karma
#

but i would say im a programmer

final acorn
#

okk

inland karma
velvet trout
warped lotus
dry pike
#

PascalCase

#

camelCase

golden mortar
velvet trout
#

No no

#

That camel has first word small

dry pike
#

snek_kes

sacred cypress
#

oh reactions got enabled in this channel?

pseudo coyote
#

I don’t know what it stands for

solemn rain
inland karma
velvet trout
inland karma
#

a programmer just builds the software

grave wedge
pseudo coyote
inland karma
#

now, i am the fformer, i work as a devloper

#

but i see myself as a programmer, because that is what i find to be fun and interesting

inland karma
solemn rain
inland karma
#

it is more offten a hinderance to your learning

pseudo coyote
#

How does that help with backtracking?

solemn rain
#

Fibonacci is an example for DP

inland karma
#

the best way to learn programming is to read, write and do the work yourself

solemn rain
#

style

grave wedge
quartz fulcrum
#
def commas(name_of_list):
    customized_string = []
    adding = 'and'
    last_word = name_of_list[-1]
    first_part = name_of_list[0:-2]
    for i in first_part:
        customized_string.append(i)
    customized_string.append(adding)
    customized_string.append(last_word)
    return ','.join(customized_string[0:-1])

print(commas(['ajay','lodhi']))``` what is wrong here
sacred cypress
velvet trout
solemn rain
velvet trout
#

Isn't this vegetable 🍆 called bringle in English?

solemn rain
#

sudoku problem is not solvable in polynomial time

dry pike
#

eggplant

inland karma
# grave wedge yes sir

as long as you do the work yourself, you will be alright, but stay away from poor sources, like youtube and AI

grave wedge
#

its also aubergine

dry pike
#

or aubergine I think EDIT: yes as the guy above said

inland karma
velvet trout
inland karma
#

a junior developer is more a programmer and a developer in training

velvet trout
#

What am i doing right now?

inland karma
grave wedge
#

@inland karma where have u been a developer btw if you dont mind me asking?, kind of interested

grave wedge
#

yes*

inland karma
#

well.. you have never heard about them

#

just insert company name here

inland karma
#

unless your norwwwegian

solemn rain
#

So much experience

inland karma
grave wedge
karmic eagle
#

Im learning python recursion

grave wedge
solemn rain
inland karma
#

yeah, decades fly past me

grave wedge
karmic eagle
#

How much day i should put in learning or practice it

solemn rain
karmic eagle
#

In recursion

inland karma
solemn rain
grave wedge
inland karma
# karmic eagle In recursion

recursion is tricky to learn, as it all happends in your head, its one off those things that you get after some effort

velvet trout
# inland karma are you doing software design and architecture?

What's that lol. I am currently making cliargparser (i read argparse, google searched things, talked with AI about naming stuff and creating a philosophy for deterministic, zero-ambiguous parsing of cl arguments (since argparse is more of arguments focused than definitive parameters and introduces ambiguity sometimes))

So what am i?

inland karma
#

i have thought recursion in 30 minutes, and they got it, and i have failed after days of trying

karmic eagle
#

Please someone help me how should I learn python

#

Recursiion how much time I should put in

inland karma
inland karma
karmic eagle
#

I usually practice for days on similar topics like data structurea

solemn rain
#

To estimate it

dry pike
karmic eagle
#

Don't say until u understand it @velvet trout

inland karma
karmic eagle
#

Till recursion

#

In 2 months

inland karma
karmic eagle
#

I usually practice every topic in depth

#

Until i master it flow

solemn rain
velvet trout
#

Did i say something wrong? ducky_concerned

karmic eagle
#

No

#

No leet code

solemn rain
#

Ok

dry pike
#

"until recursion" is meaningless unless we know a specific course you have followed

karmic eagle
#

@velvet trout no

pseudo coyote
#

I swear to god backtracking is so frustrating

solemn rain
inland karma
solemn rain
#

You know dfs?

pseudo coyote
#

No

karmic eagle
#

No course only self learning topic by topic@dry pike

inland karma
#

so why are you trying to do backtracking now?

#

you have to learn dp first

karmic eagle
#

No one helps

dry pike
inland karma
#

backtracking is just another variant of dynamic programming

pseudo coyote
inland karma
#

you already have to know dp first

karmic eagle
#

Yes i learn things in order

inland karma
grave wedge
pseudo coyote
#

How do I learn dp

grave wedge
#

it would be better to explain then

karmic eagle
#

Chatgpt youtube Indian tutorial 10hr

inland karma
#

do you know that?

karmic eagle
#

Practicing each topic in depth

pseudo coyote
#

I know what it is

velvet trout
#

Why 10hr is it that hard or big

grave wedge
#

could u drop the link to the course, i bet lots of people here probs know it

inland karma
#

then you should learn it

karmic eagle
#

Search on yt CWH python course

pseudo coyote
#

Recursion is basically a function calling itself right?

grave wedge
#

anyone know that one?

karmic eagle
#

Yes

pseudo coyote
#

Or is it something else

karmic eagle
#

How much time i should learn it

inland karma
solemn rain
karmic eagle
#

Yesss

pseudo coyote
inland karma
#

yeah, once you really know dp, the explaination off backtracking makes the implementation self evident

quartz fulcrum
#

@inland karma

inland karma
#

yeah

solemn rain
quartz fulcrum
#
def commas(name_of_list):
    customized_string = []
    adding = 'and'
    last_word = name_of_list[-1]
    first_part = name_of_list[0:-2]
    for i in range(len(name_of_list) - 1):
        customized_string.append(name_of_list[i])
    customized_string.append(adding)
    customized_string.append(last_word)
    return ','.join(customized_string)

print(commas(['ajay','lodhi']))```
i used debugger to do this...but still one error is there
solemn rain
#

You start with divide and conquer then greedy like dfs then dp then backtracking

grave wedge
#

try this: def commas(name_of_list):
if len(name_of_list) == 1:
return name_of_list[0]
return ', '.join(name_of_list[:-1]) + ' and ' + name_of_list[-1]

print(commas(['ajay','lodhi']))

#

@quartz fulcrum

quartz fulcrum
#

ajay,and,lodhi prints this

solemn rain
#

Name exposed

quartz fulcrum
#

i dont want two commas

quartz fulcrum
#

this is our hub

inland karma
grave wedge
#

this line is issue wizard: return ','.join(customized_string)

quartz fulcrum
inland karma
grave wedge
#

and u never used this: first_part = name_of_list[0:-2]

inland karma
#

how do you add commas?

quartz fulcrum
#

oh, it is because of join

grave wedge
inland karma
#

yes, its because you add the commas everywhere

quartz fulcrum
#

what should i do then

grave wedge
inland karma
#

only add commas where you need them

grave wedge
#

def commas(name_of_list):
if len(name_of_list) == 1:
return name_of_list[0]
return ', '.join(name_of_list[:-1]) + ' and ' + name_of_list[-1]

print(commas(['ajay','lodhi']))

edgy krakenBOT
#

Hey @grave wedge!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
quartz fulcrum
#

i shld ve thought about it

pseudo coyote
#

When is Len even useful?

quartz fulcrum
#

but didnt click

pseudo coyote
#

It seems so useless but I see it so much

inland karma
grave wedge
pseudo coyote
#

I know, but when does that actually come up

pallid garden
#

suppose you have a bunch of users

inland karma
#

when else?

pallid garden
#

and they send in some requests

#

you put the requests in a list

quartz fulcrum
pallid garden
#

and then you use len to find out how many requests you received

#

does that make sense?

inland karma
#
print(f'Your password is {len(password)} long')
quartz fulcrum
iron sable
#

Guys what project should i know basics but my function knowledge is kinda cooked

pseudo coyote
#

Thanks

#

That’s actually the perfect example

inland karma
iron sable
pseudo coyote
#

Yh

inland karma
iron sable
iron sable
iron sable
keen fox
inland karma
iron sable
grave wedge
#

make a bank entrance program which uses a wide variety of variables

keen fox
iron sable
iron sable
#

Im not sure

keen fox
pallid garden
solemn rain
inland karma
iron sable
#

454000

keen fox
#

i mean what do you think

keen fox
keen fox
pallid garden
#

oh my bad

iron sable
#

454000*

keen fox
solemn rain
keen fox
iron sable
pallid garden
solemn rain
iron sable
inland karma
#

well, integers have no length, length does not make sense

keen fox
grave wedge
#

@iron sable maybe a Grocery Store Bill Calculator

inland karma
#

because, in what base is the integer

iron sable
#

Or i dont understand the question cause my first language is russian

velvet trout
#

How cool would it be if i override the built-in data type's __len__ dunder from CPython source code and install it on all my college computers ducky_skull

solemn rain
iron sable
inland karma
keen fox
iron sable
velvet trout
pallid garden
#

just say you dont know if you dont know the answer

solemn rain
#

randomized search algorithm enters

pallid garden
#

it's ok to not know something

inland karma
quartz fulcrum
inland karma
#

none of the builtins let you do that

iron sable
inland karma
#

so you would have to change the C source, build python again, and then you can

pallid garden
velvet trout
thorn mist
#

whys the server profile looks like a clown

keen fox
solemn rain
inland karma
solemn rain
#

That is overriding?

velvet trout
#

Wonder if it will even install or initialize the interpreter if i do that lol

inland karma
velvet trout
#

🥰

quartz fulcrum
inland karma
# solemn rain That is overriding?

you can change the name off a function, you cant change the behaviour if the source is immutable. you can however make your own object and implemnt your own __len__

inland karma
grave wedge
#

can python be used for quantitative analysis?

#

or quant trading

solemn rain
#

Or inherit string and override

velvet trout
# solemn rain Why

Because they made me learn stuff which is Offtopic to my core stream subjects + teaching 8085 assembly microprocess (i am not interested tbh, i wanna learn something like C (low) or python (high)) + made me write code on white paper instead on an IDE + their education/teaching methods sucks, its rote learning/marks based.

So taking my revenge ducky_concerned

quartz fulcrum
velvet trout
#

Also included one of the regional/commonly spoken human language in IT/CS streams. I was like, what— why should i care about language over computer languages.

inland karma
#

and continue to do that

velvet trout
quartz fulcrum
velvet trout
solemn rain
#

But not languages

#

Like regional ones

solemn rain
#

CS

frigid coral
#

heyy anyone learning backend framework??

wintry tendon
velvet trout
# solemn rain But not languages

Wanna know? This was a newly implemented Education policy. Imagine being this dumb that you kill stream subjects by adding additional off topic and unrelated fluff.

#

imma continue making evil plans using my little programming language pithink

quartz fulcrum
velvet trout
#

Fight for your right

silver plover
solemn rain
frigid coral
silver plover
quartz fulcrum
frigid coral
inland karma
quartz fulcrum
#

oh fine

inland karma
#

the tutorial meantioned above is a great place to start

frigid coral
#

ok there own docs??

solemn rain
quartz fulcrum
velvet trout
silver plover
velvet trout
solemn rain
#

I think now a days especially in web dev people are first choosing tech then making projects with the tech

In old days first problem might be solved and tech were used as tools

#

To solve the problem

#

i am part of modern day dev

silver plover
#

My companies have been burned by decisions. My last company went through 4 web frameworks in 10 years

pallid garden
#

i feel like authentik is overkill for my use case @inland karma

inland karma
#

its an overkill for me aswell... but it wasnice to test out

pallid garden
#

heh

inland karma
#

i just wanted a mock server

pallid garden
#

right right

solemn rain
#

I am planning to buy raspberry Pi

#

Planning for too long now

grave wedge
inland karma
#

its sensible to have a small computer if you need one

grave wedge
deft raptor
#

he looks like the spinning cat

solemn rain
solemn rain
deft raptor
#

duck

velvet trout
charred tusk
#

It is rather spherical

solemn rain
#

Looks like a fish

velvet trout
#

Ball fish

solemn rain
#

Puffer fish

velvet trout
#

Fisher puff

compact horizon
#

What's up guys

unkempt sage
#

does anyone know a good guide for python asyncio?

#

from basics to advanced

inland karma
#

python docs andrealpython is also good

velvet trout
#

Wait BBC news channel also teach Python? ducky_concerned

unkempt sage
#

lol

#

ok thanks a lot guys

stiff saddle
#

yeah lol

#

yes

crisp jay
#

In my country this is expensive as shit

wintry tendon
#

Btw guys why does python use snake case

naive ermine
#

pretty easy to read

craggy trench
#

underscores look like proper spaces

wintry tendon
#

🤔

craggy trench
#

python still uses PascalCase for classes and unseparated lowercase for many stdlib modules though

wintry tendon
#

Pascal and camel case look good

silver plover
naive ermine
#

I don't like the look of Pascal or camel case

craggy trench
#

i like how PascalCase distinguishes classes from functions and normal instances

naive ermine
#

Agreed, its a nice distinction

wintry tendon
#

C++ also has snake case in its std lib, hard to read

velvet trout
naive ermine
#

this_reads_better_to_me vs ThisReadsBetterToMe

velvet trout
#

🐍

wintry tendon
velvet trout
#

"sometimes"? ducky_concerned

wintry tendon
#

Snake case looks good only on long names

shrewd pine
#

I imagine there is a sliding scale when divulging AI usage is required/appropriate

lofty sable
shrewd pine
vale plume
#

ehats the occasion for the new banner? looks sick

velvet trout
vale plume
shrewd pine
quick compass
#

Hello

I am trying to write a program which takes a linkendin address and returns everything in the js page. But the bot detection keeps stopping my code. How can I bypass it?

ocean ridge
quick compass
ocean ridge
quick compass
#

I only came across playwright, which is paid.

ocean ridge
#

um do u know whats api

runic flower
quick compass
#

something that acts as a communicator between two programs?

#

ah. sorry mb, Its proxycurl. not playwright.

edgy krakenBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

golden mortar
#

Bypassing the anti-botting measures of Linkedin would definitely violate their ToS

quick compass
#

I didn't know that. But it can be done using proxycurl api. how so?

golden mortar
#

I. e., we can't give you any information about that type of project.

#

As a side note, it seems like Proxycurl was shut down in 2025 following a lawsuit. From Linkedin, for not following their ToS.

runic flower
golden mortar
#

Isn't it?

quick compass
#

I got it as a work project. What am I supposed to do now. 😐

runic flower
tribal drum
#

Hi all , I have been working on extensive doj parser and research pipeline in nativelab for parsing Epstein case files and segregate them as per timing event sequence missing sequence and hypothesis generation , for this currently m choosing , multi context pdf chunk reasoning with back context support , based on continuation keywords and event consolidation , any other technique for retrieval of large files without loading all in context with maximum back context would be helpful. Also needed help on image identification models for low quality images , if any .

warped lotus
#

the name of a parser

#

made me excited

golden mortar
golden mortar
#

If they literally want you to steal data through scraping, then sorry, your employer is pretty shady and we just can't help with that.

golden mortar
dry pike
#

Epicure? they made a statue of the CEO of the seasonings and dips company?

quick compass
golden mortar
quick compass
golden mortar
golden mortar
# quick compass Bot.txt?

robots.txt is the filename used for implementing the Robots Exclusion Protocol, a standard used by websites to indicate to visiting web crawlers and other web robots which portions of the website they are allowed to visit.
The standard, developed in 1994, relies on voluntary compliance. Malicious bots can use the file as a directory of which pag...

tribal drum
# quick compass Bot.txt?

Yeah each site manages a bot,txt for bots to state terms of crawling and limitations or to deny crawling before scraping any site you must make sure your model complies with bot.txt

#

Yeah robots.txt

golden mortar
#

But even if they permit stuff like that, they virtually never permit you to just scrape a bunch of raw data off of them for free

runic flower
#

I'm using a simple one:
User-agent: *
Disallow: /*
Allow: /

But I also have more rules against bots implemented as cloudflare rules.

quick compass
#

Ah, I was told to store everything on the domain to a json file. Including the redirects, image names etc. Which thanks to you now I know is illegal.

tribal drum
pallid garden
#

nevermind the legality

golden mortar
pallid garden
#

the format is questionable

tribal drum
pallid garden
#

who stores things on a website to a json

tribal drum
pallid garden
#

yea but that doesnt stop me from questioning their engineering decision

tribal drum
golden mortar
#

I mean, if I'm just experimenting with a new feature, I might just dump data in whatever way

golden mortar
#

You don't gotta architect everything upfront

pallid garden
#

surely you would just dump the files into a directory

golden mortar
quick compass
#

Not really my place to question in what format they need as an output. Besides, why is it so wrong? I always get my outputs in json format.

pallid garden
#

a website consists of multiple files, some of which would be image files, which are binary files, which is weird to store in json

tribal drum
quick compass
#

Oh. Well, I wasnt told to get the images par se. Just the names?

tribal drum
#

Also json is one of most easily supported library for python and other frameworks

pallid garden
#

json is not a library...

golden mortar
pallid garden
#

eh whatever it's against TOS

tribal drum
compact token
#

A there a python tutorial here

hidden laurel
#

is it possible to get python syntax in VScode WITHOUT access to internet?

hidden laurel
tribal drum
hidden laurel
#

i can use a USB pendrive, but not administrator perms

tribal drum
#

Ohk , download extension file from GitHub install using file

undone grove
#

hi

pallid garden
# tribal drum import json

json is a format, python's standard library merely provides a convenient way to parse and serialize objects to that format

pallid garden
#

it's not like a python creation/thing

#

is what im saying

hidden laurel
tribal drum
hidden laurel
velvet trout
#

Is namedtuple recommended for a tuple of size 2 and you do not want to remember indexes (although easy to remember but still) ?

I do not want to create a full-fledged class for this short thing. ducky_concerned

#

i think i am beginning to find good use cases of using namedtuple? pithink ducky_concerned

tribal drum
#

Replace with ur filename

undone grove
#

what is the bitwise operator

celest osprey
tribal drum
cyan scaffold
golden mortar
#

@tribal drum I think their point is that you can't download things if you have no internet.

tribal drum
#

K guys if anywant wants help dm me, m going off now

cyan scaffold
#

There must be a tutorial somewhere on installing Visual Studio Code extensions from a file

dry yacht
tribal drum
runic flower
velvet trout
pallid garden
#

@inland karma i just realized that i mixed up bearer token and access token, which are 2 separate things

EDIT: nevermind, apparently bearer is a type of access token

velvet trout
#

I know the essence of dataclasses but I couldn't provide a formal proper explanation.

cyan scaffold
#

I think they allow accessing via index like normally, just that they also allow accessing via attributes

dry yacht
velvet trout
#

I am pretty new too, to namedtuple

cyan scaffold
#

Same I don't use them

runic flower
#

One thing to keep in mind: namedtuples, are tuples, so the values are immuatable

ocean ridge
#

hey. Who is interested in game dev but game dev feels to complex / hard so you dont learn it??

runic flower
ocean ridge
cyan scaffold
velvet trout
#

That's based on my experience. No idea if there's a detailed list or recommend good practices about when to use them vs when not.

dry yacht
velvet trout
#

It's just a slightly advanced tuple, and i like that about it

velvet trout
runic flower
velvet trout
golden mortar
prime sorrel
#

so about this shift key...

ocean ridge
# golden mortar That's why I got into programming in the first place

Personally i ahve faced a lot of issues with multiplayer in godot. I just feel like its easier to do certain parts in threejs but setting up camera, llighting all that in threejs is hell. So i was thinking maybe my own game engine for creating web / mobile / desktop games with javascript as scripting language

golden mortar
#

If you are struggling with camera and lighting, don't do a multiplayer game.

ocean ridge
golden mortar
#

Do simpler games to start with and work your way up.

ocean ridge
golden mortar
#

So you don't need to learn everything at once.

ocean ridge
#

Just that lighting and camera setup is hard in threejs compared to godot due to lack of ui for game editor

#

and godot's multiplayer is hell.

#

I mean its easier than unity / unreal but its really hard compared to syncing things easily by js

#

I was thinking maybe a game engine Ui on top of babylon with ui similar to godot and js as scripting lang

golden mortar
#

It feels like a common pattern for aspiring gamedevs to spend all their time developing game engines instead of games.

ocean ridge
golden mortar
ocean ridge
#

I dont know if its going to benefit a lot of ppl tho. thats why im asking before starting the projet

pallid garden
#

ot0

golden mortar
#

Mispaste

pallid garden
#

basically dont trust microslop

ocean ridge
ocean ridge
golden mortar
#

It's your choice.

#

I'd rather make an actual game myself, even if I have to make compromises with my tooling sometimes.

pastel sluice
#

For perspective I've been writing my own 3D FPS game in Python, and it's challenging, but I appreciate how dirty I'm getting my hands

ocean ridge
#

I mean if it helps a lot of ppl if done correctly why not give a try

pastel sluice
#

If you see an instance of something you want to try yourself, absolutely give it a shot, and by all means stand on the shoulders of giants

pallid garden
#

stand on the shoulders of gAInts?

dire shale
#

New hotkey discovered!

#

In PyCharm, place your key on a line

#

Hit command + up-arrow, it'll move the whole line up one!

pastel sluice
tropic temple
pallid garden
pastel sluice
dire shale
#

Hey, AI is a useful tool

#

If used correctly

pastel sluice
#

It's useful when it is being applied in a highly narrow, specific, refined way, and the vast majority of how we currently use it does not fit these criteria

#

It's being sold as the Everything Machine, when it should be the This One Very Specific And Narrowly Defined Thing Machine

dire shale
#

I take this stance: AI can only ever reflect for own expertise back at you. For now anyway. It can't do anything you can't do, and you've got to be wary of it's pitfalls

craggy trench
#

the thneed

dire shale
#

But if used by an expert in a field, it can make a huge difference in both the amount of legwork you have to do, and the quality of your work

charred tusk
pallid garden
#

yea it just so happens that the things that I do are not mainstream enough yet for LLMs to be able to handle them

dire shale
#

RIP

hallow schooner
#

i use arch btw

dire shale
#

💀

pastel sluice
pallid garden
#

it's almost as if experts in the field are doing things that LLMs cant

#

/jk im not an expert

dire shale
#

_>

prime sorrel
#

@inland karma thanks for attempting a solution to the programming problem after i left. alas, I did try it (read it all sadly) and it wasn't quite what I was looking for. I am up for the help channel thing alas, I must confess, I don't know how it works on discord.

dire shale
#

In a year, I've given myself a solid understanding of ML. It took a lot of work and there's still a long way to go. But I could never have gotten this far without ChatGPT to work through it with me

pastel sluice
#

I don't know about never but it's good you were able to get constructive use out of it.

dire shale
#

And this project I'm working on? A programming language - an executable graph based ontology of the MtG universe, with bytecode interpreter and other bells and whistles? Again, AI has been invaluable

charred tusk
#

oh yeah you're that guy

dire shale
#

I prefer to think of the AI not as a separate thing, but as myself as a cyborg. As with any skill, I have to take care to maintain best practice. I can't just throw a problem at an LLM and expect a solution

#

But I'm so, so tired of people complaining about AI, it being evil, it being useless

#

If it isn't helping you, you're using it wrong

charred tusk
robust ledge
inland karma
inland karma
pallid garden
pastel sluice
#

Most of the complaints about it being evil and useless and so on are not unfounded, for the same reason that complaints about coal mining being dirty and environmentally devastating are not unfounded (even though you can make an argument its energy was how we kickstarted the industrial revolution). People are not happy about these things for good reasons, and we're only going to get good things out of them by being skeptical, not hagiographic

pallid garden
#

still reading docs

inland karma
#

many confusions are connected to understanding what things really are, and HTTP is the same way. HTTP is just sharing text with each other

#

some text has meaning, like 400 and GET

#

but another thing that has meaning is Bearer

pallid garden
#

go on?

inland karma
#

so wwhen you use GET you know that this is a http verb for getting data

dire shale
inland karma
#

when you use Bearer you already know that the next piece of data is a auth token

pallid garden
#

mhmm

inland karma
#

and all the tools we use are just abstraction on top of just sharing text messages back and forth

#

authentication has a predetermied methods for how many times text is shared back and forth, and what those text messages must contain

pastel sluice
#

A general question: if you are writing a Python package, and you have elements in it that are not themselves Python files (text or image resources), what's a best practice way to handle those things as part of the package?

dire shale
#

But its getting really old for me listening to people - not really smart coders like on here - but people who genuinely have no idea what they're talking about complaining about the technology that I use every day. And more than that, complaining about the people who the technology

pallid garden
inland karma
#

and we connect words on top of this to explain more in detail, but HTTP is simple in nature. and AUTH is simple as well, it has multiple simple steps

inland karma
pastel sluice
pallid garden
#

yea, the spec is like 20 pages long

#

which i mean... sure

#

but like

#

it's 20 pages

inland karma
#

and the part you use, maybe JWT, is only a few pages

pallid garden
#

is it?

#

hold on

charred tusk
#

As someone who's been a solo dev my entire life, having something that can respond immediately whenever I want has been enormously appreciated
Its given me multiple "why don't you just..." suggestions that have halved some of my scripts

But I spent Tuesday trying to get it to write a feature and it fell of the rails practically immediately, it got stuck in a loop with itself because I renamed a bunch of stuff and it couldn't decide whether to ask me to use the new names or the old names

It takes skill to "prompt engineer" and get the context explicit enough for the AI to be able to "stay focused"
And the time it takes to do that is commonly longer than the time it would have taken for me to just spit out the code myself

inland karma
#

i dont remember, been ages since i read it

#

the point im making, is, its simple, the abstraction on top might make it harder to use or understand

robust ledge
runic wharf
#

Hello

dire shale
pallid garden
charred tusk
inland karma
#

so when you are working with authentication, details matter. and when you know which part you are using, follow the rules lied out in the spec, and/or your auth library/provider docs

dire shale
#

Fuck yeah. I know it's a rich ecosystem, but like a simp I just went for the most familar name when I started using AI, and ChatGPT has never done me wrong

inland karma
#

if you have curl installed, you can do everything from the terminal

dire shale
#

Not really, anyway

inland karma
#

no fancy python auth lib needed

pallid garden
#

in this case i am the provider

#

which is the problem

#

before this ive only used oauth to authenticate

inland karma
#

and you have to follow the spec the client expect. thats the OAuth2 spec (if your using oauth2)

pallid garden
#

not implement it myself

pastel sluice
pallid garden
inland karma
#

the client side, thats authlib

pallid garden
inland karma
#

!pypi authlib

edgy krakenBOT
#

The ultimate Python library in building OAuth and OpenID Connect servers and clients.

Released on <t:1772437441:D>.

charred tusk
#

I hate that thing

pallid garden
#

hmm usually i use the provider's own api client

charred tusk
#

Do they support SQLA 2.0 yet?

pallid garden
#

like e.g. i use the gcp api client instead of authlib to connect to google drive

robust ledge
#

They're all doing the same Oauth2 handshake. Just different baked in parameters.

charred tusk
#

Yeah half the time I just end up doing it manually

robust ledge
#

Roll your own OAuth2 handshake once. It's interesting how simple the flow actually is. Demystifies is.

pallid garden
#

roll your own oauth provider meanwhile...

robust ledge
charred tusk
inland karma
pallid garden
inland karma
#

thats why i think every engeneer should raw dog their own http server

charred tusk
#

what dog? 🐕‍🦺

robust ledge
charred tusk
robust ledge
inland karma
#

oh yes. same with anything that is protocol based

#

i made a mc server by hand. also demystified a lot

pallid garden
#

the "understanding what it really is" is actually not that problematic

#

it's the standardized implementation

dire shale
pallid garden
#

that is the difficult part

charred tusk
#

@robust ledge have you done your own OAuth provider?
I did it myself after getting angry at how terrible Authlib was
It only supports Client Credentials at the moment, but thats all I need to implement myself, interactive auth will go through Microsoft's massive SSO ecosystem

pallid garden
#

this might just be for experimentation, but i still want to make it realistic from the client side

dire shale
#

And you know, that's a great suggestion. I... struggle... with servers. Building one from scratch would probably be a good exercise

shrewd pine
pallid garden
charred tusk
charred tusk
inland karma
pallid garden
golden mortar
pallid garden
robust ledge
shrewd pine
charred tusk
inland karma
#

or if you use django

edgy krakenBOT
#

src/manageorders_sdk/client.py lines 27 to 40

def _update_token(self: Self) -> None:
    """Update the OAUTH token."""
    if self.token_expires_at > datetime.now(tz=UTC):
        return

    auth_dict = {
        "username": self.username,
        "password": self.password,
    }
    response = httpx.post(f"{self.base_url}/v1/manageorders/signin", json=auth_dict)
    response.raise_for_status()
    data = response.json()
    self.token = data["id_token"]
    self.token_expires_at = datetime.now(tz=UTC) + timedelta(hours=1)```
charred tusk
#

Ignore the id_token

#

These dumbasses got AWS Cognito to do everything for them and still couldn't read the instructions

inland karma
#

lol

charred tusk
#

But yeah, with OAUTH, its "just" a POST /token (for machine auth)

inland karma
#

😄

#

and callback

#

well, if your doing sso that is.

pallid garden
#

how did i not see this

inland karma
#

read all the words

charred tusk
#

try reading

#

jinx 🍻

inland karma
#

dont skip anything

inland karma
pallid garden
inland karma
#

you gain knowledge from docs, if the docs is made correct

pallid garden
#

ok yknow the docs is pretty good

inland karma
#

learning, understanding, goals and information

pallid garden
#

compared to what ive read for the past day

inland karma
dire shale
#

Its such a big issue, and I'm so tired of people claiming to have a solid answer to it

inland karma
#

here, if the docs have this, its a good doc

pallid garden
quartz fulcrum
#

i am surprised how a small code can do very productive things

quartz fulcrum
inland karma
#

many lines of code is not a good measurement

inland karma
pallid garden
inland karma
#

i find it well made

pallid garden
#

though it might also be that i have been gathering and synthesizing loads of resources from all over the place so now it's like a revision/summary

inland karma
#

i do like to read docs, its a great hobby

#

same with reading PRs in reverse order

pallid garden
#

i seldom like to read docs that are made by companies with a product to sell

bronze dragon
#

or like from the most recent comment?

inland karma
inland karma
#

understanding of a codebase is something you get from reading PRs, last changed to least. it gives you an idea of what just broke, what just had to change and what the current syle is

#

though, probably not a hobby everyone should have

pallid garden
#

what? reading PRs?

inland karma
#

reading a codebase trough PRs... its often not important to know a random codebase

#

ofc, a codebase you work on, super important, but thats not a hobby, thats work

bronze dragon
inland karma
#

im reading tinygrad right now

pallid garden
#

Authlib provides a ready to use AuthorizationServer which has built-in tools to handle requests and responses:
there we go

#

that's where the good docs end

pallid garden
#

this is authlib's docs

#

i mean i guess this was what i really wanted?

#

but now im too deep into trying to understand how it works

#

behind the scenes

inland karma
#

im investing time into getting my AI model to actually work this time

#

because if pewdipie can make his own ai model, then for sure i should be able to! 😄

quartz fulcrum
#

hey i used to watch pewdiepie's videos

#

micecraft series is best

inland karma
#

though, i actually think he is a genius under all the joke-fasade

shrewd pine
#

(I saw his stuff before he got large)

inland karma
#

i have only seen his python developer journey

pallid garden
#

(/jk)

shrewd pine
quartz fulcrum
#

i was his viewer when logan paul became popular

shrewd pine
empty quail
#

Sup snek

#

or snekians

#

or what do we say

empty quail
#

snek family 🐍

inland karma
# shrewd pine I haven't followed him for many many years, I recall he's a university dropout w...

Click https://boot.dev/?promo=PEWDIEPIE and use my code PEWDIEPIE to get 25% off your first payment for boot.dev!

Thanks Boot.Dev for sponsoring this video!

🌏 Get exclusive NordVPN deal here ➵ https://NordVPN.com/pewdiepie It’s risk free with Nord’s 30 day money-back guarantee!✌

Sankyu:

DeepSeek - https://www.deepseek.com/en...
▶ Play video
shrewd pine
#

I know he made that video recently, yeah

quick compass
#

Hello

Is it possible to make my own api which scraps the web(specifically linkedin) for data?

shrewd pine
#

he spent his early years shouting at chairs and barrels

raw bramble
#

Ooh, love the new icon, what’s it for?

grave tree
raw bramble
inland karma
shrewd pine
pallid garden
inland karma
#

Im sorry @grave tree if i was abrasive yesterday, it was not my intent to come of like that. Ill try to be better in the future! 😄

grave tree
quick compass
pallid garden
#

no really, do you know what an API is?

quick compass
pallid garden
inland karma
pallid garden
ocean ridge
#

i know how to bypass it but ima gatekeep :/ (mainly cloudflare anti bot and other anti bot things)

pallid garden
#

it's like asking if other people can write a program to access your company's database @quick compass

inland karma
shrewd pine
dire shale
shrewd pine
#

(a programmable interface that applications can use)

inland karma
#

!pypi linkedin-api-client

edgy krakenBOT
dire shale
#

But, I'm no expert. I think it's in an important distinction, whether an API is a program which wraps around another program, or, a set of protocols inside a program

harsh anchor
inland karma
#

only thing that matters is that it is an interffface you can program

quick compass
#

Atleast from the above reply you know they dont want to use paid apis.

how fcked am i?

pallid garden
#

if you want to let other people interact with your company's database in a limited way, you can write a program that does the "accessing data" part, and then let other people call this program through an API.

hence, it's a logical contradiction to suggest that you can write an API to access linkedin's data yourself

shrewd pine
inland karma
#

my favorite api is pathlib

shrewd pine
#

is that an "is" or a "has a" relation?

harsh anchor
pallid garden
#

why dont you help out then

#

since you are saying it's possible

bronze dragon
harsh anchor
bronze dragon
#

creating an API doesn't necessarily imply direct access to the database

#

you could have (and indeed there are many) APIs which wrap a scraper

quick compass
#

Question, why is scraping not permitted? It's not like I am accessing restricted data, just what's on their page.

grave tree
tribal drum
#

Guys, you must see this before working
LinkedIn's Terms of Service (ToS) strictly prohibit the use of bots, crawlers, scrapers, and other automated methods to access, search, or scrape data from the platform. Automated activity that violates these terms often leads to account restrictions, "LinkedIn jail," or permanent bans. [1, 2, 3, 4]
Key Aspects of LinkedIn’s Robot/Automation Policy:

• Prohibited Activities: The User Agreement explicitly forbids using any software or scripts to scrape data, copy profiles, or send mass messages/connection requests.
• Detection Measures: LinkedIn uses sophisticated AI to detect non-human behavior, including rapid profile viewing, unnaturally consistent timing between actions, and unusual IP addresses.
• Penalties: Violating these policies can result in temporary or permanent bans. In some cases, users are required to submit government-issued ID to restore access.
• Permitted Activity: Only authorized API integrations or manual browsing are generally allowed. [1, 2, 3, 5, 6, 7]

Permitted Automated Crawling & IndexingLinkedIn has specific, separate terms for authorized crawling (e.g., for search engines):

• Express Permission Required: Automated crawling without prior written permission is strictly prohibited.
• Respect Robots.txt: Approved bots must abide by robot exclusion headers.
• Usage Constraints: Data collected must be used only for search indexing in public search engines. [8]

Risks and Enforcement

• Account Restrictions: Using browser extensions or automation software to mimic human activity often triggers warnings, such as "You've reached the weekly invitation limit" or "We've noticed unusual activity".
• Data Privacy: Automated scraping is often considered a violation of both LinkedIn's user agreement and privacy legislation.
• Lawsuits: LinkedIn has taken legal action against entities that scrape data, treating such actions as a direct threat to their business model. [1, 3, 6, 10, 11]
]

inland karma
pallid garden
grave tree
#

Automated activity that violates these terms often leads to account restrictions, "LinkedIn jail," or permanent bans
lmfao, I love that they have a name for it "LinkedIn jail"

pallid garden
#

im not saying it's technically impossible

inland karma
pallid garden
#

im saying it's impossible according to the TOS

harsh anchor
#

you said it was a logical contradiction

pallid garden
#

can i ask you, what's the point of this API?

bronze dragon
tribal drum
#

Anyways half of linked in is ai generated , better you can use deepseek ai

bronze dragon
#

truth

grave tree
#

I think we can take it down a notch, y'all are just talking slightly past each other.
zehata is answering the question of "can you build an API without violating LinkedIn's ToS?". Other folks are looking at the question without the ToS restriction

quick compass
#

Btw hi Bharadwaj. 👋

pallid garden
#

why would you build a frontend scraper, provide an API for that scraper and then go and use this API to get the information from the page. that's just the same as building a frontend scraper without the API part

bronze dragon
tribal drum
pallid garden
quick compass
#

So bottom point is, there is no "allowed" way apart from using paid api, is there guys?

tribal drum
#

Anyways if you wanna scrape linked in the illeagel way is use chromium chrome driver then use beautiful soup , and np.random to generate request intervals this way you can skip detection

tribal drum
pallid garden
#

chrome driver gets caught easily

bronze dragon
tribal drum
pallid garden
#

for all intents and purposes, consider it impossible

dark wharf
#

there are very many method

tribal drum
quick compass
#

Eh, its okay. I dont want to do something stupid and get my ip banned.

tribal drum
#

Every advice given here by me was for " educational purposes only."

dark wharf
pallid garden
dark wharf
grave tree
#

pls y'all, our rules 😩

tribal drum
#

In ipo

dark wharf
brittle merlin
#

happy holi python??

velvet trout
#

unauthorized scraping discussion in my python discussion chat? ducky_concerned

pallid garden
#

must be a day that ends with -day

humble jungle
#

Saint Patrick day

tribal drum
peak egret
#

pi day when

oblique spindle
pallid garden
# velvet trout unauthorized scraping discussion in my python discussion chat? <:ducky_concerned...

the real pydis .topic list:

  • is AI going to take over software engineering in a <some duration of time>, <some famous person> said so
  • how do I scrape <some website with TOS disallowing scraping>
  • python is so slow, <some other programming language> is better
  • what youtube channel should i watch to learn programming
  • ive been making <some impossible software>, i have met a small bug, can someone DM me, im willing to pay
  • *sends .topic command* ".topic list is so boring, we need to update it"
tribal drum
bronze dragon
#

don't forget "I'm looking for partners in my business/project"

proud nacelle
#

'Any Python professionals in here that can mentor/coach me'

steel pulsar
#

please use pink logo server its better

tribal drum
proud nacelle
#

Who cares about the logo

grave tree
#

I'm just glad the mojo topic has died a swift death, that was such an annoying period of time

steel pulsar
jade robin
#

🍿

verbal citrus
#

unironically an LLM based .topic command would be nice ...it should pull the recent N discussion in #python-discussion and then return a new topic ...prolly a good case for LLM

grave tree
surreal knot
proud nacelle
#

Wth is Mojo 😂

grave tree
tribal drum
#

Python is for ml , now making a calculator in it and comparing to c and java is like , rest we understand 🙂

proud nacelle
#

I've never heard of Mojo in my entire life

verbal citrus
jade robin
cerulean ravine
tribal drum
#

M using multiple llm to complete the Epstein files and reconstruction of their doj

pallid garden
#

im sure that would be totally accurate

verbal citrus
tribal drum
#

Anyways , if you compile a python app with nuitka , speed improves ,

#

But yeah for large apps and library time is 📈

proud nacelle
#

I don't really get why people hype programming languages so much in the first place. Kinda comes across as LARP most of the time

pallid garden
#

but hey, at least it did what it promised: it was faster than python...
...at dying

harsh anchor
#

it is used, though

verbal citrus
#

by who? mojo?

warped lotus
#

mojo is not OS?

#

I have never seen a programming language which is not open source

#

wait maybe apple script

warped lotus
#

wait what hold on

grave tree
pallid garden
#

apparently zilog isnt

warped lotus
pallid garden
#

mainframe programming language

#

or am i mistaken

#

i was indeed mistaken

#

it's some microprocessor

cyan scaffold
#

Didn't Microsoft close C# and then people forked it?

sonic cargo
#

do someone know how can i verify me ?

warped lotus
verbal citrus
bronze dragon
#

do you mean voice verification?

sonic cargo
#

okey i just need time in chat

#

thaks

proud nacelle
silver plover
grave tree
bronze dragon
#

any language could have proprietary implementations, in theory

bronze dragon
#

a more salient point would be that the official ISO C++ standard is behind a paywall
* working drafts are public, but the actual final standard costs a couple hundred USD to access

grave tree
#

Someone can make a closed source Python implementation, I don't know if that would make Python closed source though

proud nacelle
grave tree
proud nacelle
grave tree
# proud nacelle What do you mean?

A language, at its core, is a specification. It is describing behavior or how to use the programming language and how the programming language responds and is structured. It's why sometimes we have to draw a clear distinction between a programming language as defined by the spec vs implementation behavior

#

You'll often have a reference or default implementation, but that's still based on the spec

peak egret
#

my language only has one compiler, there is no spec, would you consider this closed-source?

grave tree
peak egret
#

i do have docs but they are FAR from being a spec

proud nacelle
upper dirge
#

how am I meant to escape the bytestring so the exec will run?

exec('z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b'\x08\t\n<>pqr')```
pallid garden
upper dirge
kind thicket
#

Some might talk about open community for instance

tribal drum
kind thicket
#

It's also why the Apache Software Foundation has the motto Community over code

upper dirge
tribal drum
peak egret
#

unless you fork it ofcourse

tribal drum
upper dirge
#

I'm using 3.14

pliant fractal
kind thicket
tribal drum
grave tree
upper dirge
#

id like to not have to make it a variable

proud nacelle
#

Kinda like saying I fixed an impossible math question without showing the proof or a verified result

cyan scaffold
kind thicket
grave tree
upper dirge
#

i changed the quotes and now I'm getting this error

  File "<stdin>", line 3, in <module>
  File "<string>", line 1
    z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b
                                                      ^
SyntaxError: unterminated string literal (detected at line 1)
exit status 1```
grave tree
cyan scaffold
#

Which is why you escape it

velvet trout
#

Shouldn't you use r strings in such cases?

bronze dragon
upper dirge
#

ah yes

cyan scaffold
#

'my b\'byte string\''

upper dirge
#

it works now

exec('z=[[v," "][2<sum(z[x-61+y:][:1]<"$"<v<"/"for y in b"\\x08\\t\\n<>pqr")]for x,v in enumerate(z)];'*650)```
tribal drum
#

Still it won't run

#

U r comparing list with a string

velvet trout
#

Very pythonic code btw

exotic solstice
#

soo dontasktoask . com is blocked in this server. Why so?

velvet trout
grave tree
bronze dragon
pallid garden
stray field
#

Instead, just say hello.

pallid garden
proud nacelle
bronze dragon
#

just say "please ask your question directly" or something of that form

exotic solstice
#

I see, okay didn't knew it was rude

upper dirge
velvet trout
pallid garden
quartz fulcrum
#

from where do i learn git and github?

bronze dragon
#

opaque means you're not supposed to rely on or modify the actual contents of this value. you get it from somewhere and you pass it on as-is.
(substitute you = whoever it is opaque for)

proud nacelle
pallid garden
pallid garden
#

it's just a way for the client to store some info to get back on the callback

tribal drum
muted rampart
ocean ridge
#

@pallid garden Personally I use firebase for authentication. its dead simple. Just suggesting

pallid garden
ocean ridge
pallid garden
#

if the cluster has an internal oauth implementation, the public facing API should provide the relevant routes as well, right?

#

it doesnt actually do anything, the data just gets passed through

#

to the client, the public facing API is the oauth interface, and the fact that the oauth service is running on another node is just an implementation detail, right?

velvet trout
#

def keyword actually goes in the same order as in alphabets.

A, B, C, [D, E, F], G, ...

ducky_concerned

#

Another reason why python is easy, if you know alphabets ^

cerulean ravine
velvet trout
# crisp jay Wdym
A B C [D E F] G ... X Y Z

python's function defining keyword def has letters in the same order as they appear in English alphabets A to Z.

#

Wait i read that wrong lol

random bison
#

is pyautogui worth using

velvet trout
velvet trout
spice hill
velvet trout
stray field
velvet trout
stray field
#

So will git diff --staged

spice hill