Skip to content

Commit

Permalink
Merge pull request #2 from yuhui/2.0.0
Browse files Browse the repository at this point in the history
upgrade to 2.0.0
  • Loading branch information
yuhui authored Dec 25, 2024
2 parents 7402d99 + e72eaf0 commit 1714d77
Show file tree
Hide file tree
Showing 39 changed files with 1,729 additions and 506 deletions.
17 changes: 0 additions & 17 deletions .coveragerc

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/singstat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: API workflow

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
name: Test singstat package
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install requirements
run: pip install -r requirements_dev.txt
- name: Run tests and collect coverage
run: pytest --cov=singstat --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.code-workspace
*.sqlite

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: "3"
python: latest

python:
install:
Expand Down
8 changes: 7 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ include README.rst
# Include the license file
include LICENSE.txt

# Include the pacakage requirements
# Include the package requirements
include requirements.txt

# Exclude documentation
exclude docs/*

# Exclude tests
exclude tests/*
18 changes: 17 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
singstat
========

|pyversions| |pypi| |status| |license| |readthedocs|
|pyversions| |pypi| |status| |codecov| |downloads| |license| |readthedocs|

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/singstat
:alt: Python 3
Expand All @@ -10,6 +10,10 @@ singstat
:target: https://pypi.org/project/singstat
.. |status| image:: https://img.shields.io/pypi/status/singstat
:alt: PyPi status
.. |codecov| image:: https://codecov.io/gh/yuhui/singstat/graph/badge.svg?token=ahhqotTFVt
:target: https://codecov.io/gh/yuhui/singstat
:alt: CodeCov coverage
.. |downloads| image:: https://img.shields.io/pypi/dm/singstat
.. |license| image:: https://img.shields.io/github/license/yuhui/singstat
:alt: GNU General Public License v3.0
:target: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -59,3 +63,15 @@ Reference
`SingStat.gov.sg's Developer Guide`_

.. _SingStat.gov.sg's Developer Guide: https://tablebuilder.singstat.gov.sg/view-api/for-developers

Other Packages Built by Me
--------------------------

If you like this package, you may be interested in these packages that I have
built to work with other Government of Singapore APIs:

- `datagovsg`_: for interacting with APIs available at Data.gov.sg.
- `landtransportsg`_: for interacting with APIs available at LTA DataMall.

.. _datagovsg: https://pypi.org/project/datagovsg/
.. _landtransportsg: https://pypi.org/project/landtransportsg/
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore:
- "docs/*"
- "tests/*"
- "setup.py"
34 changes: 14 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Yuhui
# Copyright 2019-2024 Yuhui
#
# Licensed under the GNU General Public License, Version 3.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: disable=invalid-name,redefined-builtin,wrong-import-position

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
Expand All @@ -26,18 +28,19 @@

import os
import sys

sys.path.insert(0, os.path.abspath('../..'))

from singstat import NAME, AUTHOR, VERSION

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

from singstat import name, author, version
# -- Project information -----------------------------------------------------

project = name
copyright = '2019, {}'.format(author)
project = NAME
copyright = f'2019-2024, {AUTHOR}'

# The full version, including alpha/beta/rc tags
release = version
release = VERSION


# -- General configuration ---------------------------------------------------
Expand All @@ -56,19 +59,6 @@
'python': ('https://docs.python.org/3/', None),
}

# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = False
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True

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

Expand Down Expand Up @@ -126,7 +116,6 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'analytics_id': 'UA-144720942-2',
'fixed_sidebar': True,
'github_banner': False,
'github_repo': 'singstat',
Expand Down Expand Up @@ -221,3 +210,8 @@

# Output file base name for HTML help builder.
# htmlhelp_basename = 'doc'


# -- Options for autodoc -------------------------------------------------

autodoc_typehints = 'both'
16 changes: 5 additions & 11 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. singstat documentation master file, created by
.. singstat documentation master file
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
singstat: interact with SingStat.gov.sg's API
singstat: Interact with SingStat.gov.sg's API
=============================================

Release v\ |version|.
Release v\ |release|.

|pyversions| |pypi| |status| |license| |readthedocs|

Expand Down Expand Up @@ -49,18 +49,12 @@ Contents
--------

.. toctree::
:maxdepth: 2
:maxdepth: 3

package_overview
package_reference
external_references

Indices and tables
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
other_packages

License
-------
Expand Down
11 changes: 11 additions & 0 deletions docs/source/other_packages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Other Packages Built by Me
==========================

If you like this package, you may be interested in these packages that I have
built to work with other Government of Singapore APIs:

- `datagovsg`_: for interacting with APIs available at Data.gov.sg.
- `landtransportsg`_: for interacting with APIs available at LTA DataMall.

.. _datagovsg: https://pypi.org/project/datagovsg/
.. _landtransportsg: https://pypi.org/project/landtransportsg/
5 changes: 3 additions & 2 deletions docs/source/package/singstat.client.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
singstat.client
===============
singstat.client Client
======================

.. automodule:: singstat.client

Expand All @@ -17,4 +17,5 @@ Methods

.. autoclass:: Client
:members:
:member-order: bysource
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/source/package/singstat.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
singstat
========

Module contents
---------------

.. automodule:: singstat
:members:
:member-order: bysource
:exclude-members: Client
:show-inheritance:

singstat.singstat
-----------------

.. automodule:: singstat.singstat

.. autoclass:: SingStat
:members:
:member-order: bysource
:show-inheritance:

singstat.exceptions
-------------------

.. automodule:: singstat.exceptions

.. autoexception:: APIError
:members:
:member-order: bysource
:show-inheritance:
83 changes: 83 additions & 0 deletions docs/source/package/singstat.types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
singstat.types Response Types
=============================

.. automodule:: singstat.types

resource_id()
-------------

.. autoclass:: ResourceIdDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _ResourceIdDataDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _ResourceIdDataRecordDict
:members:
:member-order: bysource
:show-inheritance:

metadata()
----------

.. autoclass:: MetadataDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _MetadataDataDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _MetadataDataRecordsDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _MetadataDataRecordsRowDict
:members:
:member-order: bysource
:show-inheritance:

tabledata()
-----------

.. autoclass:: TabledataDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataTimeseriesDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataTimeseriesRowDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataCrossSectionalMultiDimensionalCubeDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataCrossSectionalMultiDimensionalCubeRowDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataRowColumnColumnDict
:members:
:member-order: bysource
:show-inheritance:

.. autoclass:: _TabledataDataRowColumnDict
:members:
:member-order: bysource
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/source/package/singstat.types_args.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
singstat.types_args Argument Types
==================================

.. automodule:: singstat.types_args

resource_id()
-------------

.. autoclass:: ResourceIdArgsDict
:members:
:member-order: bysource
:show-inheritance:

tabledata()
-----------

.. autoclass:: TabledataArgsDict
:members:
:member-order: bysource
:show-inheritance:
2 changes: 2 additions & 0 deletions docs/source/package_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Package Reference

package/singstat
package/singstat.client
package/singstat.types_args
package/singstat.types
Loading

0 comments on commit 1714d77

Please sign in to comment.