Skip to content

Commit

Permalink
Merge branch 'master' into remove-pytz
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney authored Oct 3, 2023
2 parents 773daf8 + 0857fdb commit 6f820cf
Show file tree
Hide file tree
Showing 160 changed files with 121 additions and 447 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Legalese

To the extent that they care, contributors should keep in mind that the source of agate and therefore of any contributions are licensed under the permissive [MIT license]. By submitting a patch or pull request you are agreeing to release your code under this license. You will be acknowledged in the AUTHORS list, the commit history and the hearts and minds of jo

[numpy]: http://www.numpy.org/
[pandas]: http://pandas.pydata.org/
[numpy]: https://numpy.org/
[pandas]: https://pandas.pydata.org/
[GitHub]: https://github.com/wireservice/agate
[issue tracker]: https://github.com/wireservice/agate/issues
[MIT license]: http://www.opensource.org/licenses/mit-license.php
[MIT license]: https://opensource.org/license/mit/
23 changes: 23 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish to PyPI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install --upgrade build
- run: python -m build --sdist --wheel
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 11 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
python:
install:
- path: .
- requirements: docs/requirements.txt
sphinx:
fail_on_warning: true
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ This is a minor release fixing several small bugs that were blocking a downstrea
1.5.0 - November 16, 2016
-------------------------

This release adds SVG charting via the `leather <http://leather.rtfd.io>`_ charting library. Charts methods have been added for both :class:`.Table` and :class:`.TableSet`. (The latter create lattice plots.) See the revised tutorial and new cookbook entries for examples. Leather is still an early library. Please `report any bugs <https://github.com/wireservice/agate/issues>`_.
This release adds SVG charting via the `leather <https://leather.rtfd.io>`_ charting library. Charts methods have been added for both :class:`.Table` and :class:`.TableSet`. (The latter create lattice plots.) See the revised tutorial and new cookbook entries for examples. Leather is still an early library. Please `report any bugs <https://github.com/wireservice/agate/issues>`_.

Also in this release are a :class:`.Slugify` computation and a variety of small fixes and improvements.

