brk-code

pendulum の API リファレンス

pendulum (sdispater/pendulum) の公開 API 78 件 —— クラス 6、関数 17、メソッド 55。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: sdispater/pendulum

種別件数
クラス6
関数17
メソッド55

API 一覧

funcsrc.pendulum._helpers.precise_diff(d1:datetime.datetime | datetime.date, d2:datetime.datetime | datetime.date) -> PreciseDiff
Calculate a precise difference between two datetimes.
funcsrc.pendulum.date(year:int, month:int, day:int) -> Date
Create a new Date instance.
methodsrc.pendulum.date.Date.add(years:int=0, months:int=0, weeks:int=0, days:int=0) -> Self
Add duration to the instance.
methodsrc.pendulum.date.Date.closest(dt1:date, dt2:date) -> Self
Get the closest date from the instance.
methodsrc.pendulum.date.Date.day_of_week() -> WeekDay
Returns the day of the week (0-6).
methodsrc.pendulum.date.Date.day_of_year() -> int
Returns the day of the year (1-366).
methodsrc.pendulum.date.Date.diff(dt:date | None=None, abs:bool=True) -> Interval[Date]
Returns the difference between two Date objects as an Interval.
methodsrc.pendulum.date.Date.farthest(dt1:date, dt2:date) -> Self
Get the farthest date from the instance.
methodsrc.pendulum.date.Date.is_anniversary(dt:date | None=None) -> bool
Check if it's the anniversary.
methodsrc.pendulum.date.Date.is_future() -> bool
Determines if the instance is in the future, ie.
methodsrc.pendulum.date.Date.is_leap_year() -> bool
Determines if the instance is a leap year.
methodsrc.pendulum.date.Date.is_past() -> bool
Determines if the instance is in the past, ie.
methodsrc.pendulum.date.Date.next(day_of_week:WeekDay | None=None) -> Self
Modify to the next occurrence of a given day of the week.
methodsrc.pendulum.date.Date.previous(day_of_week:WeekDay | None=None) -> Self
Modify to the previous occurrence of a given day of the week.
methodsrc.pendulum.date.Date.subtract(years:int=0, months:int=0, weeks:int=0, days:int=0) -> Self
Remove duration from the instance.
methodsrc.pendulum.date.Date.to_date_string() -> str
Format the instance as date.
methodsrc.pendulum.date.Date.to_formatted_date_string() -> str
Format the instance as a readable date.
methodsrc.pendulum.datetime.DateTime.add(years:int=0, months:int=0, weeks:int=0, days:int=0, hours:int=0, minutes:int=0, seconds:float=0, microseconds:int=0) -> Self
Add a duration to the instance.
methodsrc.pendulum.datetime.DateTime.at(hour:int, minute:int=0, second:int=0, microsecond:int=0) -> Self
Returns a new instance with the current time to a different time.
methodsrc.pendulum.datetime.DateTime.closest(*dts:datetime.datetime) -> Self
Get the closest date to the instance.
methodsrc.pendulum.datetime.DateTime.farthest(*dts:datetime.datetime) -> Self
Get the farthest date from the instance.
methodsrc.pendulum.datetime.DateTime.in_timezone(tz:str | Timezone | FixedTimezone) -> Self
Set the instance's timezone from a string or object.
methodsrc.pendulum.datetime.DateTime.in_tz(tz:str | Timezone | FixedTimezone) -> Self
Set the instance's timezone from a string or object.
methodsrc.pendulum.datetime.DateTime.is_anniversary(dt:datetime.datetime | None=None) -> bool
Check if its the anniversary.
methodsrc.pendulum.datetime.DateTime.is_future() -> bool
Determines if the instance is in the future, ie.
methodsrc.pendulum.datetime.DateTime.is_past() -> bool
Determines if the instance is in the past, ie.
methodsrc.pendulum.datetime.DateTime.naive() -> Self
Return the DateTime without timezone information.
methodsrc.pendulum.datetime.DateTime.next(day_of_week:WeekDay | None=None, keep_time:bool=False) -> Self
Modify to the next occurrence of a given day of the week.
methodsrc.pendulum.datetime.DateTime.subtract(years:int=0, months:int=0, weeks:int=0, days:int=0, hours:int=0, minutes:int=0, seconds:float=0, microseconds:int=0) -> Self
Remove duration from the instance.
methodsrc.pendulum.datetime.DateTime.to_atom_string() -> str
Format the instance as ATOM.
methodsrc.pendulum.datetime.DateTime.to_cookie_string() -> str
Format the instance as COOKIE.
methodsrc.pendulum.datetime.DateTime.to_datetime_string() -> str
Format the instance as date and time.
methodsrc.pendulum.datetime.DateTime.to_iso8601_string() -> str
Format the instance as ISO 8601.
methodsrc.pendulum.datetime.DateTime.to_rfc1036_string() -> str
Format the instance as RFC 1036.
methodsrc.pendulum.datetime.DateTime.to_rfc1123_string() -> str
Format the instance as RFC 1123.
methodsrc.pendulum.datetime.DateTime.to_rfc2822_string() -> str
Format the instance as RFC 2822.
methodsrc.pendulum.datetime.DateTime.to_rfc3339_string() -> str
Format the instance as RFC 3339.
methodsrc.pendulum.datetime.DateTime.to_rfc822_string() -> str
Format the instance as RFC 822.
methodsrc.pendulum.datetime.DateTime.to_rfc850_string() -> str
Format the instance as RFC 850.
methodsrc.pendulum.datetime.DateTime.to_rss_string() -> str
Format the instance as RSS.
methodsrc.pendulum.datetime.DateTime.to_time_string() -> str
Format the instance as time.
methodsrc.pendulum.datetime.DateTime.to_w3c_string() -> str
Format the instance as W3C.
funcsrc.pendulum.duration(days:float=0, seconds:float=0, microseconds:float=0, milliseconds:float=0, minutes:float=0, hours:float=0, weeks:float=0, years:float=0, months:float=0) -> Duration
Create a Duration instance.
classsrc.pendulum.duration.Duration
Replacement for the standard timedelta class.
methodsrc.pendulum.duration.Duration.as_timedelta() -> timedelta
Return the interval as a native timedelta.
methodsrc.pendulum.duration.Duration.in_words(locale:str | None=None, separator:str=' ') -> str
Get the current interval in words in the current locale.
classsrc.pendulum.formatting.difference_formatter.DifferenceFormatter
Handles formatting differences in text.
methodsrc.pendulum.formatting.difference_formatter.DifferenceFormatter.format(diff:Duration, is_now:bool=True, absolute:bool=False, locale:str | Locale | None=None) -> str
Formats a difference.
funcsrc.pendulum.from_format(string:str, fmt:str, tz:str | Timezone=UTC, locale:str | None=None) -> DateTime
Creates a DateTime instance from a specific format.
funcsrc.pendulum.from_timestamp(timestamp:int | float, tz:str | Timezone=UTC) -> DateTime
Create a DateTime instance from a timestamp.
funcsrc.pendulum.interval(start:DateTime, end:DateTime, absolute:bool=False) -> Interval[DateTime]
Create an Interval instance.
classsrc.pendulum.interval.Interval
An interval of time between two datetimes.
methodsrc.pendulum.interval.Interval.as_duration() -> Duration
Return the Interval as a Duration.
methodsrc.pendulum.interval.Interval.in_months() -> int
Gives the duration of the Interval in full months.
methodsrc.pendulum.interval.Interval.in_words(locale:str | None=None, separator:str=' ') -> str
Get the current interval in words in the current locale.
methodsrc.pendulum.interval.Interval.in_years() -> int
Gives the duration of the Interval in full years.
funcsrc.pendulum.local(year:int, month:int, day:int, hour:int=0, minute:int=0, second:int=0, microsecond:int=0) -> DateTime
Return a DateTime in the local timezone.
classsrc.pendulum.locales.locale.Locale
Represent a specific locale.
funcsrc.pendulum.naive(year:int, month:int, day:int, hour:int=0, minute:int=0, second:int=0, microsecond:int=0, fold:int=1) -> DateTime
Return a naive DateTime.
funcsrc.pendulum.now(tz:str | Timezone | None=None) -> DateTime
Get a DateTime instance for the current date and time.
funcsrc.pendulum.parsing.iso8601.parse_iso8601(text:str) -> datetime.datetime | datetime.date | datetime.time | Duration
ISO 8601 compliant parser.
funcsrc.pendulum.parsing.parse(text:str, **options:Any) -> datetime | date | time | _Interval | Duration
Parses a string with the given options.
funcsrc.pendulum.time(hour:int, minute:int=0, second:int=0, microsecond:int=0) -> Time
Create a new Time instance.
classsrc.pendulum.time.Time
Represents a time instance as hour, minute, second, microsecond.
methodsrc.pendulum.time.Time.add(hours:int=0, minutes:int=0, seconds:int=0, microseconds:int=0) -> Time
Add duration to the instance.
methodsrc.pendulum.time.Time.add_timedelta(delta:datetime.timedelta) -> Time
Add timedelta duration to the instance.
methodsrc.pendulum.time.Time.closest(dt1:Time | time, dt2:Time | time) -> Self
Get the closest time from the instance.
methodsrc.pendulum.time.Time.diff(dt:time | None=None, abs:bool=True) -> Duration
Returns the difference between two Time objects as an Duration.
methodsrc.pendulum.time.Time.farthest(dt1:Time | time, dt2:Time | time) -> Self
Get the farthest time from the instance.
methodsrc.pendulum.time.Time.subtract(hours:int=0, minutes:int=0, seconds:int=0, microseconds:int=0) -> Time
Add duration to the instance.
methodsrc.pendulum.time.Time.subtract_timedelta(delta:datetime.timedelta) -> Time
Remove timedelta duration from the instance.
funcsrc.pendulum.today(tz:str | Timezone='local') -> DateTime
Create a DateTime instance for today.
funcsrc.pendulum.tomorrow(tz:str | Timezone='local') -> DateTime
Create a DateTime instance for tomorrow.
funcsrc.pendulum.tz.fixed_timezone(offset:int) -> FixedTimezone
Return a Timezone instance given its offset in seconds.
funcsrc.pendulum.tz.local_timezone() -> Timezone | FixedTimezone
Return the local timezone.
classsrc.pendulum.tz.timezone.Timezone
Represents a named timezone.
methodsrc.pendulum.tz.timezone.Timezone.convert(dt:_DT, raise_on_unknown_times:bool=False) -> _DT
Converts a datetime in the current timezone.
funcsrc.pendulum.yesterday(tz:str | Timezone='local') -> DateTime
Create a DateTime instance for yesterday.

この情報について

掲載しているシグネチャは sdispater/pendulum の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る