praw-dev / prawdditions Goto Github PK
View Code? Open in Web Editor NEWPrawdditions is an auxiliary library to PRAW, which aims to supplement the project with more abstract features.
License: BSD 2-Clause "Simplified" License
Prawdditions is an auxiliary library to PRAW, which aims to supplement the project with more abstract features.
License: BSD 2-Clause "Simplified" License
Hi ๐
Describe the solution you'd like
I think Submission.created_utc
should contain a datetime
object, instead of just the unix timestamp.
Describe alternatives you've considered
Currently, one has to wrap those themselves:
from datetime import datetime, timezone
post: Submission
posted_at = datetime.fromtimestamp(post.created_utc, timezone.utc)
Now, I have two variables, post
and posted_at
, that have information tied together, instead of just having one post
variable, and accessing everything I'd need from it. Doing this:
# overwrite the attribute
post.created_utc = datetime.fromtimestamp(post.created_utc, timezone.utc)
... is risky, because the library may not expect this data type to be there.
Additional context
This would have to be applied to every object with a created_utc
attribute, including submissions, comments, redditors, live threads, messages, etc. The same should probably apply to the edited
attribute, which appears to be either false
or specify the edition timestamp: https://i.imgur.com/1Mwbi9X.png In this case, the attribute should probably be either None
when not edited, and datetime
specifying the edition time when edited. The current documentation of "Whether or not the submission has been edited." is slightly misleading on this fact right now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.