Skip to content

Commit

Permalink
v0.0.4 update
Browse files Browse the repository at this point in the history
  • Loading branch information
BobDotCom committed Sep 16, 2022
1 parent 1a614d0 commit 7d899f0
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 106 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/python-package.yml

This file was deleted.

52 changes: 48 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,60 @@
Time_Str
********

|Mypy| |Pylint| |Black|

|Codecov| |Checks| |Lint| |Tests| |Pre-commit|

|PyPI| |Versions| |Docs badge| |Downloads badge| |GitHub|


A package to convert user input into datetime.timedelta objects.

|Status badge|
.. |Mypy| image:: http://www.mypy-lang.org/static/mypy_badge.svg
:target: http://mypy-lang.org/
:alt: Checked with mypy
.. |Pylint| image:: https://img.shields.io/badge/linting-pylint-yellowgreen
:target: https://github.com/PyCQA/pylint
:alt: linting: pylint
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style: black

.. |Codecov| image:: https://codecov.io/gh/BobDotCom/time_str/branch/main/graph/badge.svg?token=MQGTWTBI5E
:target: https://codecov.io/gh/BobDotCom/time_str
:alt: Codecov
.. |Checks| image:: https://github.com/BobDotCom/time_str/actions/workflows/check.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/check.yml
:alt: Checks
.. |Lint| image:: https://github.com/BobDotCom/time_str/actions/workflows/lint.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/lint.yml
:alt: Type Check and Lint
.. |Tests| image:: https://github.com/BobDotCom/time_Str/actions/workflows/test.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/test.yml
:alt: Unit Tests
.. |Pre-commit| image:: https://results.pre-commit.ci/badge/github/BobDotCom/time_str/main.svg
:target: https://results.pre-commit.ci/latest/github/BobDotCom/time_str/main
:alt: pre-commit.ci status

.. |Status badge| image:: https://github.com/BobDotCom/time_str/workflows/Python%20Package/badge.svg
:target: https://github.com/BobDotCom/time_str/actions?query=workflow%3A"Python+Package"
.. |PyPI| image:: https://img.shields.io/pypi/v/time_str.svg?logo=pypi&color=yellowgreen&logoColor=white
:target: https://pypi.python.org/pypi/time_str
:alt: PyPI version info
.. |Versions| image:: https://img.shields.io/pypi/pyversions/time_str.svg?logo=python&logoColor=white
:target: https://pypi.python.org/pypi/time_str
:alt: PyPI supported Python versions
.. |Docs badge| image:: https://readthedocs.org/projects/time_str/badge/?version=latest
:target: https://time_str.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. |Downloads badge| image:: https://static.pepy.tech/personalized-badge/time_str?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads
:target: https://pepy.tech/project/time_str
:alt: Download Counter
.. |GitHub| image:: https://img.shields.io/github/v/release/BobDotCom/time_str?include_prereleases&label=Latest%20Release&logo=github&sort=semver&logoColor=white
:target: https://github.com/BobDotCom/time_str/releases
:alt: Latest release

PyPI: https://pypi.org/project/time-str/

Docs: https://time-str.readthedocs.io/en/latest/
Docs: https://time-str.rtfd.io/

Installation
############
Expand Down
28 changes: 28 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:github_url: https://github.com/BobDotCom/time_str

.. currentmodule:: time_str

API Reference
===============

The following section outlines the API of time_str.


.. _core_utilities:

Core Utilities
--------------
These provide the main functionality of time_str.


Shortcut Functions
~~~~~~~~~~~~~~~~~~

.. autofunction:: convert


Converter Classes
~~~~~~~~~~~~~~~~~

.. autoclass:: Converter
:members:
48 changes: 32 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import re
sys.path.insert(0, os.path.abspath('..'))
import sys

sys.path.insert(0, os.path.abspath(".."))

# -- Project information -----------------------------------------------------

project = 'time_str'
copyright = '2020, BobDotCom'
author = 'BobDotCom'
project = "time_str"
# noinspection PyShadowingBuiltins
copyright = "2020, BobDotCom"
author = "BobDotCom"

