Một mục phía máy chủ trong kho dữ liệu GitHub của TopGit: kennethreitz/maya, 3.4k sao, nhóm Backend, Python. Datetimes for Humans™
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Datetimes are very frustrating to work with in Python, especially when dealing
with different locales on different systems. This library exists to make the
simple things much easier, while admitting that time is an illusion
(timezones doubly so).
Datetimes should be interacted with via an API written for humans.
Maya is mostly built around the headaches and use-cases around parsing datetime data from websites.
In addition to timestamps, Maya also includes a wonderfully powerful MayaInterval class, which represents a range of time (e.g. an event). With this class, you can perform a multitude of advanced calendar calculations with finesse and ease.
For example:
.. code-block:: pycon
>>> from maya import MayaInterval
# Create an event that is one hour long, starting now.
>>> event_start = maya.now()
>>> event_end = event_start.add(hours=1)
>>> event = MayaInterval(start=event_start, end=event_end)
From here, there are a number of methods available to you, which you can use to compare this event to another event.
☤ Why is this useful?
All timezone algebra will behave identically on all machines, regardless of system locale.
Complete symmetric import and export of both ISO 8601 and RFC 2822 datetime stamps.
Fantastic parsing of both dates written for/by humans and machines (maya.when() vs maya.parse()).
Support for human slang, both import and export (e.g. an hour ago).
Datetimes can very easily be generated, with or without tzinfo attached.
This library is based around epoch time, but dates before Jan 1 1970 are indeed supported, via negative integers.
Maya never panics, and always carries a towel.
☤ What about Delorean_, Arrow_, & Pendulum_?
All these projects complement each other, and are friends. Pendulum, for example, helps power Maya's parsing.
Arrow, for example, is a fantastic library, but isn't what I wanted in a datetime library. In many ways, it's better than Maya for certain things. In some ways, in my opinion, it's not.
I simply desire a sane API for datetimes that made sense to me for all the things I'd ever want to do—especially when dealing with timezone algebra. Arrow doesn't do all of the things I need (but it does a lot more!). Maya does do exactly what I need.
I think these projects complement each-other, personally. Maya is great for parsing websites, and dealing with calendar events!
#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
#. Fork the repository_ on GitHub to start making your changes to the master branch (or branch off of it).
#. Write a test which shows that the bug was fixed or that the feature works as expected.
#. Send a pull request and bug the maintainer until it gets merged and published. :)
kennethreitz/maya thuộc nhóm Backend trên TopGit, cùng 9 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về kennethreitz/maya ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/kennethreitz/maya là nguồn chính thức.
kennethreitz/maya có bao nhiêu sao?
kennethreitz/maya có 3.4k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/kennethreitz/maya. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
kennethreitz/maya có phải mã nguồn mở không?
Có — kennethreitz/maya phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/kennethreitz/maya.
kennethreitz/maya có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho kennethreitz/maya. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
kennethreitz/maya là gì?
kennethreitz/maya (kennethreitz/maya) là dự án Python trên GitHub. Theo mô tả gốc: Datetimes for Humans™
kennethreitz/maya so với các dự án Backend khác thế nào?
kennethreitz/maya được TopGit xếp vào nhóm Backend, với 3.4k sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc maya có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về maya.