mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 23:00:18 +00:00
added update, install, and some quickstart
Signed-off-by: Evan.Mattiza <emattiza@gmail.com>
This commit is contained in:
@@ -66,20 +66,18 @@ Release v\ |version|. (:ref:`Installation <install>`)
|
||||
UTC
|
||||
|
||||
# Range of hours in a day:
|
||||
>>> maya.interval(start=maya.now(), end=maya.now().add(days=1), interval=60*60)
|
||||
>>> maya.interval(
|
||||
... start=maya.now(),
|
||||
... end=maya.now().add(days=1),
|
||||
... interval=60*60)
|
||||
<generator object intervals at 0x105ba5820>
|
||||
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
user/install
|
||||
user/quickstart
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
.. _install:
|
||||
Installation
|
||||
=============
|
||||
|
||||
Pip Install Maya
|
||||
----------------
|
||||
|
||||
To install maya, simply use::
|
||||
$ pip install maya
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
Maya is actively developed on `Github
|
||||
<https://github.com/kennethreitz/maya.git>`_
|
||||
|
||||
You can either clone the public repository::
|
||||
|
||||
$ git clone git://github.com/kennethreitz/maya.git
|
||||
|
||||
Or, download the `tarball <https://github.com/kennethreitz/maya/tarball/master>`_::
|
||||
|
||||
$ curl -OL https://github.com/kennethreitz/maya/tarball/master
|
||||
# optionally, zipball is also available (for Windows users).
|
||||
|
||||
Once you have a copy of the source, you can embed it in your own Python
|
||||
package, or install it into your site-packages easily::
|
||||
|
||||
$ python setup.py install
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
.. _quickstart:
|
||||
Quickstart
|
||||
==========
|
||||
|
||||
.. module::maya
|
||||
|
||||
Ready for a simple datetime tool? This doc provides some tools to use in your
|
||||
busy workflow.
|
||||
|
||||
First, make sure that Maya is:
|
||||
|
||||
- :ref:`Installed <install>`
|
||||
- :ref:`Up to date <update>`
|
||||
|
||||
|
||||
Parse a Date
|
||||
------------
|
||||
Parsing a date from a string with Maya is 🍰!
|
||||
|
||||
First, you'll need to import maya::
|
||||
|
||||
>>> import maya
|
||||
|
||||
There are currently two ways to make sense of datetime:
|
||||
|
||||
- ``maya.parse``
|
||||
- ``maya.when``
|
||||
|
||||
A simple answer is that you should use parse on machine output, and when on human input.
|
||||
|
||||
Use as follows::
|
||||
|
||||
>>> recent_win = maya.parse('2016-11-02T20:00PM')
|
||||
>>> old_win = maya.when('October 14, 1908')
|
||||
>>> grandpas_date = maya.when('108 years ago')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
.. _update:
|
||||
Community Updates
|
||||
=================
|
||||
|
||||
If you'd like to stay up to date on the community and development of Maya,
|
||||
there are several options:
|
||||
|
||||
|
||||
GitHub
|
||||
------
|
||||
|
||||
The best way to track the development of Maya is through
|
||||
`the GitHub repo <https://github.com/kennethreitz/Maya>`_.
|
||||
|
||||
Twitter
|
||||
-------
|
||||
|
||||
The author, Kenneth Reitz, often tweets about new features and releases of Maya.
|
||||
|
||||
Follow `@kennethreitz <https://twitter.com/kennethreitz>`_ for updates.
|
||||
|
||||
|
||||
|
||||
Release and Version History
|
||||
===========================
|
||||
|
||||
.. include:: ../../HISTORY.rst
|
||||
Reference in New Issue
Block a user