Expand All @@ -117,7 +117,7 @@ The complete list of changes is as follows:
* Tables rendered by :meth:`.Table.print_table` are now GitHub Flavored Markdown (GFM) compatible. (#626)
* The agate tutorial has been converted to a Jupyter Notebook.
* :class:`.Table` now supports ``len`` as a proxy for ``len(table.rows)``.
* Simple SVG charting is now integrated via `leather <http://leather.rtfd.io>`_.
* Simple SVG charting is now integrated via `leather <https://leather.rtfd.io>`_.
* Added :class:`.First` computation. (#634)
* :meth:`.Table.print_table` now has a `max_precision` argument to limit Number precision. (#544)
* Slug computation now accepts an array of column names to merge. (#617)
Expand Down Expand Up @@ -366,7 +366,7 @@ This version of agate introduces three major changes.
* :const:`.DEFAULT_NULL_VALUES` (the list of strings that mean null) is now importable from ``agate``.
* :meth:`.Table.from_csv` and :meth:`.Table.to_csv` are now unicode-safe without separately importing csvkit.
* ``agate`` can now be used as a drop-in replacement for Python's ``csv`` module.
* Migrated `csvkit <http://csvkit.readthedocs.org>`_'s unicode CSV reading/writing support into agate. (#354)
* Migrated `csvkit <https://csvkit.readthedocs.org>`_'s unicode CSV reading/writing support into agate. (#354)

1.0.1 - October 29, 2015
------------------------
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ recursive-include benchmarks *.py
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.svg
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include examples *.csv
recursive-include examples *.json
recursive-include examples testfixed
recursive-include tests *.py
exclude .pre-commit-config.yaml
exclude .readthedocs.yaml
global-exclude *.pyc
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ agate was previously known as journalism.

Important links:

* Documentation: http://agate.rtfd.org
* Documentation: https://agate.rtfd.org
* Repository: https://github.com/wireservice/agate
* Issues: https://github.com/wireservice/agate/issues
2 changes: 0 additions & 2 deletions agate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python


import agate.csv_py3 as csv
from agate.aggregations import *
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Aggregations create a new value by summarizing a :class:`.Column`. For
example, :class:`.Mean`, when applied to a column containing :class:`.Number`
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/all.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Boolean

Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/any.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Boolean

Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python


from agate.exceptions import UnsupportedAggregationError

Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/count.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Number
from agate.utils import default
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/deciles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.percentiles import Percentiles
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/first.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation


Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/has_nulls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Boolean

Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/iqr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.percentiles import Percentiles
Expand Down
4 changes: 1 addition & 3 deletions agate/aggregations/mad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.median import Median
Expand All @@ -11,7 +9,7 @@

class MAD(Aggregation):
"""
Calculate the `median absolute deviation <http://en.wikipedia.org/wiki/Median_absolute_deviation>`_
Calculate the `median absolute deviation <https://en.wikipedia.org/wiki/Median_absolute_deviation>`_
of a column.
:param column_name:
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/max.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Date, DateTime, Number, TimeDelta
from agate.exceptions import DataTypeError
Expand Down
4 changes: 1 addition & 3 deletions agate/aggregations/max_length.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from decimal import Decimal

from agate.aggregations.base import Aggregation
Expand All @@ -13,7 +11,7 @@ class MaxLength(Aggregation):
Note: On Python 2.7 this function may miscalcuate the length of unicode
strings that contain "wide characters". For details see this StackOverflow
answer: http://stackoverflow.com/a/35462951
answer: https://stackoverflow.com/a/35462951
:param column_name:
The name of a column containing :class:`.Text` data.
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/max_precision.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Number
from agate.exceptions import DataTypeError
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/mean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.sum import Sum
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/median.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.percentiles import Percentiles
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/min.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.data_types import Date, DateTime, Number, TimeDelta
from agate.exceptions import DataTypeError
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/mode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from collections import defaultdict

from agate.aggregations.base import Aggregation
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/percentiles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

import math

from agate.aggregations.base import Aggregation
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/quartiles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.percentiles import Percentiles
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/quintiles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.percentiles import Percentiles
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/stdev.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.variance import PopulationVariance, Variance
Expand Down
1 change: 0 additions & 1 deletion agate/aggregations/sum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
import datetime

from agate.aggregations.base import Aggregation
Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/summary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation


Expand Down
2 changes: 0 additions & 2 deletions agate/aggregations/variance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.mean import Mean
Expand Down
2 changes: 0 additions & 2 deletions agate/columns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
This module contains the :class:`Column` class, which defines a "vertical"
array of tabular data. Whereas :class:`.Row` instances are independent of their
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Computations create a new value for each :class:`.Row` in a :class:`.Table`.
When used with :meth:`.Table.compute` these new values become a new column.
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python


class Computation: # pragma: no cover
"""
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/change.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.has_nulls import HasNulls
from agate.computations.base import Computation
from agate.data_types import Date, DateTime, Number, TimeDelta
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/formula.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.computations.base import Computation


Expand Down
2 changes: 0 additions & 2 deletions agate/computations/percent.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python


from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.sum import Sum
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/percent_change.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.has_nulls import HasNulls
from agate.computations.base import Computation
from agate.data_types import Number
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/percentile_rank.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.percentiles import Percentiles
from agate.computations.rank import Rank
from agate.data_types import Number
Expand Down
2 changes: 0 additions & 2 deletions agate/computations/rank.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from decimal import Decimal
from functools import cmp_to_key

Expand Down
2 changes: 0 additions & 2 deletions agate/computations/slug.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from agate.aggregations.has_nulls import HasNulls
from agate.computations.base import Computation
from agate.data_types import Text
Expand Down
18 changes: 8 additions & 10 deletions agate/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
This module contains the global configuration for agate. Users should use
:meth:`get_option` and :meth:`set_option` to modify the global
Expand All @@ -12,21 +10,21 @@
+=========================+==========================================+=========================================+
| default_locale | Default locale for number formatting | default_locale('LC_NUMERIC') or 'en_US' |
+-------------------------+------------------------------------------+-----------------------------------------+
| horizontal_line_char | Character to render for horizontal lines | '-' |
| horizontal_line_char | Character to render for horizontal lines | '-' |
+-------------------------+------------------------------------------+-----------------------------------------+
| vertical_line_char | Character to render for vertical lines | '|' |
| vertical_line_char | Character to render for vertical lines | '|' |
+-------------------------+------------------------------------------+-----------------------------------------+
| bar_char | Character to render for bar chart units | '░' |
| bar_char | Character to render for bar chart units | '░' |
+-------------------------+------------------------------------------+-----------------------------------------+
| printable_bar_char | Printable character for bar chart units | ':' |
| printable_bar_char | Printable character for bar chart units | ':' |
+-------------------------+------------------------------------------+-----------------------------------------+
| zero_line_char | Character to render for zero line units | '▓' |
| zero_line_char | Character to render for zero line units | '▓' |
+-------------------------+------------------------------------------+-----------------------------------------+
| printable_zero_line_char| Printable character for zero line units | '|' |
| printable_zero_line_char| Printable character for zero line units | '|' |
+-------------------------+------------------------------------------+-----------------------------------------+
| tick_char | Character to render for axis ticks | '+' |
| tick_char | Character to render for axis ticks | '+' |
+-------------------------+------------------------------------------+-----------------------------------------+
| ellipsis_chars | Characters to render for ellipsis | '...' |
| ellipsis_chars | Characters to render for ellipsis | '...' |
+-------------------------+------------------------------------------+-----------------------------------------+
"""
Expand Down
2 changes: 0 additions & 2 deletions agate/csv_py3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
This module contains the Python 3 replacement for :mod:`csv`.
"""
Expand Down
2 changes: 0 additions & 2 deletions agate/data_types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

"""
Data types define how data should be imported during the creation of a
:class:`.Table`.
Expand Down
2 changes: 0 additions & 2 deletions agate/data_types/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python


from agate.exceptions import CastError

Expand Down
2 changes: 0 additions & 2 deletions agate/data_types/boolean.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from decimal import Decimal

from agate.data_types.base import DEFAULT_NULL_VALUES, DataType
Expand Down
2 changes: 0 additions & 2 deletions agate/data_types/date.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

import locale
from datetime import date, datetime, time

Expand Down
2 changes: 0 additions & 2 deletions agate/data_types/date_time.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

import datetime
import locale

Expand Down
Loading

0 comments on commit 6f820cf

Please sign in to comment.