# The full version, including alpha/beta/rc tags
version = ''
with open('../time_str/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
version = ""
if not version:
# for linter
pass
with open("../time_str/__init__.py") as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE
).group(1)
release = version


Expand All @@ -35,30 +41,40 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
]

autodoc_member_order = "bysource"
autodoc_typehints = "signature"
autoclass_content = "init"

# master_doc = 'index'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# autodoc_default_options = {
# 'imported-members': True
# }
# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']


# -- Extension configuration -------------------------------------------------
# -- Extension configuration -------------------------------------------------
95 changes: 88 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,97 @@
Welcome to time_str's documentation!
=======================================================
:github_url: https://github.com/BobDotCom/time_str

.. automodule:: time_str
:members:
Time_str Documentation
======================

|Mypy| |Pylint| |Black|

|Codecov| |Checks| |Lint| |Tests| |Pre-commit|

|PyPI| |Versions| |Docs badge| |Downloads badge| |GitHub|


A package to convert user input into datetime.timedelta objects.

.. |Mypy| image:: http://www.mypy-lang.org/static/mypy_badge.svg
:target: http://mypy-lang.org/
:alt: Checked with mypy
.. |Pylint| image:: https://img.shields.io/badge/linting-pylint-yellowgreen
:target: https://github.com/PyCQA/pylint
:alt: linting: pylint
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style: black

.. |Codecov| image:: https://codecov.io/gh/BobDotCom/time_str/branch/main/graph/badge.svg?token=MQGTWTBI5E
:target: https://codecov.io/gh/BobDotCom/time_str
:alt: Codecov
.. |Checks| image:: https://github.com/BobDotCom/time_str/actions/workflows/check.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/check.yml
:alt: Checks
.. |Lint| image:: https://github.com/BobDotCom/time_str/actions/workflows/lint.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/lint.yml
:alt: Type Check and Lint
.. |Tests| image:: https://github.com/BobDotCom/time_Str/actions/workflows/test.yml/badge.svg
:target: https://github.com/BobDotCom/time_str/actions/workflows/test.yml
:alt: Unit Tests
.. |Pre-commit| image:: https://results.pre-commit.ci/badge/github/BobDotCom/time_str/main.svg
:target: https://results.pre-commit.ci/latest/github/BobDotCom/time_str/main
:alt: pre-commit.ci status

.. |PyPI| image:: https://img.shields.io/pypi/v/time_str.svg?logo=pypi&color=yellowgreen&logoColor=white
:target: https://pypi.python.org/pypi/time_str
:alt: PyPI version info
.. |Versions| image:: https://img.shields.io/pypi/pyversions/time_str.svg?logo=python&logoColor=white
:target: https://pypi.python.org/pypi/time_str
:alt: PyPI supported Python versions
.. |Docs badge| image:: https://readthedocs.org/projects/time_str/badge/?version=latest
:target: https://time_str.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. |Downloads badge| image:: https://static.pepy.tech/personalized-badge/time_str?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads
:target: https://pepy.tech/project/time_str
:alt: Download Counter
.. |GitHub| image:: https://img.shields.io/github/v/release/BobDotCom/time_str?include_prereleases&label=Latest%20Release&logo=github&sort=semver&logoColor=white
:target: https://github.com/BobDotCom/time_str/releases
:alt: Latest release


PyPI: https://pypi.org/project/time_str/

Docs: https://time-str.rtfd.io/

Installation
############
You can install released versions of time_str from the Python Package Index via pip or a similar tool:

**Stable Release:** ``pip install time_str``

**Working Version:** ``pip install git+https://github.com/BobDotCom/time_str.git``

Usage
#####

.. code-block:: python
>>> import time_str
>>> time_str.convert('11 months 9days 1m 3 sec')
datetime.timedelta(days=345, seconds=63)
>>> time_str.convert('2 months 3w 1 d 5hour 3 min')
datetime.timedelta(days=83, seconds=18180)
Manuals
-------

.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 1

api




Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* :ref:`search`
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx_rtd_theme==1.0.0
Empty file added requirements-dev.txt
Empty file.
Empty file added requirements.txt
Empty file.
Loading

0 comments on commit 7d899f0

Please sign in to comment.