Skip to content

Commit 1da2f25

Browse files
committed
Add depend lib
1 parent b8d3a41 commit 1da2f25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+22075
-0
lines changed

arrow/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
from ._version import __version__
3+
from .api import get, now, utcnow
4+
from .arrow import Arrow
5+
from .factory import ArrowFactory
6+
from .formatter import (
7+
FORMAT_ATOM,
8+
FORMAT_COOKIE,
9+
FORMAT_RFC822,
10+
FORMAT_RFC850,
11+
FORMAT_RFC1036,
12+
FORMAT_RFC1123,
13+
FORMAT_RFC2822,
14+
FORMAT_RFC3339,
15+
FORMAT_RSS,
16+
FORMAT_W3C,
17+
)
18+
from .parser import ParserError

arrow/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.17.0"

arrow/api.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Provides the default implementation of :class:`ArrowFactory <arrow.factory.ArrowFactory>`
4+
methods for use as a module API.
5+
6+
"""
7+
8+
from __future__ import absolute_import
9+
10+
from arrow.factory import ArrowFactory
11+
12+
# internal default factory.
13+
_factory = ArrowFactory()
14+
15+
16+
def get(*args, **kwargs):
17+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``get`` method."""
18+
19+
return _factory.get(*args, **kwargs)
20+
21+
22+
get.__doc__ = _factory.get.__doc__
23+
24+
25+
def utcnow():
26+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``utcnow`` method."""
27+
28+
return _factory.utcnow()
29+
30+
31+
utcnow.__doc__ = _factory.utcnow.__doc__
32+
33+
34+
def now(tz=None):
35+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``now`` method."""
36+
37+
return _factory.now(tz)
38+
39+
40+
now.__doc__ = _factory.now.__doc__
41+
42+
43+
def factory(type):
44+
"""Returns an :class:`.ArrowFactory` for the specified :class:`Arrow <arrow.arrow.Arrow>`
45+
or derived type.
46+
47+
:param type: the type, :class:`Arrow <arrow.arrow.Arrow>` or derived.
48+
49+
"""
50+
51+
return ArrowFactory(type)
52+
53+
54+
__all__ = ["get", "utcnow", "now", "factory"]

0 commit comments

Comments
 (0)